-
Notifications
You must be signed in to change notification settings - Fork 71
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
Nesting: object/array as property value or action field? #43
Comments
I'm not aware of SIren restricting the value of a property. I have had On Sat, Feb 7, 2015 at 12:18 PM, Sébastien Cevey [email protected]
|
I hope so, or I'm going to have to change a whole lot of code. ;) |
Cool, thanks for the feedback on properties. Maybe this could be made clearer in the spec? How about values in the fields definitions of actions? |
@kevinswiber What's your take on this? |
Yes, the properties attribute is just a valid JSON object. I'm not entirely sure what you mean by the second question. Action fields map to HTML5 input types, though support for There's also no clear and easy way to include support for JSON along with a JSON schema. I've hammered this in before using a single There are more issues with actions, but before I keep guessing, maybe you can clarify a little. :) |
@kevinswiber What I meant was how do you describe an action in your API that requests sending fields that are themselves objects, e.g. {
"name": "Tom",
"permissions": ["admin", "god"],
"address": {
"street": "21 Sample St",
"city": "Orlando"
}
}
Full disclaimer: I work on the argo media-type, which we have been using in multiple projects for a couple of years. It is fairly similar to Siren in many ways. One thing argo is currently missing and I'm looking into adding is the support for "actions". I wanted to review how Siren does it to see if the same semantics could be adopted, but I'm worried the use of HTML5 input types makes it hard to specify richer structures. |
Ah, I see. Your The |
Thanks for the clarification. JSON Schema is something I'm considering as it seems more generic and expressive, though I know it's sometimes reproached for being too complex and, well, expressive. |
From the spec and the examples (in this repo and of sample APIs), I wasn't able to confirm whether Siren supports arrays or objects as values for
properties
orfields
.For example, for the properties, is the following valid Siren?
And in terms of fields, is it possible to describe an action that would require the client to send one of the following strings of JSON:
or
The text was updated successfully, but these errors were encountered: