Class Schema


public abstract class Schema extends JsonSerializable
Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed.
  • Constructor Details

    • Schema

      public Schema()
  • Method Details

    • anyOf

      public abstract Optional<List<Schema>> anyOf()
      Optional. The value should be validated against any (one or more) of the subschemas in the list.
    • default_

      public abstract Optional<Object> default_()
      Optional. Default value of the data.
    • description

      public abstract Optional<String> description()
      Optional. The description of the data.
    • enum_

      public abstract Optional<List<String>> enum_()
      Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
    • example

      public abstract Optional<Object> example()
      Optional. Example of the object. Will only populated when the object is the root.
    • format

      public abstract Optional<String> format()
      Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
    • items

      public abstract Optional<Schema> items()
      Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
    • maxItems

      public abstract Optional<Long> maxItems()
      Optional. Maximum number of the elements for Type.ARRAY.
    • maxLength

      public abstract Optional<Long> maxLength()
      Optional. Maximum length of the Type.STRING
    • maxProperties

      public abstract Optional<Long> maxProperties()
      Optional. Maximum number of the properties for Type.OBJECT.
    • maximum

      public abstract Optional<Double> maximum()
      Optional. Maximum value of the Type.INTEGER and Type.NUMBER
    • minItems

      public abstract Optional<Long> minItems()
      Optional. Minimum number of the elements for Type.ARRAY.
    • minLength

      public abstract Optional<Long> minLength()
      Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
    • minProperties

      public abstract Optional<Long> minProperties()
      Optional. Minimum number of the properties for Type.OBJECT.
    • minimum

      public abstract Optional<Double> minimum()
      Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
    • nullable

      public abstract Optional<Boolean> nullable()
      Optional. Indicates if the value may be null.
    • pattern

      public abstract Optional<String> pattern()
      Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
    • properties

      public abstract Optional<Map<String,Schema>> properties()
      Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
    • propertyOrdering

      public abstract Optional<List<String>> propertyOrdering()
      Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
    • required

      public abstract Optional<List<String>> required()
      Optional. Required properties of Type.OBJECT.
    • title

      public abstract Optional<String> title()
      Optional. The title of the Schema.
    • type

      public abstract Optional<Type> type()
      Optional. The type of the data.
    • builder

      public static Schema.Builder builder()
      Instantiates a builder for Schema.
    • toBuilder

      public abstract Schema.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static Schema fromJson(String jsonString)
      Deserializes a JSON string to a Schema object.