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
Modifier and TypeClassDescriptionstatic enum
An enum for JSON Schema draft versions. -
Field Summary
-
Constructor Summary
ConstructorDescriptionJsonSchemaContext
(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 aJsonSchemaContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionbaseUrl()
Returns the value of thebaseUrl
record component.boolean
Returns the value of thebinaryAsArray
record component.static JsonSchemaContext
createDefault
(Map<String, String> options) Returns the value of thecreatedSchemasByType
record component.List<io.micronaut.inject.ast.ClassElement>
Returns the value of thecurrentOriginatingElements
record component.draft()
Returns the value of thedraft
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theoutputLocation
record component.boolean
Returns the value of thestrictMode
record component.final String
toString()
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 aJsonSchemaContext
record class.- Parameters:
outputLocation
- the value for theoutputLocation
record componentbaseUrl
- the value for thebaseUrl
record componentbinaryAsArray
- the value for thebinaryAsArray
record componentdraft
- the value for thedraft
record componentstrictMode
- the value for thestrictMode
record componentcreatedSchemasByType
- the value for thecreatedSchemasByType
record componentcurrentOriginatingElements
- the value for thecurrentOriginatingElements
record component
-
-
Method Details
-
getParameters
-
createDefault
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
outputLocation
Returns the value of theoutputLocation
record component.- Returns:
- the value of the
outputLocation
record component
-
baseUrl
Returns the value of thebaseUrl
record component.- Returns:
- the value of the
baseUrl
record component
-
binaryAsArray
public boolean binaryAsArray()Returns the value of thebinaryAsArray
record component.- Returns:
- the value of the
binaryAsArray
record component
-
draft
Returns the value of thedraft
record component.- Returns:
- the value of the
draft
record component
-
strictMode
public boolean strictMode()Returns the value of thestrictMode
record component.- Returns:
- the value of the
strictMode
record component
-
createdSchemasByType
Returns the value of thecreatedSchemasByType
record component.- Returns:
- the value of the
createdSchemasByType
record component
-
currentOriginatingElements
Returns the value of thecurrentOriginatingElements
record component.- Returns:
- the value of the
currentOriginatingElements
record component
-