Giter Site home page Giter Site logo

Use JSON schema in definitions about daybed HOT 3 OPEN

leplatrem avatar leplatrem commented on July 19, 2024
Use JSON schema in definitions

from daybed.

Comments (3)

AntoineCezar avatar AntoineCezar commented on July 19, 2024

Should it replace or supplement the current definition formalism ?

It could be plugable.

Does it support current and planned field types ? #51 #33 #29

http://json-schema.org/latest/json-schema-validation.html#anchor108
for #33 we'll define the schema https://github.com/fge/sample-json-schemas/tree/master/geojson

Is it extensible and simple enough to add custom notions ? #11
Could it address the need of defining and validating relationships between models ? #32

Play with this to get an idea: http://exavolt.github.io/onde/#?schema_url=schemas/jquery-package.json

from daybed.

AntoineCezar avatar AntoineCezar commented on July 19, 2024

Is it redundant with SPORE ?

SPORE Doesn't deal with schemas. Unless I'm missing something it's only about api discovery.

from daybed.

almet avatar almet commented on July 19, 2024

Thanks for bringing this to the table.

Using Json Schema seems indeed something to consider, using our own format wouldn't bring any good.
However, from what I see, JSONSchema still lacks some clear readability. By looking at the documentation, I wasn't able to tell simply if it's possible or not to use regular expressions or not.

About the concerns you have:

Should we replace or supersede what we have with JSONSchema?

I'm tempted to say we should use JSONSchema in parallel with the daybed formalism, but it means we need to write translation logic between the two, which I'm not sure would be reliable. If we validate JSONSchema as good enough to do what we are doing atm, maybe we should just switch there.

I've made a couple of queries to my search engine of choice and found that someone already did something related, so we may give it a go. (also, it means we lack the other direction, which is json schema to colander).

Does it handle what we have or plan?

I'm unsure about that, but it seems pretty complete. But JSon Schema doesn't seem to be very easy to extend:

Implementations MAY choose to define additional keywords to JSON Schema. Save for explicit agreement, schema authors SHALL NOT expect these additional keywords to be supported by peer implementations. Implementations SHOULD ignore keywords they do not support.

Also, the documentation say they support geo fields, but only lat/long from what I see, which might not be enough for us.

The specification document also states that it is about to expire "Expires: August 3, 2013", not sure what it means.

Redundancy with SPORE

It's not redundant with SPORE, and can be complimentary. The latter describes APIs in how we interact with them (HTTP Verbs, acceptable status code, resources URI), whereas JSON Schema does, well, schema validation.

I'm aware I'm not addressing all the questions you ask, but that's a start. I think we need to start playing with it to be sure of what we do. For now I'm not totally sold to the thing because I find it really complicated, or at least some beginner documentation is not made available.

Don't hesitate to share any good doc you found on it here.

from daybed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.