Open thufschmitt opened 1 month ago
So, if I understand correctly, you want to change the current output
let internal_definitions = ...defns... in
...schema def...
to something like
{
definitions = ...defns...,
Schema = ...schema def...
}
?
I think so, yes
I wonder if that should be the default, or just a command line argument.
Mh, good question :thinking:
Maybe a CLI flag would make sense, indeed. I guess the most common cases won't care about that
Since the schemas can easily be quite convoluted (with a lot of
oneOf
in particular), it's hard for Nickel to output good error messages when things go wrong, and easy for the LSP to get lost. To mitigate that, it would be nice to be able to add some contract annotations to intermediate nodes in a config. However,json-schema-to-nickel
only exposes the toplevel schema, and there's no way to access the sub-schemas.As a concrete example: I'd like to annotate this snippet to tell Nickel that it's of type normalJob, but this isn't exposed by the generated code.
What I would like
Expose all the items from the definitions or $defs field of the schema, so that they can be accessed from client-code.