brettviren / moo

ruminants on module oriented programming
GNU General Public License v3.0
4 stars 4 forks source link

Produce JSON Schema acceptable by jsonforms and jsonvalidate #24

Closed brettviren closed 3 years ago

brettviren commented 3 years ago

https://github.com/jsonform/jsonform builds web forms in Javascript from JSON Schema.

moo can already produce JSON Schema that can be used by the Python implementation of JSON Schema validators but this form does not seem to be acceptable by JSON Forms' demo:

https://ulion.github.io/jsonform/playground/

Furthermore, JSON Forms accepts some extension to JSON Schema so we may provide "title" and "description" and moo should populate these from their equivalent attributes provided in the moo schema.

A form which the Python validators can accept must be retained.

brettviren commented 3 years ago
  1. jsonform supports only a part of the older JSON Schema v4.

$ref: is not supported but docs claim a custom reference mechanism is supported

https://github.com/jsonform/jsonform/wiki#referencing-nested-schema-properties

  1. jsonform allows the top level type to be omitted and object to be assumed

https://github.com/jsonform/jsonform/wiki#schema-shortcut

  1. jsonform puts the schema under .schema and allows for a form description under .form
brettviren commented 3 years ago

Fixed in https://github.com/brettviren/moo/releases/tag/0.5.6