Add checks for strict null checks #1583
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What issue does this pull request resolve?
It addresses some of the issues with #1521 by checking if strict null checks is enabled, and if not, setting all exported types from json-schema to a string literal indicating the problem.
What changes did you make?
UncheckedExternalType
and made internal, then added an external type that wraps it with the type above._partial
fromJSONSchemaType
. This shouldn't have been used in the past as one could just usePartialSchema
and it was arguably marked as private with the underscore name, but it did still used to be exposed._partial
toIsPartial
to conform with standard capitalization of types, which is now also less relevant as that parameter isn't exported.Is there anything that requires more attention while reviewing?
_partial
fromJSONSchemaType
is backwards compatibility breaking. If you're worried about that I can add it back, but ultimately think it should be removedUnchecked...
that's pretty verbose and maybe not clear, so I'm open to other names.