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

conditionally requiring properties #51

Open
jamesdixon opened this issue Feb 15, 2016 · 2 comments
Open

conditionally requiring properties #51

jamesdixon opened this issue Feb 15, 2016 · 2 comments

Comments

@jamesdixon
Copy link

Hello, is there a way to indicate that a parameter is required if and only if another parameter is passed?

For example, I have an endpoint that returns a list of appointments. That list can be filtered using startDate and endDate. They are both required if and only if one of them is passed, otherwise, they're optional.

I see something similar using the One Of syntax.

Best,
James

@zdne
Copy link
Contributor

zdne commented Feb 15, 2016

Interesting. This is currently not possible. This seems like an optional include :)

Like (hypothetical sytnax)

# My Object (object)
- someattr
- Include (Date Mixin, optional)

# Date Mixin
- startDate (required)
- endDate (required) 

@pksunkara
Copy link
Contributor

Optional mixins sounds like a good feature.

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

No branches or pull requests

3 participants