![]() Only fields and classes annotated with MyView will appear in the schema JsonSchemaGenerator generator = new JsonSchemaGenerator( objectMapper) ![]() And the trick: grab the serializationConfig and define the desired view objectMapper. Disabling default View so only the properties that matter are output objectMapper. ObjectMapper objectMapper = new ObjectMapper() This means that you also need to use Java 8.Īrtifacts for both Scala 2.10, 2.11 and 2.12 is now available (Thanks to for adding crossBuild functionality). The project is also compiled using Java 8. This project publishes artifacts to central maven repo. ![]() I would really appreciate it if other developers wanted to start using and contributing improvements and features. Project statusĪpplications using this project has been in production for many years. To enforce this into the generated schema, you can map the SuperType into the specific-type. You know upfront that the user needs to enter/specify a specific subType. It might be the case that you have a complex Class-structure using Polymorphism, but for some reason This can be used to remap the Class found by Jackson into another Class before generating the schema for it. JsonSchema with the injected can also be used on properties.Īnother way of altering the generated schema is to use the config-param classTypeReMapping. If you want to have full control over it, you can specify = false to replace the generated The default behaviour of is to merge the injected json into the generated JsonSchema. Used when creating the JsonSchemaGenerator. Then you have to add the mapping between the key 'theKeyToUseWhenLookingUpASupplier' and the Supplier-instance in the config-object You can make it work by injecting the following json-schema-fragment:Ĭase class MyPojo JsonSchemaInject(jsonSupplierViaLookup = "theKeyToUseWhenLookingUpASupplier ") If this generator does not generate exactly the schema you want, you can inject it by using you need to use patternProperties (which is not currently 'natively' supported by mbknor-jackson-jsonSchema), Supports injecting custom json-schema-fragments using the Simple implementation - Just one file (for now.). ![]() Supports custom Class-to-format-Mapping.Special handling of Option-/Optional-properties using oneOf.defaultValue) / Supports many Javax-validation including support for validation-groups.Supports polymorphism ( MixIn, and registerSubtypes()) using JsonSchema's oneOf-feature.In generating jsonSchema from your POJOs using Jackson JSON Schema DRAFT-04, DRAFT-06, DRAFT-07 and DRAFT-2019-09 This projects aims to do a better job than the original jackson-module-jsonSchema ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |