flipstone / json-fleece

Extensible JSON Schemas for Haskell
MIT License
2 stars 1 forks source link

`format: date-time` not honoured in inline schema handling #44

Open ysangkok opened 1 month ago

ysangkok commented 1 month ago

43 adds an inline format: date-time which doesn't get turned into any date/time type in the code gen, instead it is a T.Text.

Other branches generate errors when they see inline schemas in unsupported locations. Should we generate an error when we see format: date-time, or should we just fix the functionality and make it work? One could argue that mkInlineStringSchema should always get enough information, and always be able to generate an appropriate date/time type. But then it would also need TypeOptions, to support the overriding we have for those.


mkInlineOneOfSchema [...] =
[...]
    Just OA.OpenApiString -> mkInlineStringSchema schemaKey schema              
[...]                  
    Just OA.OpenApiObject -> raiseError "Inline OpenApiObject schemas are not currently supported in oneOf."