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 java.lang.Object implements SmithyBuilder<JsonSchemaConverter>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonSchemaConverter.BuilderaddMapper(JsonSchemaMapper jsonSchemaMapper)Adds a mapper used to update schema builders.JsonSchemaConverterbuild()Creates an immutable object that is created from the properties that have been set on the builder.JsonSchemaConverter.Builderconfig(JsonSchemaConfig config)Sets the configuration object.JsonSchemaConverter.Buildermappers(java.util.List<JsonSchemaMapper> jsonSchemaMappers)Replaces the mappers of the builder with the given mappers.JsonSchemaConverter.Buildermodel(Model model)Sets the shape index to convert.JsonSchemaConverter.BuilderpropertyNamingStrategy(PropertyNamingStrategy propertyNamingStrategy)Sets a custom property naming strategy.JsonSchemaConverter.BuilderrootShape(ToShapeId rootShape)Only generates shapes connected to the given shape and set the given shape as the root of the created schema document.JsonSchemaConverter.BuildershapePredicate(java.util.function.Predicate<Shape> shapePredicate)Sets a predicate used to filter Smithy shapes from being converted to JSON Schema.
-
-
-
Method Detail
-
build
public JsonSchemaConverter build()
Description copied from interface:SmithyBuilderCreates an immutable object that is created from the properties that have been set on the builder.- Specified by:
buildin interfaceSmithyBuilder<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(java.util.function.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
public JsonSchemaConverter.Builder config(JsonSchemaConfig 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(java.util.List<JsonSchemaMapper> jsonSchemaMappers)
Replaces the mappers of the builder with the given mappers.- Parameters:
jsonSchemaMappers- Mappers to replace with.- Returns:
- Returns the converter.
-
-