Class Openapiv2.JSONSchema

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Openapiv2.JSONSchemaOrBuilder, java.io.Serializable
    Enclosing class:
    Openapiv2

    public static final class Openapiv2.JSONSchema
    extends com.google.protobuf.GeneratedMessageV3
    implements Openapiv2.JSONSchemaOrBuilder
     `JSONSchema` represents properties from JSON Schema taken, and as used, in
     the OpenAPI v2 spec.
    
     This includes changes made by OpenAPI v2.
    
     See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject
    
     See also: https://cswr.github.io/JsonSchema/spec/basic_types/,
     https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json
    
     Example:
    
      message SimpleMessage {
        option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
          json_schema: {
            title: "SimpleMessage"
            description: "A simple message."
            required: ["id"]
          }
        };
    
        // Id represents the message identifier.
        string id = 1; [
            (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
              description: "The unique identifier of the simple message."
            }];
      }
     
    Protobuf type grpc.gateway.protoc_gen_openapiv2.options.JSONSchema
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected java.lang.Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getRef

        public java.lang.String getRef()
         Ref is used to define an external reference to include in the message.
         This could be a fully qualified proto message reference, and that type must
         be imported into the protofile. If no message is identified, the Ref will
         be used verbatim in the output.
         For example:
          `ref: ".google.protobuf.Timestamp"`.
         
        string ref = 3;
        Specified by:
        getRef in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The ref.
      • getRefBytes

        public com.google.protobuf.ByteString getRefBytes()
         Ref is used to define an external reference to include in the message.
         This could be a fully qualified proto message reference, and that type must
         be imported into the protofile. If no message is identified, the Ref will
         be used verbatim in the output.
         For example:
          `ref: ".google.protobuf.Timestamp"`.
         
        string ref = 3;
        Specified by:
        getRefBytes in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The bytes for ref.
      • getTitleBytes

        public com.google.protobuf.ByteString getTitleBytes()
         The title of the schema.
         
        string title = 5;
        Specified by:
        getTitleBytes in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The bytes for title.
      • getDescription

        public java.lang.String getDescription()
         A short description of the schema.
         
        string description = 6;
        Specified by:
        getDescription in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The description.
      • getDescriptionBytes

        public com.google.protobuf.ByteString getDescriptionBytes()
         A short description of the schema.
         
        string description = 6;
        Specified by:
        getDescriptionBytes in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The bytes for description.
      • getExample

        public java.lang.String getExample()
         A free-form property to include a JSON example of this field. This is copied
         verbatim to the output swagger.json. Quotes must be escaped.
         This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject  https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject
         
        string example = 9;
        Specified by:
        getExample in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The example.
      • getExampleBytes

        public com.google.protobuf.ByteString getExampleBytes()
         A free-form property to include a JSON example of this field. This is copied
         verbatim to the output swagger.json. Quotes must be escaped.
         This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject  https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject
         
        string example = 9;
        Specified by:
        getExampleBytes in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The bytes for example.
      • getMaximum

        public double getMaximum()
         Maximum represents an inclusive upper limit for a numeric instance. The
         value of MUST be a number,
         
        double maximum = 11;
        Specified by:
        getMaximum in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The maximum.
      • getMinimum

        public double getMinimum()
         minimum represents an inclusive lower limit for a numeric instance. The
         value of MUST be a number,
         
        double minimum = 13;
        Specified by:
        getMinimum in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The minimum.
      • getRequiredList

        public com.google.protobuf.ProtocolStringList getRequiredList()
        repeated string required = 26;
        Specified by:
        getRequiredList in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        A list containing the required.
      • getRequired

        public java.lang.String getRequired​(int index)
        repeated string required = 26;
        Specified by:
        getRequired in interface Openapiv2.JSONSchemaOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The required at the given index.
      • getRequiredBytes

        public com.google.protobuf.ByteString getRequiredBytes​(int index)
        repeated string required = 26;
        Specified by:
        getRequiredBytes in interface Openapiv2.JSONSchemaOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the required at the given index.
      • getArrayList

        public com.google.protobuf.ProtocolStringList getArrayList()
         Items in 'array' must be unique.
         
        repeated string array = 34;
        Specified by:
        getArrayList in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        A list containing the array.
      • getArray

        public java.lang.String getArray​(int index)
         Items in 'array' must be unique.
         
        repeated string array = 34;
        Specified by:
        getArray in interface Openapiv2.JSONSchemaOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The array at the given index.
      • getArrayBytes

        public com.google.protobuf.ByteString getArrayBytes​(int index)
         Items in 'array' must be unique.
         
        repeated string array = 34;
        Specified by:
        getArrayBytes in interface Openapiv2.JSONSchemaOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the array at the given index.
      • getTypeCount

        public int getTypeCount()
        repeated .grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes type = 35;
        Specified by:
        getTypeCount in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The count of type.
      • getTypeValueList

        public java.util.List<java.lang.Integer> getTypeValueList()
        repeated .grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes type = 35;
        Specified by:
        getTypeValueList in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        A list containing the enum numeric values on the wire for type.
      • getTypeValue

        public int getTypeValue​(int index)
        repeated .grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes type = 35;
        Specified by:
        getTypeValue in interface Openapiv2.JSONSchemaOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The enum numeric value on the wire of type at the given index.
      • getEnumList

        public com.google.protobuf.ProtocolStringList getEnumList()
         Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1
         
        repeated string enum = 46;
        Specified by:
        getEnumList in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        A list containing the enum.
      • getEnumCount

        public int getEnumCount()
         Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1
         
        repeated string enum = 46;
        Specified by:
        getEnumCount in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        The count of enum.
      • getEnum

        public java.lang.String getEnum​(int index)
         Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1
         
        repeated string enum = 46;
        Specified by:
        getEnum in interface Openapiv2.JSONSchemaOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The enum at the given index.
      • getEnumBytes

        public com.google.protobuf.ByteString getEnumBytes​(int index)
         Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1
         
        repeated string enum = 46;
        Specified by:
        getEnumBytes in interface Openapiv2.JSONSchemaOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the enum at the given index.
      • hasFieldConfiguration

        public boolean hasFieldConfiguration()
         Additional field level properties used when generating the OpenAPI v2 file.
         
        .grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.FieldConfiguration field_configuration = 1001;
        Specified by:
        hasFieldConfiguration in interface Openapiv2.JSONSchemaOrBuilder
        Returns:
        Whether the fieldConfiguration field is set.
      • getExtensionsCount

        public int getExtensionsCount()
        Description copied from interface: Openapiv2.JSONSchemaOrBuilder
         Custom properties that start with "x-" such as "x-foo" used to describe
         extra functionality that is not covered by the standard OpenAPI Specification.
         See: https://swagger.io/docs/specification/2-0/swagger-extensions/
         
        map<string, .google.protobuf.Value> extensions = 48;
        Specified by:
        getExtensionsCount in interface Openapiv2.JSONSchemaOrBuilder
      • containsExtensions

        public boolean containsExtensions​(java.lang.String key)
         Custom properties that start with "x-" such as "x-foo" used to describe
         extra functionality that is not covered by the standard OpenAPI Specification.
         See: https://swagger.io/docs/specification/2-0/swagger-extensions/
         
        map<string, .google.protobuf.Value> extensions = 48;
        Specified by:
        containsExtensions in interface Openapiv2.JSONSchemaOrBuilder
      • getExtensionsMap

        public java.util.Map<java.lang.String,​com.google.protobuf.Value> getExtensionsMap()
         Custom properties that start with "x-" such as "x-foo" used to describe
         extra functionality that is not covered by the standard OpenAPI Specification.
         See: https://swagger.io/docs/specification/2-0/swagger-extensions/
         
        map<string, .google.protobuf.Value> extensions = 48;
        Specified by:
        getExtensionsMap in interface Openapiv2.JSONSchemaOrBuilder
      • getExtensionsOrDefault

        public com.google.protobuf.Value getExtensionsOrDefault​(java.lang.String key,
                                                                com.google.protobuf.Value defaultValue)
         Custom properties that start with "x-" such as "x-foo" used to describe
         extra functionality that is not covered by the standard OpenAPI Specification.
         See: https://swagger.io/docs/specification/2-0/swagger-extensions/
         
        map<string, .google.protobuf.Value> extensions = 48;
        Specified by:
        getExtensionsOrDefault in interface Openapiv2.JSONSchemaOrBuilder
      • getExtensionsOrThrow

        public com.google.protobuf.Value getExtensionsOrThrow​(java.lang.String key)
         Custom properties that start with "x-" such as "x-foo" used to describe
         extra functionality that is not covered by the standard OpenAPI Specification.
         See: https://swagger.io/docs/specification/2-0/swagger-extensions/
         
        map<string, .google.protobuf.Value> extensions = 48;
        Specified by:
        getExtensionsOrThrow in interface Openapiv2.JSONSchemaOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws java.io.IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        java.io.IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(java.nio.ByteBuffer data)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(java.nio.ByteBuffer data,
                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(com.google.protobuf.ByteString data)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(com.google.protobuf.ByteString data,
                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(byte[] data)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(byte[] data,
                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(java.io.InputStream input)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(java.io.InputStream input,
                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDelimitedFrom

        public static Openapiv2.JSONSchema parseDelimitedFrom​(java.io.InputStream input)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDelimitedFrom

        public static Openapiv2.JSONSchema parseDelimitedFrom​(java.io.InputStream input,
                                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(com.google.protobuf.CodedInputStream input)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

        public static Openapiv2.JSONSchema parseFrom​(com.google.protobuf.CodedInputStream input,
                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • newBuilderForType

        public Openapiv2.JSONSchema.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public Openapiv2.JSONSchema.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected Openapiv2.JSONSchema.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<Openapiv2.JSONSchema> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public Openapiv2.JSONSchema getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder