Class SchemaDocument.Builder

java.lang.Object
software.amazon.smithy.jsonschema.SchemaDocument.Builder
All Implemented Interfaces:
SmithyBuilder<SchemaDocument>
Enclosing class:
SchemaDocument

public static final class SchemaDocument.Builder extends Object implements SmithyBuilder<SchemaDocument>
Builds a JSON Schema document.
  • Method Details

    • build

      public SchemaDocument build()
      Description copied from interface: SmithyBuilder
      Creates an immutable object that is created from the properties that have been set on the builder.
      Specified by:
      build in interface SmithyBuilder<SchemaDocument>
      Returns:
      an instance of T
    • idKeyword

      public SchemaDocument.Builder idKeyword(String idKeyword)
      Sets the "$id" keyword.
      Parameters:
      idKeyword - ID keyword URI to set.
      Returns:
      Returns the builder.
    • schemaKeyword

      public SchemaDocument.Builder schemaKeyword(String schemaKeyword)
      Sets the "$schema" keyword.
      Parameters:
      schemaKeyword - Schema keyword URI to set.
      Returns:
      Returns the builder.
    • rootSchema

      public SchemaDocument.Builder rootSchema(Schema rootSchema)
      Sets the root schema.
      Parameters:
      rootSchema - Root schema of the document.
      Returns:
      Returns the builder.
    • putDefinition

      public SchemaDocument.Builder putDefinition(String name, Schema schema)
      Adds a scheme definition to the builder.
      Parameters:
      name - Name of the schema.
      schema - Schema to associate to the name.
      Returns:
      Returns the builder.
    • removeDefinition

      public SchemaDocument.Builder removeDefinition(String name)
      Removes a schema definition by name.
      Parameters:
      name - Name of the schema to remove.
      Returns:
      Returns the builder.
    • extensions

      public SchemaDocument.Builder extensions(ObjectNode extensions)
      Adds custom key-value pairs to the resulting JSON Schema document.
      Parameters:
      extensions - Extensions to apply.
      Returns:
      Returns the builder.