-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: new strictNot
option, enabled by default
#493
Comments
Thank you for your contribution! It is true that I looked at As for the implementation details, you have added a new type to the return type of the Thank you for raising the issue. |
Ok, i'll try to do an outline next week. |
Hi, thanks again for your positive responses!
This is the last update until discussing the issue with multiple index signatures being sometimes generated with
patternProperties
.The status of this feature is not totally complete i guess.
You can have a look at
test/not_test.ts
in my PR #492, but i'm not sure of the consistency of the expected results.The rationale is the behavior when a
not
keyword is encountered.nb: this PR preserves the
void
output for openAPI responses.Let me explain my usage of your module:
it's used in the context of an API-first backend.
i use json-schemas to validate collection files (in a format really close to json hyper-schema), with strict requirements (such as union / oneOf with some members having forbidden properties).
but then, after conversion by
dtsgenerator
, i neednot
properties to not cancel the positive definitions by producing avoid
type, but have the definition as if thenot
keyword was not present, since some combinations are not always directly expressible in typescript.Now that i'm writing this, i'm thinking perhaps it would be better to generate precise
never
keys whenever possible, and remove the new option entirely.Note that this PR introduces the
false
value in normalized schemas (which makes sense sinceboolean
is an allowed type in json-schema), also used when there's no value such as in the empty openAPI response case.Imo this part should be kept anyway, since it allows for a more correct
not
keyword handling.Let me know what you think about this.
PR #492
The text was updated successfully, but these errors were encountered: