FasterXML / FasterXML/jackson-module-jsonSchema

Combined SchemaFactoryWrapper

Offen
#74 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
387
Forks
136
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I'm using the `HyperSchemaFactoryWrapper` to generate schema `links`, now I'd like to add validation patterns through `ValidationSchemaFactoryWrapper` and write some other wrappers for additional properties. Is it possibile?
I'm using this code:

``` java
ObjectMapper mapper = new ObjectMapper();
SchemaFactoryWrapper hyperVisitor = new HyperSchemaFactoryWrapper();
SchemaFactoryWrapper validationVisitor = new ValidationSchemaFactoryWrapper();
mapper.acceptJsonFormatVisitor(MyBean.class, hyperVisitor);
mapper.acceptJsonFormatVisitor(MyBean.class, validationVisitor);
JsonSchema hyperSchema = hyperVisitor.finalSchema();
JsonSchema validationSchema = validationVisitor.finalSchema();

```

since the `JsonSchema` is generated by the `SchemaFactoryWrapper.finalSchema()` I can easily get two distinct schemas but I'm not able to see how can I get a single schema with the two visitors combined.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.