Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants