scala-jsonschema icon indicating copy to clipboard operation
scala-jsonschema copied to clipboard

SchemaRepresentation

Open andyglow opened this issue 3 years ago • 0 comments

the problem

Today there are several versions of a json-schema standard exists. Apart from it there is an openapi that specifies a little different way of defining the schema. Also, there may come new requirements like #190 that may extend the way the resulting schema json may look like

current state

Today to solve this we have a hierarchy of AsDraft classes. Those are associated with corresponding version of the spec. Every time we want a new spec version, we need to introduce new class AsV1, AsV2, etc... it's more or less fine.

But how can end user provide his own schema representation?

solution

We can try to leverage the feature registry approach. We define a structure that represents all the aspects the renderer may need to consider in order to render the schema into a final json schema representation.

andyglow avatar Sep 20 '21 20:09 andyglow