json-schema-to-elm icon indicating copy to clipboard operation
json-schema-to-elm copied to clipboard

Investigate supporting the 'default' keyword

Open dragonwasrobot opened this issue 7 years ago • 2 comments

Investigate whether it makes sense to support the 'default' keyword, see 7.3 in the validation spec.

dragonwasrobot avatar Mar 05 '17 23:03 dragonwasrobot

First step in implementing the default keyword is to go through the documentation of all the defined types in lib/types and add proposals to the @moduledoc on how default should be handled in the translation from JSON schema -> Elixir types -> Elm code output.

While the spec states

It is RECOMMENDED that a default value be valid against the associated schema.

I'd expect the implementation to be a bit more pleasant (and the resulting Elm code) if we assume that the default value is valid against the schema.

dragonwasrobot avatar Aug 07 '17 14:08 dragonwasrobot

Added parser support for default keyword in json_schema.

dragonwasrobot avatar Jul 24 '22 15:07 dragonwasrobot