FasterXML / FasterXML/jackson-module-jsonSchema

Combined SchemaFactoryWrapper

Aperta
#74 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
387
Fork
136
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.