spiral-project / daybed

Form validation and data storage API
http://daybed.rtfd.org/
BSD 3-Clause "New" or "Revised" License
53 stars 8 forks source link

[WIP] Add Json schema support #195

Open almet opened 10 years ago

almet commented 10 years ago

Here are the types supported by Daybed that we need to convert to JSON Schema:

GeoTypes:

leplatrem commented 10 years ago

Great ! We should definitely follow standards ! ref #53 I could help you on this, this is quite a big task :)

almet commented 10 years ago

I added some changes to the branch, and I updated the description to contain the list of fields we currently support in daybed.

I'll be out starting tomorrow for one week, don't hesitate to continue what I started :)

almet commented 10 years ago

A few outstanding questions:

almet commented 10 years ago

FWIW, here is the doc I'm using as a reference https://spacetelescope.github.io/understanding-json-schema/

Natim commented 10 years ago

For relations between models modelname is a string.

leplatrem commented 10 years ago

I was wondering if it is still relevant to have our own schema formalism... I mean, instead of formatting our custom stuff to the standard JSON schema, just accept it as input for model creation ?

Natim commented 10 years ago

For know it is relevant because our schema is close to what daybed do. Btw we could implement both input formalisms if we need to be compatible somehow and ask the question again then.

almet commented 10 years ago

@leplatrem, I was wondering the exact same thing.

I believe what we have for daybed is simpler than json schema, but I may be wrong. Especially, for the geometric fields, there is nothing that deals with them in json schema, so that could be a bit hard to do.

For really simple cases, I believe we should accept JSON Schema definitions, and that would make us open to a list of services that already support this formalism.

However, that's in my opinion a separate issue. In this one, I think we should focus on outputing a json schema from a daybed (colander) definition.

almet commented 10 years ago

for now, mimetype is application/schema+json

almet commented 10 years ago

@leplatrem do you have any idea how we can deal with geographic fields here?

leplatrem commented 10 years ago

I found only one example, and it looks pretty complete : https://github.com/fge/sample-json-schemas/blob/master/geojson/geometry.json

In Daybed we have a geojson geometry field (as above), and some basic geo fields that could be described with the positions part only (coordinates only)