Mason Draft 2 ready

26 views
Skip to first unread message

Jørn Wildt

unread,
Jun 16, 2015, 11:14:50 AM6/16/15
to mason-me...@googlegroups.com
I am happy to announce that Mason Draft 2 is now ready for use. See https://github.com/JornWildt/Mason/blob/master/Documentation/Mason-draft-2.md

This version combines links, actions and link templates into one single @controls object. As the name indicates this object contains all the hypermedia elements that control the application.

This move to @controls makes it possible to combine link templates with POST data - and should make it easier to parse and represent hypermedia elements in code.

There are currently no further ideas in the pipeline that could change how things are represented in Mason. Future versions may though add new features.

Thanks for the feedback I have gotten so far.

Regards, Jørn

manuel....@gmail.com

unread,
Jun 21, 2015, 2:27:00 PM6/21/15
to mason-me...@googlegroups.com
Hi Jørn,

frst of all: Great work. Over the last few days I examined a bunch of media type proposals for hypermedia APIs (HAL, JSON.API, Hydra, Siren, Mason), and this one is my favorite. 

I have one question regarding the control properties: the schema/schemaUrl properties are supposed to reference a "schema". What kind of schema is that supposed to be? The draft lacks an example for this. JSON (Hyper) Schema? If so, I assume it's supposed to look like the schema property in this example?

Best Regards, Manuel

Jørn Wildt

unread,
Jun 22, 2015, 2:34:53 AM6/22/15
to mason-me...@googlegroups.com
Hi Manuel

You are right - the schema description is gone from the draft, I'll fix that. Thanks.

The most obvious choice is JSON Schema as you suggest yourself, but I won't restrict the format to that only. So JSON Schema is recommended but not required.

For "schemaUrl" the client can look at the returned content type to figure out the schema type.

For "schema" (embedded schema) the default is JSON schema unless something else is, somehow, identified. I recommend looking for "$schema": "http://json-schema.org/draft-04/schema#" in the embedded schema definition (which obviously would have to be encoded in JSON - unless it is serialized into a string).

So, yes, JSON Schema it is.

I would say it should look like this: http://json-schema.org/example1.html

/Jørn



--
You received this message because you are subscribed to the Google Groups "Mason media type" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mason-media-ty...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages