Class GeneratorContext
java.lang.Object
io.micronaut.jsonschema.generator.utils.GeneratorContext
An aggregator for storing and accessing definitions and oneOf relations from json schema.
Saves a map of definition reference to TypeDef, Boolean (boolean value is true if the type is a class/interface object).
Saves a map of oneOf objects to keep in track on inheriting objects.
- Since:
- 1.3
- Author:
- Elif Kurtay
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA recorded generation warning. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefinition(String key, Schema definition) voidaddDefinition(String key, io.micronaut.sourcegen.model.TypeDef classDef, boolean isClass) voidvoidvoidaddTempDefinition(String referringDef, String ref) voidclearAll()voidEnable generation behavior used by the JSON schema records pipeline.Get the current configuration.io.micronaut.sourcegen.model.TypeDefgetDefinitionType(String key) Get recorded warnings.booleanhasDefinition(String key) booleanbooleanisDefinitionClass(String key) booleanisInheriting(String className) booleanvoidsetConfiguration(SourceGeneratorConfig configuration) Set the current configuration.voidRecord a non-fatal generation warning.
-
Constructor Details
-
GeneratorContext
public GeneratorContext()
-
-
Method Details
-
isDefinitionClass
-
getDefinitionType
-
getOneOfsToGenerate
-
hasDefinition
-
isInheriting
-
addDefinition
-
addDefinition
public void addDefinition(String key, io.micronaut.sourcegen.model.TypeDef classDef, boolean isClass) -
addTempDefinition
-
addOneOf
-
addOneOf
-
clearAll
public void clearAll() -
enableJsonSchemaRecordsProfile
public void enableJsonSchemaRecordsProfile()Enable generation behavior used by the JSON schema records pipeline.The records profile keeps the default generator path intact, but opts into pipeline-specific behavior such as generated
@JsonSchemaannotations, stricter diagnostics for unsupported discovered-schema constructs, record-safe nullability/boxing, local-reference fallbacks, and Oracle provider metadata handling. -
setConfiguration
Set the current configuration.- Parameters:
configuration- The configuration
-
getConfiguration
Get the current configuration.- Returns:
- The configuration
-
warn
-
getWarnings
-
isAddGeneratedJsonSchemaAnnotation
public boolean isAddGeneratedJsonSchemaAnnotation()- Returns:
- Whether generated types should be annotated with
@JsonSchema
-
isJsonSchemaRecordsProfile
public boolean isJsonSchemaRecordsProfile()- Returns:
- Whether record-generation profile behavior is enabled for unsupported/discovered-schema
handling. This is not a general JSON Schema mode flag; it is set by
enableJsonSchemaRecordsProfile()and scopes compatibility-sensitive behavior to the records pipeline.
-