-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Nested Message-body Attributes #28
Comments
Personally I really like this idea. I do plan to introduce description of message-body parameters (a.k.a. state or attributes) in the upcoming API Blueprint format - #25. Originally I was thinking about utilizing some sort "JSON pointer" or just something simple as MongoDB dot notation but this seems really natural and thus might be a better fit for Markdown documents. It could even be extended for URI parameters. Intriguing. Let's merge this issue with #25. OK? Regarding a time frame: I probably won't have time to start working on it before November, so if you could contribute to speed it up it would be great. Both a pull request to the API Blueprint specification & examples as well as to the actual parser are welcome. |
Sorry if I'm misunderstanding the problem, but couldn't this be solved by using the schema section to document a JSON schema? |
@BRMatt probably could - all of parameter descriptions are redundant to Schema. It's a simpler syntax for people who wouldn't go through writing a full-spec schema. |
@zzen Awesome, thanks for clarifying that. |
You are indeed correct. You can achieve similar, if not all, of this by using a JSON Schema. However while following should be roughly equivalent: Body:
Schema:
Attributes:
The parametric approach has arguably two huge benefits:
|
Note: I have renamed this issue from |
To be addressed with #25 |
RE: the tweet I sent to @apiblueprint and with @zdne.
We're currently documenting an API which takes POST params of the form:
and we'd love to see the ability to represent this nesting of parameters, or even describing of an object's optional/required parameters in the Blueprint spec.
I envisage it may look something like:
Or perhaps it could take the form:
I think the first option would be a lot cleaner.
Are there any plans on implementing something along these lines? Or how would we go about getting that in motion?
Cheers,
Jason
The text was updated successfully, but these errors were encountered: