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

Minimum/Maximum values for URI Parameters #211

Closed
HawkiesZA opened this issue Jun 11, 2015 · 2 comments
Closed

Minimum/Maximum values for URI Parameters #211

HawkiesZA opened this issue Jun 11, 2015 · 2 comments

Comments

@HawkiesZA
Copy link

We'd like to be able to set a minimum value for URI Parameters. Could do something similar for maximum. e.g.:

  • limit (optional, integer, 10)
    Limit the number of results to return. If omitted all results in the period are returned.
    • Minimum: (0, exclusive)
    • Maximum: (10, inclusive)

Running it through snowcrash should then yield something like:

{
"name": "limit",
"description": "Limit the number of results to return. If omitted all results in the period are returned.",
"type": "integer",
"required": false,
"default": "",
"example": "10",
"values": [],
"minimum": 0,
"exclusiveMinimum": true,
"maximum": 10,
"exclusiveMaximum": false
}

@zdne
Copy link
Contributor

zdne commented Jun 15, 2015

Hey @HawkiesZA

This is definitely planned as part of MSON validation. Since Parameter's description is converging to MSON (and eventually should become the same) it should get to it as well.

However I am afraid in the interim period the only way is to write this intent (limits / validation) into parameter's description.

Any contribution to syntax and / or implementation is highly appreciated!

@zdne
Copy link
Contributor

zdne commented Sep 24, 2015

I have just proposed an RFC that should introduce the complete MSON syntax to URI parameters. This is indirectly solving this issue as MSON should eventually introduce value validation. Please see and comment on apiaryio/api-blueprint-rfcs#3

@zdne zdne closed this as completed Sep 24, 2015
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

2 participants