software.amazon.smithy.jsonschema.JsonSchemaMapper Maven / Gradle / Ivy
Show all versions of smithy-jsonschema Show documentation
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.smithy.jsonschema;
import software.amazon.smithy.model.shapes.Shape;
/**
* Updates a schema builder before converting a shape to a schema.
*/
public interface JsonSchemaMapper {
/**
* Gets the sort order of the plugin from -128 to 127.
*
* Plugins are applied according to this sort order. Lower values
* are executed before higher values (for example, -128 comes before 0,
* comes before 127). Plugins default to 0, which is the middle point
* between the minimum and maximum order values.
*
* @return Returns the sort order, defaulting to 0.
*/
default byte getOrder() {
return 0;
}
/**
* Updates a schema builder.
*
* @param shape Shape used for the conversion.
* @param schemaBuilder Schema builder to update.
* @param config JSON Schema config.
* @return Returns an updated schema builder.
*/
Schema.Builder updateSchema(Shape shape, Schema.Builder schemaBuilder, JsonSchemaConfig config);
}