Interface JsonSchemaMapper

All Known Implementing Classes:
OpenApiJsonSchemaMapper

public interface JsonSchemaMapper
Updates a schema builder before converting a shape to a schema. updateSchema(JsonSchemaMapperContext, Schema.Builder) is the entry point during JSON Schema conversion, and is the recommended method to implement. If this method is implemented, updateSchema(Shape, Schema.Builder, JsonSchemaConfig) will NOT be called unless written in the implementation.
  • Method Details

    • getOrder

      default byte getOrder()
      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.

      Returns:
      Returns the sort order, defaulting to 0.
    • updateSchema

      default Schema.Builder updateSchema(JsonSchemaMapperContext context, Schema.Builder schemaBuilder)
      Updates a schema builder using information in JsonSchemaMapperContext. If not implemented, will default to updateSchema(Shape, Schema.Builder, JsonSchemaConfig) for backwards-compatibility.
      Parameters:
      context - Context with information needed to update the schema.
      schemaBuilder - Schema builder to update.
      Returns:
      Returns an updated schema builder.
    • updateSchema

      default Schema.Builder updateSchema(Shape shape, Schema.Builder schemaBuilder, JsonSchemaConfig config)
      Updates a schema builder, and is not recommended. Use updateSchema(JsonSchemaMapperContext, Schema.Builder) instead. If not implemented, this method will default to a no-op. This method is not deprecated for backwards-compatibility.
      Parameters:
      shape - Shape used for the conversion.
      schemaBuilder - Schema builder to update.
      config - JSON Schema config.
      Returns:
      Returns an updated schema builder.