We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See http://json-schema.org/latest/json-schema-validation.html#format
For example, if we have the node
"datum": { "required: ["createdDate"] "properties": { "createdDate": { "type": "string", "format": "date-time" } } }
we want it to generate the type
type alias Datum = { createdDate: Date }
rather than
type alias Datum = { createdDate: String }
Possible decoder for date-time could be:
date-time
dateDecoder : Decoder Date dateDecoder = Decode.string |> Decode.andThen (\dateStr -> case Date.fromIsoString dateStr of Ok date -> Decode.succeed date Err err -> Decode.fail err )
Possible encoder
encodeDate : Date -> Value encodeDate date = date |> Date.toIsoString |> Encode.string
However, the implications for the parser has to be checked first.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
See http://json-schema.org/latest/json-schema-validation.html#format
For example, if we have the node
we want it to generate the type
rather than
Possible decoder for
date-time
could be:Possible encoder
However, the implications for the parser has to be checked first.
The text was updated successfully, but these errors were encountered: