Interface SchemaGeneratorConfig
-
- All Superinterfaces:
StatefulConfig
- All Known Implementing Classes:
SchemaGeneratorConfigImpl
public interface SchemaGeneratorConfig extends StatefulConfig
Default implementation of a schema generator's configuration.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description com.fasterxml.jackson.databind.node.ArrayNode
createArrayNode()
Generate an empty JSON node representing an array (which will subsequently be filled by the generator).com.fasterxml.jackson.databind.node.ObjectNode
createObjectNode()
Generate an empty JSON node representing an object (which will subsequently be filled by the generator).Map<Class<? extends Annotation>,com.fasterxml.classmate.AnnotationInclusion>
getAnnotationInclusionOverrides()
Provide the explicit rule overrides of when to include particular annotations (e.g., with or without@Inherited
).CustomDefinition
getCustomDefinition(com.fasterxml.classmate.ResolvedType javaType, SchemaGenerationContext context, CustomDefinitionProviderV2 ignoredDefinitionProvider)
Look-up the non-standard JSON schema definition for a given type.<M extends MemberScope<?,?>>
CustomDefinitiongetCustomDefinition(M scope, SchemaGenerationContext context, CustomPropertyDefinitionProvider<M> ignoredDefinitionProvider)
Look-up the non-standard JSON schema definition for a given property.SchemaDefinitionNamingStrategy
getDefinitionNamingStrategy()
Getter for the naming strategy to be applied when determining key names in the "definitions"/"$defs".List<InstanceAttributeOverrideV2<FieldScope>>
getFieldAttributeOverrides()
Getter for the applicable instance attribute overrides for fields.String
getKeyword(SchemaKeyword keyword)
Getter for the indicated keyword's value in the designated JSON Schema version.List<InstanceAttributeOverrideV2<MethodScope>>
getMethodAttributeOverrides()
Getter for the applicable instance attribute overrides for methods.com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
Getter for the underlying object mapper.SchemaVersion
getSchemaVersion()
Getter for the designated JSON Schema version.List<TypeAttributeOverrideV2>
getTypeAttributeOverrides()
Getter for the applicable type attribute overrides.boolean
isNullable(FieldScope field)
Check whether a field/property is nullable.boolean
isNullable(MethodScope method)
Check whether a method's return value is nullable.boolean
isReadOnly(FieldScope field)
Check whether a field/property value is deemed read-only, i.e., may be ignored or rejected when included in a request.boolean
isReadOnly(MethodScope method)
Check whether a method value is deemed read-only, i.e., may be ignored or rejected when included in a request.boolean
isRequired(FieldScope field)
Check whether a field/property value is required.boolean
isRequired(MethodScope method)
Check whether a method value is required.boolean
isWriteOnly(FieldScope field)
Check whether a field/property value is deemed write-only, i.e., is not being returned in responses.boolean
isWriteOnly(MethodScope method)
Check whether a method value is deemed write-only, i.e., is not being returned in responses.com.fasterxml.jackson.databind.JsonNode
resolveAdditionalProperties(FieldScope field, SchemaGenerationContext context)
Determine the "additionalProperties" of an object's field/property.com.fasterxml.jackson.databind.JsonNode
resolveAdditionalProperties(MethodScope method, SchemaGenerationContext context)
Determine the "additionalProperties" of a method's return value.com.fasterxml.jackson.databind.JsonNode
resolveAdditionalPropertiesForType(TypeScope scope, SchemaGenerationContext context)
Determine the "additionalProperties" of a context-independent type representation.String
resolveAnchorForType(TypeScope scope)
Determine the "$anchor" of a context-independent type representation.Integer
resolveArrayMaxItems(FieldScope field)
Determine the "maxItems" of an object's field/property.Integer
resolveArrayMaxItems(MethodScope method)
Determine the "maxItems" of a method's return value.Integer
resolveArrayMaxItemsForType(TypeScope scope)
Determine the "maxItems" of a context-independent type representation.Integer
resolveArrayMinItems(FieldScope field)
Determine the "minItems" of an object's field/property.Integer
resolveArrayMinItems(MethodScope method)
Determine the "minItems" of a method's return value.Integer
resolveArrayMinItemsForType(TypeScope scope)
Determine the "minItems" of a context-independent type representation.Boolean
resolveArrayUniqueItems(FieldScope field)
Determine the "uniqueItems" of an object's field/property.Boolean
resolveArrayUniqueItems(MethodScope method)
Determine the "uniqueItems" of a method's return value.Boolean
resolveArrayUniqueItemsForType(TypeScope scope)
Determine the "uniqueItems" of a context-independent type representation.Object
resolveDefault(FieldScope field)
Determine the "default" value of an object's field/property.Object
resolveDefault(MethodScope method)
Determine the "default" value of a method's return value.Object
resolveDefaultForType(TypeScope scope)
Determine the "default" value of a context-independent type representation.List<String>
resolveDependentRequires(FieldScope field)
Determine the "dependentRequired" list of other properties' names, for which a value is required if the given field is present.List<String>
resolveDependentRequires(MethodScope method)
Determine the "dependentRequired" list of other properties' names, for which a value is required if the given method (or more likely: the field derived from this method) is present.String
resolveDescription(FieldScope field)
Determine the "description" of an object's field/property.String
resolveDescription(MethodScope method)
Determine the "description" of a method's return value.String
resolveDescriptionForType(TypeScope scope)
Determine the "description" of a context-independent type representation.Collection<?>
resolveEnum(FieldScope field)
Determine the "enum"/"const" of an object's field/property.Collection<?>
resolveEnum(MethodScope method)
Determine the "enum"/"const" of a method's return value.Collection<?>
resolveEnumForType(TypeScope scope)
Determine the "enum"/"const" of a context-independent type representation.String
resolveIdForType(TypeScope scope)
Determine the "$id" of a context-independent type representation.BigDecimal
resolveNumberExclusiveMaximum(FieldScope field)
Determine the "exclusiveMaximum" of an object's field/property.BigDecimal
resolveNumberExclusiveMaximum(MethodScope method)
Determine the "exclusiveMaximum" of a method's return value.BigDecimal
resolveNumberExclusiveMaximumForType(TypeScope scope)
Determine the "exclusiveMaximum" of a context-independent type representation.BigDecimal
resolveNumberExclusiveMinimum(FieldScope field)
Determine the "exclusiveMinimum" of an object's field/property.BigDecimal
resolveNumberExclusiveMinimum(MethodScope method)
Determine the "exclusiveMinimum" of a method's return value.BigDecimal
resolveNumberExclusiveMinimumForType(TypeScope scope)
Determine the "exclusiveMinimum" of a context-independent type representation.BigDecimal
resolveNumberInclusiveMaximum(FieldScope field)
Determine the "maximum" of an object's field/property.BigDecimal
resolveNumberInclusiveMaximum(MethodScope method)
Determine the "maximum" of a method's return value.BigDecimal
resolveNumberInclusiveMaximumForType(TypeScope scope)
Determine the "maximum" of a context-independent type representation.BigDecimal
resolveNumberInclusiveMinimum(FieldScope field)
Determine the "minimum" of an object's field/property.BigDecimal
resolveNumberInclusiveMinimum(MethodScope method)
Determine the "minimum" of a method's return value.BigDecimal
resolveNumberInclusiveMinimumForType(TypeScope scope)
Determine the "minimum" of a context-independent type representation.BigDecimal
resolveNumberMultipleOf(FieldScope field)
Determine the "multipleOf" of an object's field/property.BigDecimal
resolveNumberMultipleOf(MethodScope method)
Determine the "multipleOf" of a method's return value.BigDecimal
resolveNumberMultipleOfForType(TypeScope scope)
Determine the "multipleOf" of a context-independent type representation.Map<String,com.fasterxml.jackson.databind.JsonNode>
resolvePatternProperties(FieldScope field, SchemaGenerationContext context)
Determine the "patternProperties" of an object's field/property.Map<String,com.fasterxml.jackson.databind.JsonNode>
resolvePatternProperties(MethodScope method, SchemaGenerationContext context)
Determine the "patternProperties" of a method's return value.Map<String,com.fasterxml.jackson.databind.JsonNode>
resolvePatternPropertiesForType(TypeScope scope, SchemaGenerationContext context)
Determine the "patternProperties" of a context-independent type representation.String
resolvePropertyNameOverride(FieldScope field)
Determine the alternative name in a parent JSON Schema's "properties" from an object's field/property.String
resolvePropertyNameOverride(MethodScope method)
Determine the alternative name in a parent JSON Schema's "properties" from a method's return value.String
resolveStringFormat(FieldScope field)
Determine the "format" of an object's field/property.String
resolveStringFormat(MethodScope method)
Determine the "format" of a method's return value.String
resolveStringFormatForType(TypeScope scope)
Determine the "format" of a context-independent type representation.Integer
resolveStringMaxLength(FieldScope field)
Determine the "maxLength" of an object's field/property.Integer
resolveStringMaxLength(MethodScope method)
Determine the "maxLength" of a method's return value.Integer
resolveStringMaxLengthForType(TypeScope scope)
Determine the "maxLength" of a context-independent type representation.Integer
resolveStringMinLength(FieldScope field)
Determine the "minLength" of an object's field/property.Integer
resolveStringMinLength(MethodScope method)
Determine the "minLength" of a method's return value.Integer
resolveStringMinLengthForType(TypeScope scope)
Determine the "minLength" of a context-independent type representation.String
resolveStringPattern(FieldScope field)
Determine the "pattern" of an object's field/property.String
resolveStringPattern(MethodScope method)
Determine the "pattern" of a method's return value.String
resolveStringPatternForType(TypeScope scope)
Determine the "pattern" of a context-independent type representation.List<com.fasterxml.classmate.ResolvedType>
resolveSubtypes(com.fasterxml.classmate.ResolvedType javaType, SchemaGenerationContext context)
Look-up a declared type's subtypes in order to list those specifically (in anSchemaKeyword.TAG_ANYOF
).default com.fasterxml.classmate.ResolvedType
resolveTargetTypeOverride(FieldScope field)
Deprecated.useresolveTargetTypeOverrides(FieldScope)
insteaddefault com.fasterxml.classmate.ResolvedType
resolveTargetTypeOverride(MethodScope method)
Deprecated.useresolveTargetTypeOverrides(MethodScope)
insteadList<com.fasterxml.classmate.ResolvedType>
resolveTargetTypeOverrides(FieldScope field)
Determine the alternative target types from an object's field/property.List<com.fasterxml.classmate.ResolvedType>
resolveTargetTypeOverrides(MethodScope method)
Determine the alternative target types from a method's return value.String
resolveTitle(FieldScope field)
Determine the "title" of an object's field/property.String
resolveTitle(MethodScope method)
Determine the "title" of a method's return value.String
resolveTitleForType(TypeScope scope)
Determine the "title" of a context-independent type representation.boolean
shouldAllowNullableArrayItems()
Determine whether "fake" container/array items should be subject to the same nullable checks as the actual declared member type.boolean
shouldCleanupUnnecessaryAllOfElements()
Determine whether unnecessarySchemaKeyword.TAG_ALLOF
elements should be removed and merged into their declaring schema when there are no conflicts between the sub-schemas.boolean
shouldCreateDefinitionForMainSchema()
Determine whether the schema for the target/main type should be included alongside any "definitions"/"$defs" and be referenced via"$ref": "#"
if necessary.boolean
shouldCreateDefinitionsForAllObjects()
Determine whether all referenced objects should be listed in the schema's "definitions"/"$defs", even if they only occur once.boolean
shouldDeriveFieldsFromArgumentFreeMethods()
Determine whether non-void argument-free "getXyZ"/"isXyZ" methods should be represented by the respective field name "xyZ" by default.boolean
shouldIgnore(FieldScope field)
Check whether a field/property should be ignored.boolean
shouldIgnore(MethodScope method)
Check whether a method should be ignored.boolean
shouldIncludeExtraOpenApiFormatValues()
Determine whether extraSchemaKeyword.TAG_FORMAT
values should be included for "simple types".boolean
shouldIncludeSchemaVersionIndicator()
Determine whether theSchemaKeyword.TAG_SCHEMA
attribute withSchemaKeyword.TAG_SCHEMA_VALUE
should be added.boolean
shouldIncludeStaticFields()
Determine whether static fields should be included in the generated schema.boolean
shouldIncludeStaticMethods()
Determine whether static methods should be included in the generated schema.boolean
shouldIncludeStrictTypeInfo()
Determine whether sub schemas should get theSchemaKeyword.TAG_TYPE
added implicitly based on other contained tags, if it is missing.boolean
shouldInlineAllSchemas()
Determine whether all sub-schemas should be included in-line, even if they occur multiple times, and not in the schema's "definitions"/"$defs".boolean
shouldRepresentSingleAllowedValueAsConst()
Determine whether a single allowed values should be represented by aSchemaKeyword.TAG_CONST
.boolean
shouldTransparentlyResolveSubtypesOfMembers()
Determine whether a member (field/method), having a declared type for which subtypes are being detected, should be merely a collection of its subtype schemas – each being treated like the member had declared the subtype directly – or whether it should be included as standalone definition with any collected member attributes assigned directly and the subtypes only being handled as generic types.boolean
shouldUsePlainDefinitionKeys()
Determine whether theSchemaKeyword.TAG_REF
values should not just be URI compatible (as expected in JSON Schemas).int
sortProperties(MemberScope<?,?> first, MemberScope<?,?> second)
Implementation of theComparator.compare(Object, Object)
interface method to determine the order of fields and methods in an object's"properties"
.-
Methods inherited from interface com.github.victools.jsonschema.generator.StatefulConfig
resetAfterSchemaGenerationFinished
-
-
-
-
Method Detail
-
getSchemaVersion
SchemaVersion getSchemaVersion()
Getter for the designated JSON Schema version.- Returns:
- target version of the JSON Schema to generate
-
getKeyword
String getKeyword(SchemaKeyword keyword)
Getter for the indicated keyword's value in the designated JSON Schema version.- Parameters:
keyword
- reference to a tag name or value- Returns:
- referenced tag name/value in the designated schema version
- See Also:
getSchemaVersion()
,SchemaKeyword.forVersion(SchemaVersion)
-
shouldCreateDefinitionsForAllObjects
boolean shouldCreateDefinitionsForAllObjects()
Determine whether all referenced objects should be listed in the schema's "definitions"/"$defs", even if they only occur once.- Returns:
- whether to add a definition even for objects occurring only once
-
shouldCreateDefinitionForMainSchema
boolean shouldCreateDefinitionForMainSchema()
Determine whether the schema for the target/main type should be included alongside any "definitions"/"$defs" and be referenced via"$ref": "#"
if necessary. Otherwise, it may be moved into the "definitions"/"$defs" like any other subschema.- Returns:
- whether to allow "$ref"-erences to the empty fragment "#"
-
shouldTransparentlyResolveSubtypesOfMembers
boolean shouldTransparentlyResolveSubtypesOfMembers()
Determine whether a member (field/method), having a declared type for which subtypes are being detected, should be merely a collection of its subtype schemas – each being treated like the member had declared the subtype directly – or whether it should be included as standalone definition with any collected member attributes assigned directly and the subtypes only being handled as generic types.- Returns:
- whether to produce sub-schema for each subtype of a member's declared type, like the member had declared that subtype instead
- Since:
- 4.27.0
-
shouldInlineAllSchemas
boolean shouldInlineAllSchemas()
Determine whether all sub-schemas should be included in-line, even if they occur multiple times, and not in the schema's "definitions"/"$defs".- Returns:
- whether to include all sub-schemas in-line
-
shouldIncludeSchemaVersionIndicator
boolean shouldIncludeSchemaVersionIndicator()
Determine whether theSchemaKeyword.TAG_SCHEMA
attribute withSchemaKeyword.TAG_SCHEMA_VALUE
should be added.- Returns:
- whether to add the schema version attribute
-
shouldUsePlainDefinitionKeys
boolean shouldUsePlainDefinitionKeys()
Determine whether theSchemaKeyword.TAG_REF
values should not just be URI compatible (as expected in JSON Schemas). It should further respect the reduced set of characters as per the following regular expression (as expected by OpenAPI):^[a-zA-Z0-9\.\-_]+$
- Returns:
- whether to use only alphanumeric characters, dots, dashes and underscores in
SchemaKeyword.TAG_REF
values
-
shouldIncludeExtraOpenApiFormatValues
boolean shouldIncludeExtraOpenApiFormatValues()
Determine whether extraSchemaKeyword.TAG_FORMAT
values should be included for "simple types".- Returns:
- whether to include extra
SchemaKeyword.TAG_FORMAT
values
-
shouldCleanupUnnecessaryAllOfElements
boolean shouldCleanupUnnecessaryAllOfElements()
Determine whether unnecessarySchemaKeyword.TAG_ALLOF
elements should be removed and merged into their declaring schema when there are no conflicts between the sub-schemas.- Returns:
- whether to clean-up
SchemaKeyword.TAG_ALLOF
elements as the last step during schema generation
-
shouldIncludeStrictTypeInfo
boolean shouldIncludeStrictTypeInfo()
Determine whether sub schemas should get theSchemaKeyword.TAG_TYPE
added implicitly based on other contained tags, if it is missing.- Returns:
- whether to try and imply the
SchemaKeyword.TAG_TYPE
from other contained tags in the schema
-
shouldIncludeStaticFields
boolean shouldIncludeStaticFields()
Determine whether static fields should be included in the generated schema.- Returns:
- whether to include static fields
-
shouldIncludeStaticMethods
boolean shouldIncludeStaticMethods()
Determine whether static methods should be included in the generated schema.- Returns:
- whether to included static methods
-
shouldDeriveFieldsFromArgumentFreeMethods
boolean shouldDeriveFieldsFromArgumentFreeMethods()
Determine whether non-void argument-free "getXyZ"/"isXyZ" methods should be represented by the respective field name "xyZ" by default.- Returns:
- whether to treat argument-free methods as fields in schema
-
shouldRepresentSingleAllowedValueAsConst
boolean shouldRepresentSingleAllowedValueAsConst()
Determine whether a single allowed values should be represented by aSchemaKeyword.TAG_CONST
. Otherwise aSchemaKeyword.TAG_ENUM
will be used even for a single allowed value.- Returns:
- whether to automatically make use of the
"const"
keyword
-
shouldAllowNullableArrayItems
boolean shouldAllowNullableArrayItems()
Determine whether "fake" container/array items should be subject to the same nullable checks as the actual declared member type.- Returns:
- whether to perform nullable checks for "fake" container/array item typees
- Since:
- 4.20.0
-
getObjectMapper
com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
Getter for the underlying object mapper.- Returns:
- object mapper being used for generating JSON Schema structure
-
createObjectNode
com.fasterxml.jackson.databind.node.ObjectNode createObjectNode()
Generate an empty JSON node representing an object (which will subsequently be filled by the generator).
This is equivalent to callinggetObjectMapper().createObjectNode()
- Returns:
- JSON object node
-
createArrayNode
com.fasterxml.jackson.databind.node.ArrayNode createArrayNode()
Generate an empty JSON node representing an array (which will subsequently be filled by the generator).
This is equivalent to callinggetObjectMapper().createArrayNode()
- Returns:
- JSON array node
-
getAnnotationInclusionOverrides
Map<Class<? extends Annotation>,com.fasterxml.classmate.AnnotationInclusion> getAnnotationInclusionOverrides()
Provide the explicit rule overrides of when to include particular annotations (e.g., with or without@Inherited
).- Returns:
- annotation inclusion rules for specific annotation types
- Since:
- 4.31.0
-
sortProperties
int sortProperties(MemberScope<?,?> first, MemberScope<?,?> second)
Implementation of theComparator.compare(Object, Object)
interface method to determine the order of fields and methods in an object's"properties"
.- Parameters:
first
- first field/method to compare tosecond
second
- second field/method to compare tofirst
- Returns:
- a negative/positive integer as the first field/method should be positioned before/after the second respectively
-
getDefinitionNamingStrategy
SchemaDefinitionNamingStrategy getDefinitionNamingStrategy()
Getter for the naming strategy to be applied when determining key names in the "definitions"/"$defs".- Returns:
- definition key naming strategy
-
getCustomDefinition
<M extends MemberScope<?,?>> CustomDefinition getCustomDefinition(M scope, SchemaGenerationContext context, CustomPropertyDefinitionProvider<M> ignoredDefinitionProvider)
Look-up the non-standard JSON schema definition for a given property. Falling-back on the per-type custom definitions.- Type Parameters:
M
- type of targeted property- Parameters:
scope
- targeted scope for which to provide a custom definitioncontext
- generation context allowing to let the standard generation take over nested parts of the custom definitionignoredDefinitionProvider
- custom definition provider to ignore- Returns:
- non-standard JSON schema definition for the given field/method (may be null)
- See Also:
getCustomDefinition(ResolvedType, SchemaGenerationContext, CustomDefinitionProviderV2)
-
getCustomDefinition
CustomDefinition getCustomDefinition(com.fasterxml.classmate.ResolvedType javaType, SchemaGenerationContext context, CustomDefinitionProviderV2 ignoredDefinitionProvider)
Look-up the non-standard JSON schema definition for a given type. If this returns null, the standard behaviour is expected to be applied.- Parameters:
javaType
- generic type to provide custom definition forcontext
- generation context allowing to let the standard generation take over nested parts of the custom definitionignoredDefinitionProvider
- custom definition provider to ignore- Returns:
- non-standard JSON schema definition (may be null)
-
resolveSubtypes
List<com.fasterxml.classmate.ResolvedType> resolveSubtypes(com.fasterxml.classmate.ResolvedType javaType, SchemaGenerationContext context)
Look-up a declared type's subtypes in order to list those specifically (in anSchemaKeyword.TAG_ANYOF
).- Parameters:
javaType
- declared type to look-up subtypes forcontext
- generation context (including a reference to theTypeContext
for deriving aResolvedType
from aClass
)- Returns:
- subtypes to list as possible alternatives for the declared type (may be empty)
-
getTypeAttributeOverrides
List<TypeAttributeOverrideV2> getTypeAttributeOverrides()
Getter for the applicable type attribute overrides.- Returns:
- overrides of a given JSON Schema node's type attributes
-
getFieldAttributeOverrides
List<InstanceAttributeOverrideV2<FieldScope>> getFieldAttributeOverrides()
Getter for the applicable instance attribute overrides for fields.- Returns:
- overrides of a given JSON Schema node's instance attributes
-
getMethodAttributeOverrides
List<InstanceAttributeOverrideV2<MethodScope>> getMethodAttributeOverrides()
Getter for the applicable instance attribute overrides for methods.- Returns:
- overrides of a given JSON Schema node's instance attributes
-
isNullable
boolean isNullable(FieldScope field)
Check whether a field/property is nullable.- Parameters:
field
- object's field/property to check- Returns:
- whether the field/property is nullable
-
isNullable
boolean isNullable(MethodScope method)
Check whether a method's return value is nullable.- Parameters:
method
- method to check- Returns:
- whether the method's return value is nullable
-
isRequired
boolean isRequired(FieldScope field)
Check whether a field/property value is required.- Parameters:
field
- object's field/property to check- Returns:
- whether the field/property value should be required
-
isRequired
boolean isRequired(MethodScope method)
Check whether a method value is required.- Parameters:
method
- method to check- Returns:
- whether the method value should be required
-
isReadOnly
boolean isReadOnly(FieldScope field)
Check whether a field/property value is deemed read-only, i.e., may be ignored or rejected when included in a request.- Parameters:
field
- object's field/property to check- Returns:
- whether the field/property value should be read-only
-
isReadOnly
boolean isReadOnly(MethodScope method)
Check whether a method value is deemed read-only, i.e., may be ignored or rejected when included in a request.- Parameters:
method
- method to check- Returns:
- whether the method value should be read-only
-
isWriteOnly
boolean isWriteOnly(FieldScope field)
Check whether a field/property value is deemed write-only, i.e., is not being returned in responses.- Parameters:
field
- object's field/property to check- Returns:
- whether the field/property value should be write-only
-
isWriteOnly
boolean isWriteOnly(MethodScope method)
Check whether a method value is deemed write-only, i.e., is not being returned in responses.- Parameters:
method
- method to check- Returns:
- whether the method value should be write-only
-
shouldIgnore
boolean shouldIgnore(FieldScope field)
Check whether a field/property should be ignored.- Parameters:
field
- object's field/property to check- Returns:
- whether the field/property should be ignored
-
shouldIgnore
boolean shouldIgnore(MethodScope method)
Check whether a method should be ignored.- Parameters:
method
- method to check- Returns:
- whether the method should be ignored
-
resolveTargetTypeOverride
@Deprecated default com.fasterxml.classmate.ResolvedType resolveTargetTypeOverride(FieldScope field)
Deprecated.useresolveTargetTypeOverrides(FieldScope)
insteadDetermine the alternative target type from an object's field/property.- Parameters:
field
- object's field/property to determine the target type for- Returns:
- target type (may be null)
-
resolveTargetTypeOverride
@Deprecated default com.fasterxml.classmate.ResolvedType resolveTargetTypeOverride(MethodScope method)
Deprecated.useresolveTargetTypeOverrides(MethodScope)
insteadDetermine the alternative target type from a method's return value.- Parameters:
method
- method for whose return value to determine the target type for- Returns:
- target type (may be null)
-
resolveTargetTypeOverrides
List<com.fasterxml.classmate.ResolvedType> resolveTargetTypeOverrides(FieldScope field)
Determine the alternative target types from an object's field/property.- Parameters:
field
- object's field/property to determine the target type for- Returns:
- target types (may be null or empty)
-
resolveTargetTypeOverrides
List<com.fasterxml.classmate.ResolvedType> resolveTargetTypeOverrides(MethodScope method)
Determine the alternative target types from a method's return value.- Parameters:
method
- method for whose return value to determine the target type for- Returns:
- target types (may be null or empty)
-
resolvePropertyNameOverride
String resolvePropertyNameOverride(FieldScope field)
Determine the alternative name in a parent JSON Schema's "properties" from an object's field/property.- Parameters:
field
- object's field/property to determine name in parent JSON Schema's properties for- Returns:
- name in a parent JSON Schema's "properties" (may be null, thereby falling back on the default value)
-
resolvePropertyNameOverride
String resolvePropertyNameOverride(MethodScope method)
Determine the alternative name in a parent JSON Schema's "properties" from a method's return value.- Parameters:
method
- method for whose return value to determine name in parent JSON Schema's properties for- Returns:
- name in a parent JSON Schema's "properties" (may be null, thereby falling back on the default value)
-
resolveIdForType
String resolveIdForType(TypeScope scope)
Determine the "$id" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "$id" value for- Returns:
- "$id" in a JSON Schema (may be null)
-
resolveAnchorForType
String resolveAnchorForType(TypeScope scope)
Determine the "$anchor" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "$anchor" value for- Returns:
- "$anchor" in a JSON Schema (may be null)
-
resolveTitle
String resolveTitle(FieldScope field)
Determine the "title" of an object's field/property.- Parameters:
field
- object's field/property to determine "title" value for- Returns:
- "title" in a JSON Schema (may be null)
-
resolveTitle
String resolveTitle(MethodScope method)
Determine the "title" of a method's return value.- Parameters:
method
- method for whose return value to determine "title" value for- Returns:
- "title" in a JSON Schema (may be null)
-
resolveTitleForType
String resolveTitleForType(TypeScope scope)
Determine the "title" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "title" value for- Returns:
- "title" in a JSON Schema (may be null)
-
resolveDescription
String resolveDescription(FieldScope field)
Determine the "description" of an object's field/property.- Parameters:
field
- object's field/property to determine "description" value for- Returns:
- "description" in a JSON Schema (may be null)
-
resolveDescription
String resolveDescription(MethodScope method)
Determine the "description" of a method's return value.- Parameters:
method
- method for whose return value to determine "description" value for- Returns:
- "description" in a JSON Schema (may be null)
-
resolveDescriptionForType
String resolveDescriptionForType(TypeScope scope)
Determine the "description" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "description" value for- Returns:
- "description" in a JSON Schema (may be null)
-
resolveDefault
Object resolveDefault(FieldScope field)
Determine the "default" value of an object's field/property.- Parameters:
field
- object's field/property to determine "default" value for- Returns:
- "default" in a JSON Schema (may be null)
-
resolveDefault
Object resolveDefault(MethodScope method)
Determine the "default" value of a method's return value.- Parameters:
method
- method for whose return value to determine "default" value for- Returns:
- "default" in a JSON Schema (may be null)
-
resolveDefaultForType
Object resolveDefaultForType(TypeScope scope)
Determine the "default" value of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "default" value for- Returns:
- "default" in a JSON Schema (may be null)
-
resolveDependentRequires
List<String> resolveDependentRequires(FieldScope field)
Determine the "dependentRequired" list of other properties' names, for which a value is required if the given field is present.- Parameters:
field
- object's field/property to collect dependent property names for- Returns:
- "dependentRequired" list in a JSON Schema associated with the targeted field (may be empty)
-
resolveDependentRequires
List<String> resolveDependentRequires(MethodScope method)
Determine the "dependentRequired" list of other properties' names, for which a value is required if the given method (or more likely: the field derived from this method) is present.- Parameters:
method
- method to collect dependent property names for- Returns:
- "dependentRequired" list in a JSON Schema associated with the targeted method (may be empty)
-
resolveEnum
Collection<?> resolveEnum(FieldScope field)
Determine the "enum"/"const" of an object's field/property.- Parameters:
field
- object's field/property to determine "enum"/"const" value for- Returns:
- "enum"/"const" in a JSON Schema (may be null)
-
resolveEnum
Collection<?> resolveEnum(MethodScope method)
Determine the "enum"/"const" of a method's return value.- Parameters:
method
- method for whose return value to determine "enum"/"const" value for- Returns:
- "enum"/"const" in a JSON Schema (may be null)
-
resolveEnumForType
Collection<?> resolveEnumForType(TypeScope scope)
Determine the "enum"/"const" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "enum"/"const" value for- Returns:
- "enum"/"const" in a JSON Schema (may be null)
-
resolveAdditionalProperties
com.fasterxml.jackson.databind.JsonNode resolveAdditionalProperties(FieldScope field, SchemaGenerationContext context)
Determine the "additionalProperties" of an object's field/property.- Parameters:
field
- object's field/property to determine "additionalProperties" value forcontext
- generation context allowing to let the standard generation take over nested parts of the custom definition- Returns:
- "additionalProperties" in a JSON Schema (may be
Void
) to indicate no additional properties being allowed or may be null)
-
resolveAdditionalProperties
com.fasterxml.jackson.databind.JsonNode resolveAdditionalProperties(MethodScope method, SchemaGenerationContext context)
Determine the "additionalProperties" of a method's return value.- Parameters:
method
- method for whose return value to determine "additionalProperties" value forcontext
- generation context allowing to let the standard generation take over nested parts of the custom definition- Returns:
- "additionalProperties" in a JSON Schema (may be
Void
) to indicate no additional properties being allowed or may be null)
-
resolveAdditionalPropertiesForType
com.fasterxml.jackson.databind.JsonNode resolveAdditionalPropertiesForType(TypeScope scope, SchemaGenerationContext context)
Determine the "additionalProperties" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "additionalProperties" value forcontext
- generation context allowing to let the standard generation take over nested parts of the custom definition- Returns:
- "additionalProperties" in a JSON Schema (may be null)
-
resolvePatternProperties
Map<String,com.fasterxml.jackson.databind.JsonNode> resolvePatternProperties(FieldScope field, SchemaGenerationContext context)
Determine the "patternProperties" of an object's field/property.- Parameters:
field
- object's field/property to determine "patternProperties" value forcontext
- generation context allowing to let the standard generation take over nested parts of the custom definition- Returns:
- "patternProperties" in a JSON Schema (may be null), the keys representing the patterns and the mapped values their corresponding types
-
resolvePatternProperties
Map<String,com.fasterxml.jackson.databind.JsonNode> resolvePatternProperties(MethodScope method, SchemaGenerationContext context)
Determine the "patternProperties" of a method's return value.- Parameters:
method
- method for whose return value to determine "patternProperties" value forcontext
- generation context allowing to let the standard generation take over nested parts of the custom definition- Returns:
- "patternProperties" in a JSON Schema (may be null), the keys representing the patterns and the mapped values their corresponding types
-
resolvePatternPropertiesForType
Map<String,com.fasterxml.jackson.databind.JsonNode> resolvePatternPropertiesForType(TypeScope scope, SchemaGenerationContext context)
Determine the "patternProperties" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "patternProperties" value forcontext
- generation context allowing to let the standard generation take over nested parts of the custom definition- Returns:
- "patternProperties" in a JSON Schema (may be null), the keys representing the patterns and the mapped values their corresponding types
-
resolveStringMinLength
Integer resolveStringMinLength(FieldScope field)
Determine the "minLength" of an object's field/property.- Parameters:
field
- object's field/property to determine "minLength" value for- Returns:
- "minLength" in a JSON Schema (may be null)
-
resolveStringMinLength
Integer resolveStringMinLength(MethodScope method)
Determine the "minLength" of a method's return value.- Parameters:
method
- method for whose return value to determine "minLength" value for- Returns:
- "minLength" in a JSON Schema (may be null)
-
resolveStringMinLengthForType
Integer resolveStringMinLengthForType(TypeScope scope)
Determine the "minLength" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "minLength" value for- Returns:
- "minLength" in a JSON Schema (may be null)
-
resolveStringMaxLength
Integer resolveStringMaxLength(FieldScope field)
Determine the "maxLength" of an object's field/property.- Parameters:
field
- object's field/property to determine "maxLength" value for- Returns:
- "maxLength" in a JSON Schema (may be null)
-
resolveStringMaxLength
Integer resolveStringMaxLength(MethodScope method)
Determine the "maxLength" of a method's return value.- Parameters:
method
- method for whose return value to determine "maxLength" value for- Returns:
- "maxLength" in a JSON Schema (may be null)
-
resolveStringMaxLengthForType
Integer resolveStringMaxLengthForType(TypeScope scope)
Determine the "maxLength" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "maxLength" value for- Returns:
- "maxLength" in a JSON Schema (may be null)
-
resolveStringFormat
String resolveStringFormat(FieldScope field)
Determine the "format" of an object's field/property.- Parameters:
field
- object's field/property to determine "format" value for- Returns:
- "format" in a JSON Schema (may be null)
-
resolveStringFormat
String resolveStringFormat(MethodScope method)
Determine the "format" of a method's return value.- Parameters:
method
- method for whose return value to determine "format" value for- Returns:
- "format" in a JSON Schema (may be null)
-
resolveStringFormatForType
String resolveStringFormatForType(TypeScope scope)
Determine the "format" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "format" value for- Returns:
- "format" in a JSON Schema (may be null)
-
resolveStringPattern
String resolveStringPattern(FieldScope field)
Determine the "pattern" of an object's field/property.- Parameters:
field
- object's field/property to determine "pattern" value for- Returns:
- "pattern" in a JSON Schema (may be null)
-
resolveStringPattern
String resolveStringPattern(MethodScope method)
Determine the "pattern" of a method's return value.- Parameters:
method
- method for whose return value to determine "pattern" value for- Returns:
- "pattern" in a JSON Schema (may be null)
-
resolveStringPatternForType
String resolveStringPatternForType(TypeScope scope)
Determine the "pattern" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "pattern" value for- Returns:
- "pattern" in a JSON Schema (may be null)
-
resolveNumberInclusiveMinimum
BigDecimal resolveNumberInclusiveMinimum(FieldScope field)
Determine the "minimum" of an object's field/property.- Parameters:
field
- object's field/property to determine "minimum" value for- Returns:
- "minimum" in a JSON Schema (may be null)
-
resolveNumberInclusiveMinimum
BigDecimal resolveNumberInclusiveMinimum(MethodScope method)
Determine the "minimum" of a method's return value.- Parameters:
method
- method for whose return value to determine "minimum" value for- Returns:
- "minimum" in a JSON Schema (may be null)
-
resolveNumberInclusiveMinimumForType
BigDecimal resolveNumberInclusiveMinimumForType(TypeScope scope)
Determine the "minimum" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "minimum" value for- Returns:
- "minimum" in a JSON Schema (may be null)
-
resolveNumberExclusiveMinimum
BigDecimal resolveNumberExclusiveMinimum(FieldScope field)
Determine the "exclusiveMinimum" of an object's field/property.- Parameters:
field
- object's field/property to determine "exclusiveMinimum" value for- Returns:
- "exclusiveMinimum" in a JSON Schema (may be null)
-
resolveNumberExclusiveMinimum
BigDecimal resolveNumberExclusiveMinimum(MethodScope method)
Determine the "exclusiveMinimum" of a method's return value.- Parameters:
method
- method for whose return value to determine "exclusiveMinimum" value for- Returns:
- "exclusiveMinimum" in a JSON Schema (may be null)
-
resolveNumberExclusiveMinimumForType
BigDecimal resolveNumberExclusiveMinimumForType(TypeScope scope)
Determine the "exclusiveMinimum" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "exclusiveMinimum" value for- Returns:
- "exclusiveMinimum" in a JSON Schema (may be null)
-
resolveNumberInclusiveMaximum
BigDecimal resolveNumberInclusiveMaximum(FieldScope field)
Determine the "maximum" of an object's field/property.- Parameters:
field
- object's field/property to determine "maximum" value for- Returns:
- "maximum" in a JSON Schema (may be null)
-
resolveNumberInclusiveMaximum
BigDecimal resolveNumberInclusiveMaximum(MethodScope method)
Determine the "maximum" of a method's return value.- Parameters:
method
- method for whose return value to determine "maximum" value for- Returns:
- "maximum" in a JSON Schema (may be null)
-
resolveNumberInclusiveMaximumForType
BigDecimal resolveNumberInclusiveMaximumForType(TypeScope scope)
Determine the "maximum" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "maximum" value for- Returns:
- "maximum" in a JSON Schema (may be null)
-
resolveNumberExclusiveMaximum
BigDecimal resolveNumberExclusiveMaximum(FieldScope field)
Determine the "exclusiveMaximum" of an object's field/property.- Parameters:
field
- object's field/property to determine "exclusiveMaximum" value for- Returns:
- "exclusiveMaximum" in a JSON Schema (may be null)
-
resolveNumberExclusiveMaximum
BigDecimal resolveNumberExclusiveMaximum(MethodScope method)
Determine the "exclusiveMaximum" of a method's return value.- Parameters:
method
- method for whose return value to determine "exclusiveMaximum" value for- Returns:
- "exclusiveMaximum" in a JSON Schema (may be null)
-
resolveNumberExclusiveMaximumForType
BigDecimal resolveNumberExclusiveMaximumForType(TypeScope scope)
Determine the "exclusiveMaximum" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "exclusiveMaximum" value for- Returns:
- "exclusiveMaximum" in a JSON Schema (may be null)
-
resolveNumberMultipleOf
BigDecimal resolveNumberMultipleOf(FieldScope field)
Determine the "multipleOf" of an object's field/property.- Parameters:
field
- object's field/property to determine "multipleOf" value for- Returns:
- "multipleOf" in a JSON Schema (may be null)
-
resolveNumberMultipleOf
BigDecimal resolveNumberMultipleOf(MethodScope method)
Determine the "multipleOf" of a method's return value.- Parameters:
method
- method for whose return value to determine "multipleOf" value for- Returns:
- "multipleOf" in a JSON Schema (may be null)
-
resolveNumberMultipleOfForType
BigDecimal resolveNumberMultipleOfForType(TypeScope scope)
Determine the "multipleOf" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "multipleOf" value for- Returns:
- "multipleOf" in a JSON Schema (may be null)
-
resolveArrayMinItems
Integer resolveArrayMinItems(FieldScope field)
Determine the "minItems" of an object's field/property.- Parameters:
field
- object's field/property to determine "minItems" value for- Returns:
- "minItems" in a JSON Schema (may be null)
-
resolveArrayMinItems
Integer resolveArrayMinItems(MethodScope method)
Determine the "minItems" of a method's return value.- Parameters:
method
- method for whose return value to determine "minItems" value for- Returns:
- "minItems" in a JSON Schema (may be null)
-
resolveArrayMinItemsForType
Integer resolveArrayMinItemsForType(TypeScope scope)
Determine the "minItems" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "minItems" value for- Returns:
- "minItems" in a JSON Schema (may be null)
-
resolveArrayMaxItems
Integer resolveArrayMaxItems(FieldScope field)
Determine the "maxItems" of an object's field/property.- Parameters:
field
- object's field/property to determine "maxItems" value for- Returns:
- "maxItems" in a JSON Schema (may be null)
-
resolveArrayMaxItems
Integer resolveArrayMaxItems(MethodScope method)
Determine the "maxItems" of a method's return value.- Parameters:
method
- method for whose return value to determine "maxItems" value for- Returns:
- "maxItems" in a JSON Schema (may be null)
-
resolveArrayMaxItemsForType
Integer resolveArrayMaxItemsForType(TypeScope scope)
Determine the "maxItems" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "maxItems" value for- Returns:
- "maxItems" in a JSON Schema (may be null)
-
resolveArrayUniqueItems
Boolean resolveArrayUniqueItems(FieldScope field)
Determine the "uniqueItems" of an object's field/property.- Parameters:
field
- object's field/property to determine "uniqueItems" value for- Returns:
- "uniqueItems" in a JSON Schema (may be null)
-
resolveArrayUniqueItems
Boolean resolveArrayUniqueItems(MethodScope method)
Determine the "uniqueItems" of a method's return value.- Parameters:
method
- method for whose return value to determine "uniqueItems" value for- Returns:
- "uniqueItems" in a JSON Schema (may be null)
-
resolveArrayUniqueItemsForType
Boolean resolveArrayUniqueItemsForType(TypeScope scope)
Determine the "uniqueItems" of a context-independent type representation.- Parameters:
scope
- context-independent type representation to determine "uniqueItems" value for- Returns:
- "uniqueItems" in a JSON Schema (may be null)
-
-