Skip to content
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

[Request] Add test/example for IfThenElseConstraint #44

Closed
mdurling opened this issue Jan 6, 2021 · 3 comments
Closed

[Request] Add test/example for IfThenElseConstraint #44

mdurling opened this issue Jan 6, 2021 · 3 comments
Assignees
Labels

Comments

@mdurling
Copy link
Contributor

mdurling commented Jan 6, 2021

I am trying to use this library with TS 4.1.3. It would be super helpful if the library contained tests or an example on how to use some of the more advanced JSON Schema features, in particular the IfThenElseConstraint

@mdurling
Copy link
Contributor Author

mdurling commented Jan 8, 2021

@ostrowr I think there may be a slight problem with the types for If, Then, and Else. The current types:

if?: Then extends SchemaLike ? SchemaLike : Else extends SchemaLike ? SchemaLike : never;
then?: If extends SchemaLike ? SchemaLike : never;
else?: If extends SchemaLike ? SchemaLike : never;

Are causing tsc errors which resolve if I change the definitions as follows:

if?: Then extends SchemaLike ? If : Else extends SchemaLike ? If : never;
then?: If extends SchemaLike ? Then : never;
else?: If extends SchemaLike ? Else : never;

@ostrowr
Copy link
Owner

ostrowr commented Jan 11, 2021

closed by #45

@ostrowr ostrowr closed this as completed Jan 11, 2021
@ostrowr
Copy link
Owner

ostrowr commented Jan 11, 2021

This is fixed in 0.7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants