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.

  • Method Details

    • isInline

      boolean isInline(@NonNull IJsonGenerationState state)
      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 or false 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 populate
      state - the schema generation state used for context and writing
      Throws:
      SchemaGenerationException - if an error occurred while writing the type
    • getDefinitionName

      @NonNull String getDefinitionName(@NonNull IJsonGenerationState state)
      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

      default String getDefinitionRef(@NonNull IJsonGenerationState state)
      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 populate
      state - 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)