Interface SchemaGenerationContext

  • All Known Implementing Classes:
    SchemaGenerationContextImpl

    public interface SchemaGenerationContext
    Generation context for sub-schema definitions.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      com.fasterxml.jackson.databind.node.ObjectNode createDefinition​(com.fasterxml.classmate.ResolvedType targetType)
      Create an inline definition for the given targetType.
      com.fasterxml.jackson.databind.node.ObjectNode createDefinitionReference​(com.fasterxml.classmate.ResolvedType targetType)
      Create a definition for the given targetType.
      com.fasterxml.jackson.databind.node.ObjectNode createStandardDefinition​(com.fasterxml.classmate.ResolvedType targetType, CustomDefinitionProviderV2 ignoredDefinitionProvider)
      Create an inline definition for the given targetType.
      com.fasterxml.jackson.databind.node.ObjectNode createStandardDefinitionReference​(com.fasterxml.classmate.ResolvedType targetType, CustomDefinitionProviderV2 ignoredDefinitionProvider)
      Create a standard definition for the given targetType.
      SchemaGeneratorConfig getGeneratorConfig()
      Getter for the applicable configuration.
      String getKeyword​(SchemaKeyword keyword)
      Look-up a given keyword's associated tag name or value for the designated JSON Schema version.
      TypeContext getTypeContext()
      Getter for the type resolution/introspection context in use.
      com.fasterxml.jackson.databind.node.ObjectNode makeNullable​(com.fasterxml.jackson.databind.node.ObjectNode node)
      Ensure that the JSON schema represented by the given node allows for it to be of "type" "null".
    • Method Detail

      • getGeneratorConfig

        SchemaGeneratorConfig getGeneratorConfig()
        Getter for the applicable configuration.
        Returns:
        configuration defined for this context
      • getKeyword

        String getKeyword​(SchemaKeyword keyword)
        Look-up a given keyword's associated tag name or value for the designated JSON Schema version.
        Parameters:
        keyword - reference to a tag name or value
        Returns:
        specific tag name or value in the designated JSON Schema version
        See Also:
        SchemaGeneratorConfig.getKeyword(SchemaKeyword)
      • getTypeContext

        TypeContext getTypeContext()
        Getter for the type resolution/introspection context in use.
        Returns:
        type resolution/introspection context
      • createDefinition

        com.fasterxml.jackson.databind.node.ObjectNode createDefinition​(com.fasterxml.classmate.ResolvedType targetType)
        Create an inline definition for the given targetType. Also respecting any custom definition for the given targetType.
        This is equivalent to calling createStandardDefinition(targetType, null)
        Parameters:
        targetType - type to create definition node for
        Returns:
        designated definition node for the targetType
        See Also:
        createDefinitionReference(ResolvedType), createStandardDefinition(ResolvedType, CustomDefinitionProviderV2)
      • createDefinitionReference

        com.fasterxml.jackson.databind.node.ObjectNode createDefinitionReference​(com.fasterxml.classmate.ResolvedType targetType)
        Create a definition for the given targetType. Also respecting any custom definition for the given targetType.
        The returned node will be empty, but is being remembered internally and populated later, i.e. it should not be changed!
        This is equivalent to calling createStandardDefinitionReference(targetType, null)
        Parameters:
        targetType - type to create definition (reference) node for
        Returns:
        (temporarily) empty reference node for the targetType that will only be populated at the very end of the schema generation
        See Also:
        createDefinition(ResolvedType), createStandardDefinitionReference(ResolvedType, CustomDefinitionProviderV2)
      • createStandardDefinitionReference

        com.fasterxml.jackson.databind.node.ObjectNode createStandardDefinitionReference​(com.fasterxml.classmate.ResolvedType targetType,
                                                                                         CustomDefinitionProviderV2 ignoredDefinitionProvider)
        Create a standard definition for the given targetType. Ignoring custom definitions up to the given one, but respecting others.
        The returned node will be empty, but is being remembered internally and populated later, i.e. it should not be changed!
        Parameters:
        targetType - type to create definition (reference) node for
        ignoredDefinitionProvider - custom definition provider to ignore
        Returns:
        (temporarily) empty reference node for the targetType that will only be populated at the very end of the schema generation
        See Also:
        createDefinitionReference(ResolvedType), createStandardDefinition(ResolvedType, CustomDefinitionProviderV2)
      • makeNullable

        com.fasterxml.jackson.databind.node.ObjectNode makeNullable​(com.fasterxml.jackson.databind.node.ObjectNode node)
        Ensure that the JSON schema represented by the given node allows for it to be of "type" "null".
        Parameters:
        node - representation of a JSON schema (part) that should allow a value of "type" "null"
        Returns:
        reference to the given parameter node