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
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
generateDefinition
(IJsonGenerationState state, com.fasterxml.jackson.databind.node.ObjectNode definitionsObject) void
generateInlineSchema
(com.fasterxml.jackson.databind.node.ObjectNode obj, IJsonGenerationState state) Generate the schema within the provided JSON object node.default void
generateRef
(com.fasterxml.jackson.databind.node.ObjectNode obj, IJsonGenerationState state) Generate a reference to a globally defined schema, within the provided JSON object node.default void
generateSchemaOrRef
(com.fasterxml.jackson.databind.node.ObjectNode obj, IJsonGenerationState state) Get the definition's name.default String
Get the definition's reference URI.boolean
isInline
(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:
true
if the schema is to be defined inline orfalse
if 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)
-