-
Notifications
You must be signed in to change notification settings - Fork 181
Use markdown links in mson #16
Comments
You already have the perfect way to do embedding too... # Address (object)
- street: Main Street
- city: Maine
- zip: 12345
# User (object)
- name: Ben Longden
- address (Address) {
"_embedded": {
"address": [
{
"street": "Main Street",
"city": "Maine",
"zip": "12345"
}
]
},
"name": "Ben Longden"
} Again, formats like HAL that support embedding resources are able to do so. |
@zdne Interesting idea of @blongden's I think that could fast track relations. Basically you could have a # Relations section and just use markdown links as the Value Definition (I think that is what we call it). I am not sure I would recommend interspersing it with the attributes though, as an initial reaction. |
@fosrias do you mean something like # Resource
## Attributes
- name: A door
- colour: green
- description: A green door
## Relations
- destination: http://domain.io/rooms/kitchen ? |
@blongden if you wonder what @fosrias is talking about – in our "bigger picture" we plan to add dedicated section for affordances / relations as we have suggested in the concept of Resource Blueprint and demonstrated at API Craft this year. Hence the Now when it comes to this:
technically it would be possible, however I do think that separating the hypermedia control from the resource attibutes / data payloads is a helpful concept. Moreover MSON tries to be media-type agnostic, and as such we would have hard times representing this |
@z Yes. That is what I meant. On Thu, Dec 11, 2014 at 12:24 PM, Z [email protected] wrote:
|
Ok, I like the idea of explicitly defining a Relations header, though I wonder how this would translate into formats like JsonApi or HyperJson (where any object containing an href value is a link). Both of these are very much inline with the data. That said, order is not important, so maybe it's not an issue. |
@blongden now this is interesting discussion, idealistically you describe the resource attributes without its hypermedia controls (affordances, relations) and based on the media type we will provide the representation serialization. With that being said, you can always opt-out and explicitly describe these payloads (attributes and controls) in MSON without using the "relations header". This will be probably sub optimal and hopefully not needed, but still possible, yes. Definitely a fair point! We may not be able to accommodate all media types in this but I guess we need to do the cut somewhere (but try to get in as many as possible re Hypermedia Project) |
If I was to have the following document
It would be great if it could be rendered in hal like the following
That way, formats that can express outbound links in a defined manner (like HAL can) are able to do so without embedding the Hal '_links' field into the markdown representation.
You could format this completely differently for json-api or Siren too, depending on what's required.
Thoughts? :)
The text was updated successfully, but these errors were encountered: