Class VictoolsJsonSchemaBuilder
java.lang.Object
org.sdase.commons.shared.asyncapi.jsonschema.victools.VictoolsJsonSchemaBuilder
- All Implemented Interfaces:
JsonSchemaBuilder
A
JsonSchemaBuilder
that uses victools/json-schema-generator to
build Json Schemas from Java code.-
Constructor Summary
ConstructorsConstructorDescriptionVictoolsJsonSchemaBuilder
(com.github.victools.jsonschema.generator.SchemaGeneratorConfig schemaGeneratorConfig) AVictoolsJsonSchemaBuilder
with custom configuration. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.sdase.commons.shared.asyncapi.jsonschema.JsonSchemaBuilder
toJsonSchema
-
Constructor Details
-
VictoolsJsonSchemaBuilder
public VictoolsJsonSchemaBuilder(com.github.victools.jsonschema.generator.SchemaGeneratorConfig schemaGeneratorConfig) AVictoolsJsonSchemaBuilder
with custom configuration.- Parameters:
schemaGeneratorConfig
- the configuration
-
-
Method Details
-
fromDefaultConfig
- Returns:
- a
JsonSchemaBuilder
generating schemas suitable for AsyncAPI.
-
toJsonSchema
Description copied from interface:JsonSchemaBuilder
- Specified by:
toJsonSchema
in interfaceJsonSchemaBuilder
- Parameters:
type
- the java type, usually aClass
, for which the Json Schema should be created.- Returns:
- A
Map
with the Json Schemas of all types needed to describe the giventype
. The key of the map qualifies as definition key as used in/components/schemas/<key>
for the respective Json Schema. One key exactly matches theClass.getSimpleName()
of the giventype
and refers to the Json Schema of that type. All references to other generated schemas in the returned map are qualified as$ref: "#/components/messages/<map-entry-key>
when referenced. - See Also:
-