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 Summary
Modifier and TypeMethodDescriptionaddMapper
(JsonSchemaMapper jsonSchemaMapper) Adds a mapper used to update schema builders.build()
Creates an immutable object that is created from the properties that have been set on the builder.config
(JsonSchemaConfig config) Sets the configuration object.mappers
(List<JsonSchemaMapper> jsonSchemaMappers) Replaces the mappers of the builder with the given mappers.Sets the shape index to convert.propertyNamingStrategy
(PropertyNamingStrategy propertyNamingStrategy) Sets a custom property naming strategy.Only generates shapes connected to the given shape and set the given shape as the root of the created schema document.shapePredicate
(Predicate<Shape> shapePredicate) Sets a predicate used to filter Smithy shapes from being converted to JSON Schema.
-
Method Details
-
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 interfaceSmithyBuilder<JsonSchemaConverter>
- Returns:
- an instance of T
-
model
Sets the shape index to convert.- Parameters:
model
- Shape index to convert.- Returns:
- Returns the builder.
-
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
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
Adds a mapper used to update schema builders.- Parameters:
jsonSchemaMapper
- Mapper to add.- Returns:
- Returns the converter.
-
mappers
Replaces the mappers of the builder with the given mappers.- Parameters:
jsonSchemaMappers
- Mappers to replace with.- Returns:
- Returns the converter.
-