FasterXML / FasterXML/jackson-module-jsonSchema

Combined SchemaFactoryWrapper

Open
#74 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
387
Forks
136
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.