Class Openapiv2.Swagger

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

    public static final class Openapiv2.Swagger
    extends com.google.protobuf.GeneratedMessageV3
    implements Openapiv2.SwaggerOrBuilder
     `Swagger` is a representation of OpenAPI v2 specification's Swagger object.
     See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject
     Example:
      option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
        info: {
          title: "Echo API";
          version: "1.0";
          description: ";
          contact: {
            name: "gRPC-Gateway project";
            url: "https://github.com/grpc-ecosystem/grpc-gateway";
            email: "none@example.com";
          };
          license: {
            name: "BSD 3-Clause License";
            url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt";
          };
        };
        schemes: HTTPS;
        consumes: "application/json";
        produces: "application/json";
      };
     
    Protobuf type grpc.gateway.protoc_gen_swagger.options.Swagger
    See Also:
    Serialized Form
    • Constructor Detail

      • Swagger

        private Swagger​(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)
      • Swagger

        private Swagger()
    • Method Detail

      • newInstance

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

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields 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
      • getSwagger

        public String getSwagger()
         Specifies the Swagger Specification version being used. It can be
         used by the Swagger UI and other clients to interpret the API listing. The 
         value MUST be "2.0".
         
        string swagger = 1;
        Specified by:
        getSwagger in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The swagger.
      • getSwaggerBytes

        public com.google.protobuf.ByteString getSwaggerBytes()
         Specifies the Swagger Specification version being used. It can be
         used by the Swagger UI and other clients to interpret the API listing. The 
         value MUST be "2.0".
         
        string swagger = 1;
        Specified by:
        getSwaggerBytes in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The bytes for swagger.
      • hasInfo

        public boolean hasInfo()
         Provides metadata about the API. The metadata can be used by the 
         clients if needed.
         
        .grpc.gateway.protoc_gen_swagger.options.Info info = 2;
        Specified by:
        hasInfo in interface Openapiv2.SwaggerOrBuilder
        Returns:
        Whether the info field is set.
      • getInfo

        public Openapiv2.Info getInfo()
         Provides metadata about the API. The metadata can be used by the 
         clients if needed.
         
        .grpc.gateway.protoc_gen_swagger.options.Info info = 2;
        Specified by:
        getInfo in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The info.
      • getHost

        public String getHost()
         The host (name or ip) serving the API. This MUST be the host only and does 
         not include the scheme nor sub-paths. It MAY include a port. If the host is
         not included, the host serving the documentation is to be used (including
         the port). The host does not support path templating.
         
        string host = 3;
        Specified by:
        getHost in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The host.
      • getHostBytes

        public com.google.protobuf.ByteString getHostBytes()
         The host (name or ip) serving the API. This MUST be the host only and does 
         not include the scheme nor sub-paths. It MAY include a port. If the host is
         not included, the host serving the documentation is to be used (including
         the port). The host does not support path templating.
         
        string host = 3;
        Specified by:
        getHostBytes in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The bytes for host.
      • getBasePath

        public String getBasePath()
         The base path on which the API is served, which is relative to the host. If
         it is not included, the API is served directly under the host. The value 
         MUST start with a leading slash (/). The basePath does not support path
         templating.
         Note that using `base_path` does not change the endpoint paths that are 
         generated in the resulting Swagger file. If you wish to use `base_path`
         with relatively generated Swagger paths, the `base_path` prefix must be 
         manually removed from your `google.api.http` paths and your code changed to 
         serve the API from the `base_path`.
         
        string base_path = 4;
        Specified by:
        getBasePath in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The basePath.
      • getBasePathBytes

        public com.google.protobuf.ByteString getBasePathBytes()
         The base path on which the API is served, which is relative to the host. If
         it is not included, the API is served directly under the host. The value 
         MUST start with a leading slash (/). The basePath does not support path
         templating.
         Note that using `base_path` does not change the endpoint paths that are 
         generated in the resulting Swagger file. If you wish to use `base_path`
         with relatively generated Swagger paths, the `base_path` prefix must be 
         manually removed from your `google.api.http` paths and your code changed to 
         serve the API from the `base_path`.
         
        string base_path = 4;
        Specified by:
        getBasePathBytes in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The bytes for basePath.
      • getSchemesList

        public List<Openapiv2.Swagger.SwaggerScheme> getSchemesList()
         The transfer protocol of the API. Values MUST be from the list: "http",
         "https", "ws", "wss". If the schemes is not included, the default scheme to
         be used is the one used to access the Swagger definition itself.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.Swagger.SwaggerScheme schemes = 5;
        Specified by:
        getSchemesList in interface Openapiv2.SwaggerOrBuilder
        Returns:
        A list containing the schemes.
      • getSchemesCount

        public int getSchemesCount()
         The transfer protocol of the API. Values MUST be from the list: "http",
         "https", "ws", "wss". If the schemes is not included, the default scheme to
         be used is the one used to access the Swagger definition itself.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.Swagger.SwaggerScheme schemes = 5;
        Specified by:
        getSchemesCount in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The count of schemes.
      • getSchemes

        public Openapiv2.Swagger.SwaggerScheme getSchemes​(int index)
         The transfer protocol of the API. Values MUST be from the list: "http",
         "https", "ws", "wss". If the schemes is not included, the default scheme to
         be used is the one used to access the Swagger definition itself.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.Swagger.SwaggerScheme schemes = 5;
        Specified by:
        getSchemes in interface Openapiv2.SwaggerOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The schemes at the given index.
      • getSchemesValueList

        public List<Integer> getSchemesValueList()
         The transfer protocol of the API. Values MUST be from the list: "http",
         "https", "ws", "wss". If the schemes is not included, the default scheme to
         be used is the one used to access the Swagger definition itself.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.Swagger.SwaggerScheme schemes = 5;
        Specified by:
        getSchemesValueList in interface Openapiv2.SwaggerOrBuilder
        Returns:
        A list containing the enum numeric values on the wire for schemes.
      • getSchemesValue

        public int getSchemesValue​(int index)
         The transfer protocol of the API. Values MUST be from the list: "http",
         "https", "ws", "wss". If the schemes is not included, the default scheme to
         be used is the one used to access the Swagger definition itself.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.Swagger.SwaggerScheme schemes = 5;
        Specified by:
        getSchemesValue in interface Openapiv2.SwaggerOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The enum numeric value on the wire of schemes at the given index.
      • getConsumesList

        public com.google.protobuf.ProtocolStringList getConsumesList()
         A list of MIME types the APIs can consume. This is global to all APIs but 
         can be overridden on specific API calls. Value MUST be as described under
         Mime Types.
         
        repeated string consumes = 6;
        Specified by:
        getConsumesList in interface Openapiv2.SwaggerOrBuilder
        Returns:
        A list containing the consumes.
      • getConsumesCount

        public int getConsumesCount()
         A list of MIME types the APIs can consume. This is global to all APIs but 
         can be overridden on specific API calls. Value MUST be as described under
         Mime Types.
         
        repeated string consumes = 6;
        Specified by:
        getConsumesCount in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The count of consumes.
      • getConsumes

        public String getConsumes​(int index)
         A list of MIME types the APIs can consume. This is global to all APIs but 
         can be overridden on specific API calls. Value MUST be as described under
         Mime Types.
         
        repeated string consumes = 6;
        Specified by:
        getConsumes in interface Openapiv2.SwaggerOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The consumes at the given index.
      • getConsumesBytes

        public com.google.protobuf.ByteString getConsumesBytes​(int index)
         A list of MIME types the APIs can consume. This is global to all APIs but 
         can be overridden on specific API calls. Value MUST be as described under
         Mime Types.
         
        repeated string consumes = 6;
        Specified by:
        getConsumesBytes in interface Openapiv2.SwaggerOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the consumes at the given index.
      • getProducesList

        public com.google.protobuf.ProtocolStringList getProducesList()
         A list of MIME types the APIs can produce. This is global to all APIs but
         can be overridden on specific API calls. Value MUST be as described under
         Mime Types.
         
        repeated string produces = 7;
        Specified by:
        getProducesList in interface Openapiv2.SwaggerOrBuilder
        Returns:
        A list containing the produces.
      • getProducesCount

        public int getProducesCount()
         A list of MIME types the APIs can produce. This is global to all APIs but
         can be overridden on specific API calls. Value MUST be as described under
         Mime Types.
         
        repeated string produces = 7;
        Specified by:
        getProducesCount in interface Openapiv2.SwaggerOrBuilder
        Returns:
        The count of produces.
      • getProduces

        public String getProduces​(int index)
         A list of MIME types the APIs can produce. This is global to all APIs but
         can be overridden on specific API calls. Value MUST be as described under
         Mime Types.
         
        repeated string produces = 7;
        Specified by:
        getProduces in interface Openapiv2.SwaggerOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The produces at the given index.
      • getProducesBytes

        public com.google.protobuf.ByteString getProducesBytes​(int index)
         A list of MIME types the APIs can produce. This is global to all APIs but
         can be overridden on specific API calls. Value MUST be as described under
         Mime Types.
         
        repeated string produces = 7;
        Specified by:
        getProducesBytes in interface Openapiv2.SwaggerOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the produces at the given index.
      • getResponsesCount

        public int getResponsesCount()
        Description copied from interface: Openapiv2.SwaggerOrBuilder
         An object to hold responses that can be used across operations. This
         property does not define global responses for all operations.
         
        map<string, .grpc.gateway.protoc_gen_swagger.options.Response> responses = 10;
        Specified by:
        getResponsesCount in interface Openapiv2.SwaggerOrBuilder
      • containsResponses

        public boolean containsResponses​(String key)
         An object to hold responses that can be used across operations. This
         property does not define global responses for all operations.
         
        map<string, .grpc.gateway.protoc_gen_swagger.options.Response> responses = 10;
        Specified by:
        containsResponses in interface Openapiv2.SwaggerOrBuilder
      • getResponsesMap

        public Map<String,​Openapiv2.Response> getResponsesMap()
         An object to hold responses that can be used across operations. This
         property does not define global responses for all operations.
         
        map<string, .grpc.gateway.protoc_gen_swagger.options.Response> responses = 10;
        Specified by:
        getResponsesMap in interface Openapiv2.SwaggerOrBuilder
      • getResponsesOrThrow

        public Openapiv2.Response getResponsesOrThrow​(String key)
         An object to hold responses that can be used across operations. This
         property does not define global responses for all operations.
         
        map<string, .grpc.gateway.protoc_gen_swagger.options.Response> responses = 10;
        Specified by:
        getResponsesOrThrow in interface Openapiv2.SwaggerOrBuilder
      • hasSecurityDefinitions

        public boolean hasSecurityDefinitions()
         Security scheme definitions that can be used across the specification.
         
        .grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions security_definitions = 11;
        Specified by:
        hasSecurityDefinitions in interface Openapiv2.SwaggerOrBuilder
        Returns:
        Whether the securityDefinitions field is set.
      • getSecurityList

        public List<Openapiv2.SecurityRequirement> getSecurityList()
         A declaration of which security schemes are applied for the API as a whole.
         The list of values describes alternative security schemes that can be used 
         (that is, there is a logical OR between the security requirements). 
         Individual operations can override this definition.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.SecurityRequirement security = 12;
        Specified by:
        getSecurityList in interface Openapiv2.SwaggerOrBuilder
      • getSecurityOrBuilderList

        public List<? extends Openapiv2.SecurityRequirementOrBuilder> getSecurityOrBuilderList()
         A declaration of which security schemes are applied for the API as a whole.
         The list of values describes alternative security schemes that can be used 
         (that is, there is a logical OR between the security requirements). 
         Individual operations can override this definition.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.SecurityRequirement security = 12;
        Specified by:
        getSecurityOrBuilderList in interface Openapiv2.SwaggerOrBuilder
      • getSecurityCount

        public int getSecurityCount()
         A declaration of which security schemes are applied for the API as a whole.
         The list of values describes alternative security schemes that can be used 
         (that is, there is a logical OR between the security requirements). 
         Individual operations can override this definition.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.SecurityRequirement security = 12;
        Specified by:
        getSecurityCount in interface Openapiv2.SwaggerOrBuilder
      • getSecurity

        public Openapiv2.SecurityRequirement getSecurity​(int index)
         A declaration of which security schemes are applied for the API as a whole.
         The list of values describes alternative security schemes that can be used 
         (that is, there is a logical OR between the security requirements). 
         Individual operations can override this definition.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.SecurityRequirement security = 12;
        Specified by:
        getSecurity in interface Openapiv2.SwaggerOrBuilder
      • getSecurityOrBuilder

        public Openapiv2.SecurityRequirementOrBuilder getSecurityOrBuilder​(int index)
         A declaration of which security schemes are applied for the API as a whole.
         The list of values describes alternative security schemes that can be used 
         (that is, there is a logical OR between the security requirements). 
         Individual operations can override this definition.
         
        repeated .grpc.gateway.protoc_gen_swagger.options.SecurityRequirement security = 12;
        Specified by:
        getSecurityOrBuilder in interface Openapiv2.SwaggerOrBuilder
      • hasExternalDocs

        public boolean hasExternalDocs()
         Additional external documentation.
         
        .grpc.gateway.protoc_gen_swagger.options.ExternalDocumentation external_docs = 14;
        Specified by:
        hasExternalDocs in interface Openapiv2.SwaggerOrBuilder
        Returns:
        Whether the externalDocs field is set.
      • internalGetExtensions

        private com.google.protobuf.MapField<String,​com.google.protobuf.Value> internalGetExtensions()
      • getExtensionsOrDefault

        public com.google.protobuf.Value getExtensionsOrDefault​(String key,
                                                                com.google.protobuf.Value defaultValue)
        map<string, .google.protobuf.Value> extensions = 15;
        Specified by:
        getExtensionsOrDefault in interface Openapiv2.SwaggerOrBuilder
      • 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 IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        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​(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.Swagger parseFrom​(ByteBuffer data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

        public static Openapiv2.Swagger 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.Swagger parseFrom​(byte[] data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

        public com.google.protobuf.Parser<Openapiv2.Swagger> 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.Swagger getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder