Record Class JsonSchemaContext
java.lang.Object
java.lang.Record
io.micronaut.jsonschema.visitor.context.JsonSchemaContext
- Record Components:
outputLocation- The location where JSON schemas will be generated inside the buildMETA-INF/directory.baseUrl- The base URI to be used for schemas.binaryAsArray- Whether to encode byte array as a JSON array. The default and preferred behavior is to encode it as a Base64 string.draft- An enum for JSON Schema draft versions. Currently only 2020-12 draft is supported.strictMode- Whether to generate schemas in strict mode. In strict mode unresolved properties in JSON will cause an error. All the properties that are not annotated as nullable must be non-null.createdSchemasByType- A cache of crated schemascurrentOriginatingElements- The originating elements for the current schema
public record JsonSchemaContext(String outputLocation, String baseUrl, boolean binaryAsArray, JsonSchemaContext.JsonSchemaDraft draft, boolean strictMode, Map<String,Schema> createdSchemasByType, List<io.micronaut.inject.ast.ClassElement> currentOriginatingElements)
extends Record
A context with configuration for the JSON schema.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum for JSON Schema draft versions. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsonSchemaContext(String outputLocation, String baseUrl, boolean binaryAsArray, JsonSchemaContext.JsonSchemaDraft draft, boolean strictMode, Map<String, Schema> createdSchemasByType, List<io.micronaut.inject.ast.ClassElement> currentOriginatingElements) Creates an instance of aJsonSchemaContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbaseUrl()Returns the value of thebaseUrlrecord component.booleanReturns the value of thebinaryAsArrayrecord component.static JsonSchemaContextcreateDefault(Map<String, String> options) Returns the value of thecreatedSchemasByTyperecord component.List<io.micronaut.inject.ast.ClassElement> Returns the value of thecurrentOriginatingElementsrecord component.draft()Returns the value of thedraftrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoutputLocationrecord component.booleanReturns the value of thestrictModerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
JSON_SCHEMA_CONTEXT_PROPERTY
- See Also:
-
PARAMETER_PREFIX
- See Also:
-
OUTPUT_LOCATION_PARAMETER
- See Also:
-
BASE_URI_PARAMETER
- See Also:
-
BINARY_AS_ARRAY_PARAMETER
- See Also:
-
JSON_SCHEMA_DRAFT_PARAMETER
- See Also:
-
STRICT_MODE_PARAMETER
- See Also:
-
DEFAULT_OUTPUT_LOCATION
- See Also:
-
DEFAULT_BINARY_AS_ARRAY
public static final boolean DEFAULT_BINARY_AS_ARRAY- See Also:
-
-
Constructor Details
-
JsonSchemaContext
public JsonSchemaContext(String outputLocation, String baseUrl, boolean binaryAsArray, JsonSchemaContext.JsonSchemaDraft draft, boolean strictMode, Map<String, Schema> createdSchemasByType, List<io.micronaut.inject.ast.ClassElement> currentOriginatingElements) Creates an instance of aJsonSchemaContextrecord class.- Parameters:
outputLocation- the value for theoutputLocationrecord componentbaseUrl- the value for thebaseUrlrecord componentbinaryAsArray- the value for thebinaryAsArrayrecord componentdraft- the value for thedraftrecord componentstrictMode- the value for thestrictModerecord componentcreatedSchemasByType- the value for thecreatedSchemasByTyperecord componentcurrentOriginatingElements- the value for thecurrentOriginatingElementsrecord component
-
-
Method Details
-
getParameters
-
createDefault
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
outputLocation
Returns the value of theoutputLocationrecord component.- Returns:
- the value of the
outputLocationrecord component
-
baseUrl
-
binaryAsArray
public boolean binaryAsArray()Returns the value of thebinaryAsArrayrecord component.- Returns:
- the value of the
binaryAsArrayrecord component
-
draft
-
strictMode
public boolean strictMode()Returns the value of thestrictModerecord component.- Returns:
- the value of the
strictModerecord component
-
createdSchemasByType
Returns the value of thecreatedSchemasByTyperecord component.- Returns:
- the value of the
createdSchemasByTyperecord component
-
currentOriginatingElements
Returns the value of thecurrentOriginatingElementsrecord component.- Returns:
- the value of the
currentOriginatingElementsrecord component
-