Class JsonSchemaConverter.Builder

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

public static final class JsonSchemaConverter.Builder extends Object implements SmithyBuilder<JsonSchemaConverter>
  • Method Details

    • build

      public JsonSchemaConverter 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<JsonSchemaConverter>
      Returns:
      an instance of T
    • model

      public JsonSchemaConverter.Builder model(Model model)
      Sets the shape index to convert.
      Parameters:
      model - Shape index to convert.
      Returns:
      Returns the builder.
    • rootShape

      public JsonSchemaConverter.Builder rootShape(ToShapeId rootShape)
      Only generates shapes connected to the given shape and set the given shape as the root of the created schema document.
      Parameters:
      rootShape - ID of the shape that is used to limit the closure of the generated document.
      Returns:
      Returns the builder.
    • shapePredicate

      public JsonSchemaConverter.Builder shapePredicate(Predicate<Shape> shapePredicate)
      Sets a predicate used to filter Smithy shapes from being converted to JSON Schema.
      Parameters:
      shapePredicate - Predicate that returns true if a shape is to be converted.
      Returns:
      Returns the converter.
    • config

      Sets the configuration object.
      Parameters:
      config - Config to use.
      Returns:
      Returns the converter.
    • propertyNamingStrategy

      public JsonSchemaConverter.Builder propertyNamingStrategy(PropertyNamingStrategy propertyNamingStrategy)
      Sets a custom property naming strategy.

      This method overrides an configuration values specified by the configuration object.

      Parameters:
      propertyNamingStrategy - Property name strategy to use.
      Returns:
      Returns the converter.
    • addMapper

      public JsonSchemaConverter.Builder addMapper(JsonSchemaMapper jsonSchemaMapper)
      Adds a mapper used to update schema builders.
      Parameters:
      jsonSchemaMapper - Mapper to add.
      Returns:
      Returns the converter.
    • mappers

      public JsonSchemaConverter.Builder mappers(List<JsonSchemaMapper> jsonSchemaMappers)
      Replaces the mappers of the builder with the given mappers.
      Parameters:
      jsonSchemaMappers - Mappers to replace with.
      Returns:
      Returns the converter.