Interface IDefineableJsonSchema
- All Known Subinterfaces:
IDataTypeJsonSchema,IDefinitionJsonSchema<D>,IModelDefinitionJsonSchema<D>
public interface IDefineableJsonSchema
Represents a JSON schema that is a global definition or an inline schema.
A schema of this type will be a global definition if
isInline(IJsonGenerationState) is false.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidgenerateDefinition(IJsonGenerationState state, com.fasterxml.jackson.databind.node.ObjectNode definitionsObject) voidgenerateInlineSchema(com.fasterxml.jackson.databind.node.ObjectNode obj, IJsonGenerationState state) Generate the schema within the provided JSON object node.default voidgenerateRef(com.fasterxml.jackson.databind.node.ObjectNode obj, IJsonGenerationState state) Generate a reference to a globally defined schema, within the provided JSON object node.default voidgenerateSchemaOrRef(com.fasterxml.jackson.databind.node.ObjectNode obj, IJsonGenerationState state) Get the definition's name.default StringGet the definition's reference URI.booleanisInline(IJsonGenerationState state) Determine if the schema is defined inline or as a global definition.
-
Method Details
-
isInline
Determine if the schema is defined inline or as a global definition.- Parameters:
state- the schema generation state used for context- Returns:
trueif the schema is to be defined inline orfalseif the schema is to be defined globally
-
generateSchemaOrRef
default void generateSchemaOrRef(@NonNull com.fasterxml.jackson.databind.node.ObjectNode obj, @NonNull IJsonGenerationState state) -
generateInlineSchema
void generateInlineSchema(@NonNull com.fasterxml.jackson.databind.node.ObjectNode obj, @NonNull IJsonGenerationState state) Generate the schema within the provided JSON object node.- Parameters:
obj- the JSON object to populatestate- the schema generation state used for context and writing- Throws:
SchemaGenerationException- if an error occurred while writing the type
-
getDefinitionName
Get the definition's name.- Parameters:
state- the schema generation state used for context and writing- Returns:
- the definition name
- Throws:
IllegalStateException- if the JSON schema object is not a definition
-
getDefinitionRef
Get the definition's reference URI.- Parameters:
state- the schema generation state used for context and writing- Returns:
- the definition's reference URI
- Throws:
IllegalStateException- if the JSON schema object is not a definition
-
generateRef
default void generateRef(@NonNull com.fasterxml.jackson.databind.node.ObjectNode obj, @NonNull IJsonGenerationState state) Generate a reference to a globally defined schema, within the provided JSON object node.- Parameters:
obj- the JSON object to populatestate- the schema generation state used for context and writing- Throws:
SchemaGenerationException- if an error occurred while writing the type
-
generateDefinition
default void generateDefinition(@NonNull IJsonGenerationState state, @NonNull com.fasterxml.jackson.databind.node.ObjectNode definitionsObject)
-