top | item 7567066

Write JSON Schema in Markdown (MSON proposal)

11 points| zdne | 12 years ago |github.com

12 comments

order
[+] rdwallis|12 years ago|reply
What problem do you have that MSON solves?
[+] zdne|12 years ago|reply
As discussed in the MSON README - there is this Markdown format for documenting APIs; discussing / describing API payloads and resources in JSON Schema felt complex and not suiting well the settings of a Markdown document.

Besides some payloads are not just a JSON. So there is a need to describe these data in a media-type agnostic form.

[+] Almad|12 years ago|reply
Writing JSON Schema by hand and embedding it into Markdown sucks. MSON provides a Markdown-compatible way.
[+] wtetzner|12 years ago|reply
Writing JSON by hand sucks?
[+] tlarkworthy|12 years ago|reply
I write JSON schema in YAML, then js-yaml it to JSON. The source YAML looks remarkably similar to MSON
[+] Gobitron|12 years ago|reply
Slightly off-topic - any recommendations on the best javascript/node JSON Schema library?
[+] norswap|12 years ago|reply
We mostly need a replacement for JSON schema, which is not quite powerful enough.
[+] boronine|12 years ago|reply
What do you think about Teleport [0]? It is more like an actual type system (with dependent types!), with type signatures that get encoded in JSON. In Python (the only functioning implementation thus far), a real definition looks something like this [1].

Rather than providing a big fixed set of types, Teleport provides just the basics and allows you to define your own types, be it JSON-encoded primitives or fancy deeply nested structures.

Since my partner left to work on something else, work on Cosmic slowed down, but I'm successfully using Teleport at my day job and planning a new release soon, along with a complete JavaScript port.

[0] http://www.cosmic-api.com/docs/teleport/python/latest/

[1] https://github.com/cosmic-api/cosmic.py/blob/master/cosmic/t...

[+] tlarkworthy|12 years ago|reply
which spec are you working off? I am really interested in hearing what you think is not powerful enough. The meta-schema unioned all the types together. I find that annoying, but its drafted to be fixed in v5

anything else?

[+] KhalPanda|12 years ago|reply
Much benefit over coffeescript?