Closed tillwestpfahl closed 5 months ago
[WONT_FIX]
this library is mainly for validation. During compilation phase, we retain only the information that is required for validation.
so converting schema struct back to json might work in most cases but not in all cases. So I don't think it would be good this feature to add to the library which does not work for all cases.
Is there a way to parse jsonschema.Schema to a string or to json? That would be useful for making JSON-Schemas available via API-Requests.
Personal use case: I have multiple schemas sharing the same
$defs
. With this library i would have to only add the definitions once from a singledefs.json
file, and compile all schemas while referencing that file. That would safe a lot of duplications. The only thing preventing me from doing that is, that I need to be able to return those schemas in grpc and later REST as strings, to use them in the frontend. Currently I justgo:embed
for that.