From 3fe45b85deb979d49219b8d626bdef03069b9c93 Mon Sep 17 00:00:00 2001 From: iamrajiv Date: Wed, 23 Jul 2025 18:45:26 +0530 Subject: [PATCH 1/8] add rg --- .../clients/abe/.swagger-codegen/VERSION | 2 +- .../internal/clients/abe/api/swagger.yaml | 15607 +++++++++------- .../clients/abe/api_a_bit_of_everything.go | 1279 +- .../abe/api_camel_case_service_name.go | 15 +- examples/internal/clients/abe/api_echo_rpc.go | 56 +- .../clients/abe/api_snake_enum_service.go | 15 +- examples/internal/clients/abe/client.go | 15 +- .../internal/clients/abe/configuration.go | 3 +- .../clients/abe/model_a_bit_of_everything.go | 4 - .../abe/model_a_bit_of_everything_1.go | 4 - .../abe/model_a_bit_of_everything_2.go | 20 +- .../abe/model_a_bit_of_everything_3.go | 5 +- .../abe/model_a_bit_of_everything_4.go | 5 +- .../abe/model_a_bit_of_everything_nested.go | 2 - ..._everything_service_deep_path_echo_body.go | 4 - ...rvice_deep_path_echo_body_single_nested.go | 2 - ...thing_service_post_with_empty_body_body.go | 1 - ...it_of_everything_service_update_v2_body.go | 3 +- .../model_examplepb_a_bit_of_everything.go | 4 - ..._examplepb_a_bit_of_everything_repeated.go | 1 - ...a_bit_of_everything_service_update_body.go | 4 - .../clients/abe/model_examplepb_bar.go | 1 - .../clients/abe/model_examplepb_body.go | 1 - .../clients/abe/model_examplepb_book.go | 2 - .../model_examplepb_check_status_response.go | 1 - .../abe/model_examplepb_error_object.go | 1 - .../abe/model_examplepb_error_response.go | 1 - .../abe/model_examplepb_numeric_enum.go | 1 - ...examplepb_required_message_type_request.go | 1 - .../model_examplepb_snake_enum_response.go | 1 - .../abe/model_examplepbsnake_case_0_enum.go | 1 - .../abe/model_examplepbsnake_case_enum.go | 1 - ...odel_message_path_enum_nested_path_enum.go | 1 - .../clients/abe/model_nested_deep_enum.go | 1 - .../abe/model_oneofenum_example_enum.go | 1 - .../clients/abe/model_pathenum_path_enum.go | 1 - .../model_pathenumsnake_case_for_import.go | 1 - .../clients/abe/model_protoexamplepb_foo.go | 1 - .../internal/clients/abe/model_rpc_status.go | 3 +- .../clients/abe/model_sub_string_message.go | 1 - .../clients/abe/model_v1_book_name_body.go | 21 + .../clients/abe/model_v1_book_name_body_1.go | 21 + examples/internal/clients/abe/response.go | 1 - .../clients/echo/.swagger-codegen/VERSION | 2 +- .../internal/clients/echo/api/swagger.yaml | 2381 +-- .../internal/clients/echo/api_echo_service.go | 372 +- examples/internal/clients/echo/client.go | 15 +- .../internal/clients/echo/configuration.go | 3 +- .../echo/model_examplepb_dynamic_message.go | 1 - .../model_examplepb_dynamic_message_update.go | 1 - .../clients/echo/model_examplepb_embedded.go | 1 - .../echo/model_examplepb_nested_message.go | 1 - .../echo/model_examplepb_simple_message.go | 1 - .../clients/echo/model_protobuf_null_value.go | 1 - .../internal/clients/echo/model_rpc_status.go | 3 +- examples/internal/clients/echo/response.go | 1 - .../.swagger-codegen/VERSION | 2 +- .../generateunboundmethods/api/swagger.yaml | 224 +- ...i_generate_unbound_methods_echo_service.go | 23 +- .../clients/generateunboundmethods/client.go | 15 +- .../generateunboundmethods/configuration.go | 3 +- ...lepbGenerateUnboundMethodsSimpleMessage.md | 1 - .../GenerateUnboundMethodsEchoServiceApi.md | 5 +- ...generate_unbound_methods_simple_message.go | 1 - .../model_rpc_status.go | 3 +- .../generateunboundmethods/response.go | 1 - .../responsebody/.swagger-codegen/VERSION | 2 +- .../clients/responsebody/api/swagger.yaml | 562 +- .../responsebody/api_response_body_service.go | 47 +- .../internal/clients/responsebody/client.go | 15 +- .../clients/responsebody/configuration.go | 3 +- .../docs/ExamplepbRepeatedResponseBodyOut.md | 1 - ...xamplepbRepeatedResponseBodyOutResponse.md | 1 - .../docs/ExamplepbRepeatedResponseStrings.md | 1 - .../docs/ExamplepbResponseBodyOut.md | 1 - .../docs/ExamplepbResponseBodyOutResponse.md | 1 - .../docs/ExamplepbResponseBodyValue.md | 1 - .../docs/ResponseBodyServiceApi.md | 15 +- .../responsebody/docs/ResponseResponseType.md | 1 - .../clients/responsebody/docs/RpcStatus.md | 3 +- .../StreamResultOfExamplepbResponseBodyOut.md | 1 - ...el_examplepb_repeated_response_body_out.go | 1 - ...epb_repeated_response_body_out_response.go | 1 - ...del_examplepb_repeated_response_strings.go | 1 - .../model_examplepb_response_body_out.go | 1 - ...el_examplepb_response_body_out_response.go | 1 - .../model_examplepb_response_body_value.go | 1 - .../model_response_response_type.go | 1 - .../clients/responsebody/model_rpc_status.go | 3 +- ...m_result_of_examplepb_response_body_out.go | 1 - .../internal/clients/responsebody/response.go | 1 - .../unannotatedecho/.swagger-codegen/VERSION | 2 +- .../clients/unannotatedecho/api/swagger.yaml | 1220 +- .../api_unannotated_echo_service.go | 141 +- .../clients/unannotatedecho/client.go | 15 +- .../clients/unannotatedecho/configuration.go | 3 +- .../model_examplepb_unannotated_embedded.go | 1 - ...el_examplepb_unannotated_nested_message.go | 1 - ...el_examplepb_unannotated_simple_message.go | 1 - .../unannotatedecho/model_rpc_status.go | 3 +- .../clients/unannotatedecho/response.go | 1 - .../a_bit_of_everything.swagger.json | 3 +- 102 files changed, 12519 insertions(+), 9716 deletions(-) create mode 100644 examples/internal/clients/abe/model_v1_book_name_body.go create mode 100644 examples/internal/clients/abe/model_v1_book_name_body_1.go diff --git a/examples/internal/clients/abe/.swagger-codegen/VERSION b/examples/internal/clients/abe/.swagger-codegen/VERSION index 752a79ef362..b61c49d271a 100644 --- a/examples/internal/clients/abe/.swagger-codegen/VERSION +++ b/examples/internal/clients/abe/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8 \ No newline at end of file +3.0.71 \ No newline at end of file diff --git a/examples/internal/clients/abe/api/swagger.yaml b/examples/internal/clients/abe/api/swagger.yaml index 79cf407779d..091ccbe223f 100644 --- a/examples/internal/clients/abe/api/swagger.yaml +++ b/examples/internal/clients/abe/api/swagger.yaml @@ -1,6685 +1,9390 @@ ---- -swagger: "2.0" +openapi: 3.0.1 info: - version: "1.0" - title: "A Bit of Everything" + title: A Bit of Everything contact: - name: "gRPC-Gateway project" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - email: "none@example.com" + 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/main/LICENSE" - x-something-something: "yadda" -tags: -- name: "echo rpc" - description: "Echo Rpc description" - x-traitTag: true -- name: "ABitOfEverything" - description: "ABitOfEverythingService description -- which should not be used in\ - \ place of the documentation comment!" - externalDocs: - description: "Find out more about EchoService" - url: "https://github.com/grpc-ecosystem/grpc-gateway" -- name: "camelCaseServiceName" -- name: "AnotherServiceWithNoBindings" -- name: "SnakeEnumService" -schemes: -- "http" -- "https" -- "wss" -consumes: -- "application/json" -- "application/x-foo-mime" -produces: -- "application/json" -- "application/x-foo-mime" + name: BSD 3-Clause License + url: https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE + version: "1.0" + x-something-something: yadda +externalDocs: + description: More about gRPC-Gateway + url: https://github.com/grpc-ecosystem/grpc-gateway +servers: +- url: / security: - ApiKeyAuth: [] BasicAuth: [] - ApiKeyAuth: [] OAuth2: - - "read" - - "write" + - read + - write +tags: +- name: echo rpc + description: Echo Rpc description + x-traitTag: true +- name: ABitOfEverything + description: ABitOfEverythingService description -- which should not be used in + place of the documentation comment! + externalDocs: + description: Find out more about EchoService + url: https://github.com/grpc-ecosystem/grpc-gateway +- name: camelCaseServiceName +- name: AnotherServiceWithNoBindings +- name: SnakeEnumService paths: /v1/example/a_bit_of_everything: post: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_CreateBody" - parameters: - - in: "body" - name: "body" - description: "Intentionally complicated message type to cover many features\ - \ of Protobuf." + - ABitOfEverything + operationId: ABitOfEverythingService_CreateBody + requestBody: + description: Intentionally complicated message type to cover many features + of Protobuf. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" required: true - schema: - $ref: "#/definitions/examplepbABitOfEverything" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverything" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /v1/example/a_bit_of_everything/echo/{value}: get: tags: - - "echo rpc" + - echo rpc summary: "Summary: Echo rpc" - description: "Description Echo" - operationId: "ABitOfEverythingService_Echo" + description: Description Echo + externalDocs: + description: Find out more Echo + url: https://github.com/grpc-ecosystem/grpc-gateway + operationId: ABitOfEverythingService_Echo parameters: - - name: "value" - in: "path" + - name: value + in: path required: true - type: "string" - x-exportParamName: "Value" + style: simple + explode: false + schema: + type: string responses: - 200: - description: "A successful response." - examples: - application/json: - value: "the input value" - schema: - $ref: "#/definitions/subStringMessage" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "integer" - format: "integer" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" - 503: - description: "Returned when the resource is temporarily unavailable." - schema: {} + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/subStringMessage" + example: + value: the input value + application/x-foo-mime: + schema: + $ref: "#/components/schemas/subStringMessage" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: integer + format: integer + x-content-type: application/json + application/x-foo-mime: + schema: + type: integer + format: integer + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + "503": + description: Returned when the resource is temporarily unavailable. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object x-number: 100 default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - externalDocs: - description: "Find out more Echo" - url: "https://github.com/grpc-ecosystem/grpc-gateway" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}: get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_CheckNestedEnumGetQueryParams" + - ABitOfEverything + operationId: ABitOfEverythingService_CheckNestedEnumGetQueryParams parameters: - - name: "singleNested.ok" - in: "path" - description: "DeepEnum description." - required: true - type: "string" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "SingleNestedOk" - - name: "singleNested.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "SingleNestedName" - x-optionalDataType: "String" - - name: "singleNested.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "SingleNestedAmount" - x-optionalDataType: "Int64" - - name: "uuid" - in: "query" - required: true - type: "string" - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - format: "uuid" + - name: singleNested.ok + in: path + description: DeepEnum description. + required: true + style: simple + explode: false + schema: + type: string + enum: + - "FALSE" + - "TRUE" + - name: singleNested.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: singleNested.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: uuid + in: query + required: true + style: form + explode: true + schema: + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + type: string + format: uuid + x-internal: true x-internal: true - x-exportParamName: "Uuid" - - name: "floatValue" - in: "query" - description: "Float value field" - required: true - type: "number" - default: 0.2 - format: "float" - x-exportParamName: "FloatValue" - - name: "doubleValue" - in: "query" - required: true - type: "number" - format: "double" - x-exportParamName: "DoubleValue" - - name: "int64Value" - in: "query" - required: true - type: "string" - format: "int64" - x-exportParamName: "Int64Value" - - name: "uint64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Uint64Value" - x-optionalDataType: "String" - - name: "int32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Int32Value" - x-optionalDataType: "Int32" - - name: "fixed64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Fixed64Value" - x-optionalDataType: "String" - - name: "fixed32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Fixed32Value" - x-optionalDataType: "Int64" - - name: "boolValue" - in: "query" - required: false - type: "boolean" - x-exportParamName: "BoolValue" - x-optionalDataType: "Bool" - - name: "stringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "StringValue" - x-optionalDataType: "String" - - name: "bytesValue" - in: "query" - required: false - type: "string" - format: "byte" - x-exportParamName: "BytesValue" - x-optionalDataType: "String" - - name: "uint32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Uint32Value" - x-optionalDataType: "Int64" - - name: "enumValue" - in: "query" - description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValue" - x-optionalDataType: "String" - - name: "pathEnumValue" - in: "query" - required: false - type: "string" - default: "ABC" - enum: - - "ABC" - - "DEF" - x-exportParamName: "PathEnumValue" - x-optionalDataType: "String" - - name: "nestedPathEnumValue" - in: "query" - required: false - type: "string" - default: "GHI" - enum: - - "GHI" - - "JKL" - x-exportParamName: "NestedPathEnumValue" - x-optionalDataType: "String" - - name: "sfixed32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sfixed32Value" - x-optionalDataType: "Int32" - - name: "sfixed64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sfixed64Value" - x-optionalDataType: "String" - - name: "sint32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sint32Value" - x-optionalDataType: "Int32" - - name: "sint64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sint64Value" - x-optionalDataType: "String" - - name: "repeatedStringValue" - in: "query" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringValue" - - name: "oneofEmpty" - in: "query" - required: false - type: "object" - x-exportParamName: "OneofEmpty" - - name: "oneofString" - in: "query" - required: false - type: "string" - x-exportParamName: "OneofString" - x-optionalDataType: "String" - - name: "mapValue" - in: "query" - description: "map of numeric enum" - required: false - x-exportParamName: "MapValue" - - name: "mappedStringValue" - in: "query" - description: "Map of string title\n\nMap of string description." - required: false - type: "string" - x-exportParamName: "MappedStringValue" - x-optionalDataType: "String" - - name: "mappedNestedValue" - in: "query" - required: false - x-exportParamName: "MappedNestedValue" - - name: "nonConventionalNameValue" - in: "query" - required: false - type: "string" - x-exportParamName: "NonConventionalNameValue" - x-optionalDataType: "String" - - name: "timestampValue" - in: "query" - required: false - type: "string" - format: "date-time" - x-exportParamName: "TimestampValue" - x-optionalDataType: "Time" - - name: "repeatedEnumValue" - in: "query" - description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" + - name: floatValue + in: query + description: Float value field + required: true + style: form + explode: true + schema: + type: number + format: float + default: 0.2 + - name: doubleValue + in: query + required: true + style: form + explode: true + schema: + type: number + format: double + - name: int64Value + in: query + required: true + style: form + explode: true + schema: + type: string + format: int64 + - name: uint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: int32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: fixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: fixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: boolValue + in: query + required: false + style: form + explode: true + schema: + type: boolean + - name: stringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: bytesValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: byte + - name: uint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: enumValue + in: query + description: |2- + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumValue" - - name: "repeatedEnumAnnotation" - in: "query" - description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ - \n - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" + - ZERO + - ONE + default: ZERO + - name: pathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumAnnotation" - - name: "enumValueAnnotation" - in: "query" - description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValueAnnotation" - x-optionalDataType: "String" - - name: "repeatedStringAnnotation" - in: "query" - description: "Repeated string title\n\nRepeated string description." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringAnnotation" - - name: "nestedAnnotation.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "NestedAnnotationName" - x-optionalDataType: "String" - - name: "nestedAnnotation.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "NestedAnnotationAmount" - x-optionalDataType: "Int64" - - name: "int64OverrideType" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Int64OverrideType" - x-optionalDataType: "Int64" - - name: "requiredStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as required in Open API definition" - required: true - type: "string" - x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" - - name: "outputOnlyStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as readonly in Open API definition" - required: false - type: "string" - x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" - x-optionalDataType: "String" - - name: "optionalStringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "OptionalStringValue" - x-optionalDataType: "String" - - name: "productId" - in: "query" - description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ - \ are allowed." - required: false - type: "array" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - collectionFormat: "multi" - x-exportParamName: "ProductId" - - name: "optionalStringField" - in: "query" - description: "Test openapiv2 generation of required fields with annotation\ - \ and jsonschema to reproduce" - required: false - type: "string" - x-exportParamName: "OptionalStringField" - x-optionalDataType: "String" - - name: "requiredStringField1" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField1" - - name: "requiredStringField2" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField2" - - name: "required_field_behavior_json_name_custom" - in: "query" - description: "Test openapiv2 handling of required json_name fields" - required: true - type: "string" - x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" - - name: "required_field_schema_json_name_custom" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredFieldSchemaJsonNameCustom" - - name: "trailingOnly" - in: "query" - description: "Trailing only" - required: false - type: "string" - x-exportParamName: "TrailingOnly" - x-optionalDataType: "String" - - name: "trailingOnlyDot" - in: "query" - description: "Trailing only dot." - required: false - type: "string" - x-exportParamName: "TrailingOnlyDot" - x-optionalDataType: "String" - - name: "trailingBoth" - in: "query" - description: "Leading both\n\nTrailing both." - required: false - type: "string" - x-exportParamName: "TrailingBoth" - x-optionalDataType: "String" - - name: "trailingMultiline" - in: "query" - description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ - \nTrailing multiline." - required: false - type: "string" - x-exportParamName: "TrailingMultiline" - x-optionalDataType: "String" - - name: "uuids" - in: "query" - description: "Specify a custom format of repeated field items" - required: false - type: "array" - items: - type: "string" - format: "uuid" - collectionFormat: "multi" - x-exportParamName: "Uuids" - responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverything" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" - default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - /v1/example/a_bit_of_everything/params/get/{singleNested.name}: - get: - tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_CheckGetQueryParams" - parameters: - - name: "singleNested.name" - in: "path" - description: "name is nested field." - required: true - type: "string" - x-exportParamName: "SingleNestedName" - - name: "singleNested.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "SingleNestedAmount" - x-optionalDataType: "Int64" - - name: "singleNested.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "SingleNestedOk" - x-optionalDataType: "String" - - name: "uuid" - in: "query" - required: true - type: "string" - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - format: "uuid" - x-internal: true - x-exportParamName: "Uuid" - - name: "floatValue" - in: "query" - description: "Float value field" - required: true - type: "number" - default: 0.2 - format: "float" - x-exportParamName: "FloatValue" - - name: "doubleValue" - in: "query" - required: true - type: "number" - format: "double" - x-exportParamName: "DoubleValue" - - name: "int64Value" - in: "query" - required: true - type: "string" - format: "int64" - x-exportParamName: "Int64Value" - - name: "uint64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Uint64Value" - x-optionalDataType: "String" - - name: "int32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Int32Value" - x-optionalDataType: "Int32" - - name: "fixed64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Fixed64Value" - x-optionalDataType: "String" - - name: "fixed32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Fixed32Value" - x-optionalDataType: "Int64" - - name: "boolValue" - in: "query" - required: false - type: "boolean" - x-exportParamName: "BoolValue" - x-optionalDataType: "Bool" - - name: "stringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "StringValue" - x-optionalDataType: "String" - - name: "bytesValue" - in: "query" - required: false - type: "string" - format: "byte" - x-exportParamName: "BytesValue" - x-optionalDataType: "String" - - name: "uint32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Uint32Value" - x-optionalDataType: "Int64" - - name: "enumValue" - in: "query" - description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValue" - x-optionalDataType: "String" - - name: "pathEnumValue" - in: "query" - required: false - type: "string" - default: "ABC" - enum: - - "ABC" - - "DEF" - x-exportParamName: "PathEnumValue" - x-optionalDataType: "String" - - name: "nestedPathEnumValue" - in: "query" - required: false - type: "string" - default: "GHI" - enum: - - "GHI" - - "JKL" - x-exportParamName: "NestedPathEnumValue" - x-optionalDataType: "String" - - name: "sfixed32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sfixed32Value" - x-optionalDataType: "Int32" - - name: "sfixed64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sfixed64Value" - x-optionalDataType: "String" - - name: "sint32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sint32Value" - x-optionalDataType: "Int32" - - name: "sint64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sint64Value" - x-optionalDataType: "String" - - name: "repeatedStringValue" - in: "query" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringValue" - - name: "oneofEmpty" - in: "query" - required: false - type: "object" - x-exportParamName: "OneofEmpty" - - name: "oneofString" - in: "query" - required: false - type: "string" - x-exportParamName: "OneofString" - x-optionalDataType: "String" - - name: "mapValue" - in: "query" - description: "map of numeric enum" - required: false - x-exportParamName: "MapValue" - - name: "mappedStringValue" - in: "query" - description: "Map of string title\n\nMap of string description." - required: false - type: "string" - x-exportParamName: "MappedStringValue" - x-optionalDataType: "String" - - name: "mappedNestedValue" - in: "query" - required: false - x-exportParamName: "MappedNestedValue" - - name: "nonConventionalNameValue" - in: "query" - required: false - type: "string" - x-exportParamName: "NonConventionalNameValue" - x-optionalDataType: "String" - - name: "timestampValue" - in: "query" - required: false - type: "string" - format: "date-time" - x-exportParamName: "TimestampValue" - x-optionalDataType: "Time" - - name: "repeatedEnumValue" - in: "query" - description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" + - ABC + - DEF + default: ABC + - name: nestedPathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumValue" - - name: "repeatedEnumAnnotation" - in: "query" - description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ - \n - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" + - GHI + - JKL + default: GHI + - name: sfixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sfixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: sint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: repeatedStringValue + in: query + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: oneofEmpty + in: query + required: false + style: form + explode: true + schema: + type: object + - name: oneofString + in: query + required: false + style: form + explode: true + schema: + type: string + - name: mapValue + in: query + description: map of numeric enum + required: false + style: form + explode: true + schema: {} + - name: mappedStringValue + in: query + description: |- + Map of string title + + Map of string description. + required: false + style: form + explode: true + schema: + type: string + - name: mappedNestedValue + in: query + required: false + style: form + explode: true + schema: {} + - name: nonConventionalNameValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: timestampValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: repeatedEnumValue + in: query + description: |- + repeated enum value. it is comma-separated in query + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedEnumAnnotation + in: query + description: |- + Repeated numeric enum title + + Repeated numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: enumValueAnnotation + in: query + description: |- + Numeric enum title + + Numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumAnnotation" - - name: "enumValueAnnotation" - in: "query" - description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValueAnnotation" - x-optionalDataType: "String" - - name: "repeatedStringAnnotation" - in: "query" - description: "Repeated string title\n\nRepeated string description." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringAnnotation" - - name: "nestedAnnotation.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "NestedAnnotationAmount" - x-optionalDataType: "Int64" - - name: "nestedAnnotation.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "NestedAnnotationOk" - x-optionalDataType: "String" - - name: "int64OverrideType" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Int64OverrideType" - x-optionalDataType: "Int64" - - name: "requiredStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as required in Open API definition" - required: true - type: "string" - x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" - - name: "outputOnlyStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as readonly in Open API definition" - required: false - type: "string" - x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" - x-optionalDataType: "String" - - name: "optionalStringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "OptionalStringValue" - x-optionalDataType: "String" - - name: "productId" - in: "query" - description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ - \ are allowed." - required: false - type: "array" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - collectionFormat: "multi" - x-exportParamName: "ProductId" - - name: "optionalStringField" - in: "query" - description: "Test openapiv2 generation of required fields with annotation\ - \ and jsonschema to reproduce" - required: false - type: "string" - x-exportParamName: "OptionalStringField" - x-optionalDataType: "String" - - name: "requiredStringField1" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField1" - - name: "requiredStringField2" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField2" - - name: "required_field_behavior_json_name_custom" - in: "query" - description: "Test openapiv2 handling of required json_name fields" - required: true - type: "string" - x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" - - name: "required_field_schema_json_name_custom" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredFieldSchemaJsonNameCustom" - - name: "trailingOnly" - in: "query" - description: "Trailing only" - required: false - type: "string" - x-exportParamName: "TrailingOnly" - x-optionalDataType: "String" - - name: "trailingOnlyDot" - in: "query" - description: "Trailing only dot." - required: false - type: "string" - x-exportParamName: "TrailingOnlyDot" - x-optionalDataType: "String" - - name: "trailingBoth" - in: "query" - description: "Leading both\n\nTrailing both." - required: false - type: "string" - x-exportParamName: "TrailingBoth" - x-optionalDataType: "String" - - name: "trailingMultiline" - in: "query" - description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ - \nTrailing multiline." - required: false - type: "string" - x-exportParamName: "TrailingMultiline" - x-optionalDataType: "String" - - name: "uuids" - in: "query" - description: "Specify a custom format of repeated field items" - required: false - type: "array" - items: - type: "string" - format: "uuid" - collectionFormat: "multi" - x-exportParamName: "Uuids" - responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverything" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" - default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - /v1/example/a_bit_of_everything/params/post/{stringValue}: - post: - tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_CheckPostQueryParams" - parameters: - - name: "stringValue" - in: "path" + - ZERO + - ONE + default: ZERO + - name: repeatedStringAnnotation + in: query + description: |- + Repeated string title + + Repeated string description. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: nestedAnnotation.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: nestedAnnotation.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: int64OverrideType + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: requiredStringViaFieldBehaviorAnnotation + in: query + description: mark a field as required in Open API definition + required: true + style: form + explode: true + schema: + type: string + - name: outputOnlyStringViaFieldBehaviorAnnotation + in: query + description: mark a field as readonly in Open API definition + required: false + style: form + explode: true + schema: + type: string + - name: optionalStringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: productId + in: query + description: |- + Test openapiv2 generation of repeated fields + + Only digits are allowed. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + - name: optionalStringField + in: query + description: Test openapiv2 generation of required fields with annotation + and jsonschema to reproduce + required: false + style: form + explode: true + schema: + type: string + - name: requiredStringField1 + in: query required: true - type: "string" - x-exportParamName: "StringValue" - - in: "body" - name: "singleNested" + style: form + explode: true + schema: + type: string + - name: requiredStringField2 + in: query required: true + style: form + explode: true schema: - $ref: "#/definitions/ABitOfEverythingNested" - x-exportParamName: "SingleNested" - - name: "uuid" - in: "query" + type: string + - name: required_field_behavior_json_name_custom + in: query + description: Test openapiv2 handling of required json_name fields required: true - type: "string" - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - format: "uuid" - x-internal: true - x-exportParamName: "Uuid" - - name: "floatValue" - in: "query" - description: "Float value field" - required: true - type: "number" - default: 0.2 - format: "float" - x-exportParamName: "FloatValue" - - name: "doubleValue" - in: "query" - required: true - type: "number" - format: "double" - x-exportParamName: "DoubleValue" - - name: "int64Value" - in: "query" - required: true - type: "string" - format: "int64" - x-exportParamName: "Int64Value" - - name: "uint64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Uint64Value" - x-optionalDataType: "String" - - name: "int32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Int32Value" - x-optionalDataType: "Int32" - - name: "fixed64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Fixed64Value" - x-optionalDataType: "String" - - name: "fixed32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Fixed32Value" - x-optionalDataType: "Int64" - - name: "boolValue" - in: "query" - required: false - type: "boolean" - x-exportParamName: "BoolValue" - x-optionalDataType: "Bool" - - name: "bytesValue" - in: "query" - required: false - type: "string" - format: "byte" - x-exportParamName: "BytesValue" - x-optionalDataType: "String" - - name: "uint32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Uint32Value" - x-optionalDataType: "Int64" - - name: "enumValue" - in: "query" - description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValue" - x-optionalDataType: "String" - - name: "pathEnumValue" - in: "query" - required: false - type: "string" - default: "ABC" - enum: - - "ABC" - - "DEF" - x-exportParamName: "PathEnumValue" - x-optionalDataType: "String" - - name: "nestedPathEnumValue" - in: "query" - required: false - type: "string" - default: "GHI" - enum: - - "GHI" - - "JKL" - x-exportParamName: "NestedPathEnumValue" - x-optionalDataType: "String" - - name: "sfixed32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sfixed32Value" - x-optionalDataType: "Int32" - - name: "sfixed64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sfixed64Value" - x-optionalDataType: "String" - - name: "sint32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sint32Value" - x-optionalDataType: "Int32" - - name: "sint64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sint64Value" - x-optionalDataType: "String" - - name: "repeatedStringValue" - in: "query" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringValue" - - name: "oneofEmpty" - in: "query" - required: false - type: "object" - x-exportParamName: "OneofEmpty" - - name: "oneofString" - in: "query" - required: false - type: "string" - x-exportParamName: "OneofString" - x-optionalDataType: "String" - - name: "mapValue" - in: "query" - description: "map of numeric enum" - required: false - x-exportParamName: "MapValue" - - name: "mappedStringValue" - in: "query" - description: "Map of string title\n\nMap of string description." - required: false - type: "string" - x-exportParamName: "MappedStringValue" - x-optionalDataType: "String" - - name: "mappedNestedValue" - in: "query" - required: false - x-exportParamName: "MappedNestedValue" - - name: "nonConventionalNameValue" - in: "query" - required: false - type: "string" - x-exportParamName: "NonConventionalNameValue" - x-optionalDataType: "String" - - name: "timestampValue" - in: "query" - required: false - type: "string" - format: "date-time" - x-exportParamName: "TimestampValue" - x-optionalDataType: "Time" - - name: "repeatedEnumValue" - in: "query" - description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumValue" - - name: "repeatedEnumAnnotation" - in: "query" - description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ - \n - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumAnnotation" - - name: "enumValueAnnotation" - in: "query" - description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValueAnnotation" - x-optionalDataType: "String" - - name: "repeatedStringAnnotation" - in: "query" - description: "Repeated string title\n\nRepeated string description." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringAnnotation" - - name: "nestedAnnotation.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "NestedAnnotationName" - x-optionalDataType: "String" - - name: "nestedAnnotation.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "NestedAnnotationAmount" - x-optionalDataType: "Int64" - - name: "nestedAnnotation.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "NestedAnnotationOk" - x-optionalDataType: "String" - - name: "int64OverrideType" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Int64OverrideType" - x-optionalDataType: "Int64" - - name: "requiredStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as required in Open API definition" - required: true - type: "string" - x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" - - name: "outputOnlyStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as readonly in Open API definition" - required: false - type: "string" - x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" - x-optionalDataType: "String" - - name: "optionalStringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "OptionalStringValue" - x-optionalDataType: "String" - - name: "productId" - in: "query" - description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ - \ are allowed." - required: false - type: "array" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - collectionFormat: "multi" - x-exportParamName: "ProductId" - - name: "optionalStringField" - in: "query" - description: "Test openapiv2 generation of required fields with annotation\ - \ and jsonschema to reproduce" - required: false - type: "string" - x-exportParamName: "OptionalStringField" - x-optionalDataType: "String" - - name: "requiredStringField1" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField1" - - name: "requiredStringField2" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField2" - - name: "required_field_behavior_json_name_custom" - in: "query" - description: "Test openapiv2 handling of required json_name fields" - required: true - type: "string" - x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" - - name: "required_field_schema_json_name_custom" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredFieldSchemaJsonNameCustom" - - name: "trailingOnly" - in: "query" - description: "Trailing only" - required: false - type: "string" - x-exportParamName: "TrailingOnly" - x-optionalDataType: "String" - - name: "trailingOnlyDot" - in: "query" - description: "Trailing only dot." - required: false - type: "string" - x-exportParamName: "TrailingOnlyDot" - x-optionalDataType: "String" - - name: "trailingBoth" - in: "query" - description: "Leading both\n\nTrailing both." - required: false - type: "string" - x-exportParamName: "TrailingBoth" - x-optionalDataType: "String" - - name: "trailingMultiline" - in: "query" - description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ - \nTrailing multiline." - required: false - type: "string" - x-exportParamName: "TrailingMultiline" - x-optionalDataType: "String" - - name: "uuids" - in: "query" - description: "Specify a custom format of repeated field items" - required: false - type: "array" - items: - type: "string" - format: "uuid" - collectionFormat: "multi" - x-exportParamName: "Uuids" + style: form + explode: true + schema: + type: string + - name: required_field_schema_json_name_custom + in: query + required: true + style: form + explode: true + schema: + type: string + - name: trailingOnly + in: query + description: Trailing only + required: false + style: form + explode: true + schema: + type: string + - name: trailingOnlyDot + in: query + description: Trailing only dot. + required: false + style: form + explode: true + schema: + type: string + - name: trailingBoth + in: query + description: |- + Leading both + + Trailing both. + required: false + style: form + explode: true + schema: + type: string + - name: trailingMultiline + in: query + description: |- + Leading multiline + + This is an example of a multi-line comment. + + Trailing multiline. + required: false + style: form + explode: true + schema: + type: string + - name: uuids + in: query + description: Specify a custom format of repeated field items + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverything" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - /v1/example/a_bit_of_everything/query/{uuidName}: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + /v1/example/a_bit_of_everything/params/get/{singleNested.name}: get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_GetQuery" + - ABitOfEverything + operationId: ABitOfEverythingService_CheckGetQueryParams parameters: - - name: "uuidName" - in: "path" + - name: singleNested.name + in: path + description: name is nested field. required: true - type: "string" - format: "uuid" - x-internal: true - x-exportParamName: "UuidName" - - name: "singleNested.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "SingleNestedName" - x-optionalDataType: "String" - - name: "singleNested.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "SingleNestedAmount" - x-optionalDataType: "Int64" - - name: "singleNested.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "SingleNestedOk" - x-optionalDataType: "String" - - name: "floatValue" - in: "query" - description: "Float value field" - required: true - type: "number" - default: 0.2 - format: "float" - x-exportParamName: "FloatValue" - - name: "doubleValue" - in: "query" - required: true - type: "number" - format: "double" - x-exportParamName: "DoubleValue" - - name: "int64Value" - in: "query" - required: true - type: "string" - format: "int64" - x-exportParamName: "Int64Value" - - name: "uint64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Uint64Value" - x-optionalDataType: "String" - - name: "int32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Int32Value" - x-optionalDataType: "Int32" - - name: "fixed64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Fixed64Value" - x-optionalDataType: "String" - - name: "fixed32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Fixed32Value" - x-optionalDataType: "Int64" - - name: "boolValue" - in: "query" - required: false - type: "boolean" - x-exportParamName: "BoolValue" - x-optionalDataType: "Bool" - - name: "stringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "StringValue" - x-optionalDataType: "String" - - name: "bytesValue" - in: "query" - required: false - type: "string" - format: "byte" - x-exportParamName: "BytesValue" - x-optionalDataType: "String" - - name: "uint32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Uint32Value" - x-optionalDataType: "Int64" - - name: "enumValue" - in: "query" - description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValue" - x-optionalDataType: "String" - - name: "pathEnumValue" - in: "query" - required: false - type: "string" - default: "ABC" - enum: - - "ABC" - - "DEF" - x-exportParamName: "PathEnumValue" - x-optionalDataType: "String" - - name: "nestedPathEnumValue" - in: "query" - required: false - type: "string" - default: "GHI" - enum: - - "GHI" - - "JKL" - x-exportParamName: "NestedPathEnumValue" - x-optionalDataType: "String" - - name: "sfixed32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sfixed32Value" - x-optionalDataType: "Int32" - - name: "sfixed64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sfixed64Value" - x-optionalDataType: "String" - - name: "sint32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sint32Value" - x-optionalDataType: "Int32" - - name: "sint64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sint64Value" - x-optionalDataType: "String" - - name: "repeatedStringValue" - in: "query" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringValue" - - name: "oneofEmpty" - in: "query" - required: false - type: "object" - x-exportParamName: "OneofEmpty" - - name: "oneofString" - in: "query" - required: false - type: "string" - x-exportParamName: "OneofString" - x-optionalDataType: "String" - - name: "mapValue" - in: "query" - description: "map of numeric enum" - required: false - x-exportParamName: "MapValue" - - name: "mappedStringValue" - in: "query" - description: "Map of string title\n\nMap of string description." - required: false - type: "string" - x-exportParamName: "MappedStringValue" - x-optionalDataType: "String" - - name: "mappedNestedValue" - in: "query" - required: false - x-exportParamName: "MappedNestedValue" - - name: "nonConventionalNameValue" - in: "query" - required: false - type: "string" - x-exportParamName: "NonConventionalNameValue" - x-optionalDataType: "String" - - name: "timestampValue" - in: "query" - required: false - type: "string" - format: "date-time" - x-exportParamName: "TimestampValue" - x-optionalDataType: "Time" - - name: "repeatedEnumValue" - in: "query" - description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumValue" - - name: "repeatedEnumAnnotation" - in: "query" - description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ - \n - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" + style: simple + explode: false + schema: + type: string + - name: singleNested.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: singleNested.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumAnnotation" - - name: "enumValueAnnotation" - in: "query" - description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValueAnnotation" - x-optionalDataType: "String" - - name: "repeatedStringAnnotation" - in: "query" - description: "Repeated string title\n\nRepeated string description." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringAnnotation" - - name: "nestedAnnotation.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "NestedAnnotationName" - x-optionalDataType: "String" - - name: "nestedAnnotation.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "NestedAnnotationAmount" - x-optionalDataType: "Int64" - - name: "nestedAnnotation.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "NestedAnnotationOk" - x-optionalDataType: "String" - - name: "int64OverrideType" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Int64OverrideType" - x-optionalDataType: "Int64" - - name: "requiredStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as required in Open API definition" - required: true - type: "string" - x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" - - name: "outputOnlyStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as readonly in Open API definition" - required: false - type: "string" - x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" - x-optionalDataType: "String" - - name: "optionalStringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "OptionalStringValue" - x-optionalDataType: "String" - - name: "productId" - in: "query" - description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ - \ are allowed." - required: false - type: "array" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - collectionFormat: "multi" - x-exportParamName: "ProductId" - - name: "optionalStringField" - in: "query" - description: "Test openapiv2 generation of required fields with annotation\ - \ and jsonschema to reproduce" - required: false - type: "string" - x-exportParamName: "OptionalStringField" - x-optionalDataType: "String" - - name: "requiredStringField1" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField1" - - name: "requiredStringField2" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField2" - - name: "required_field_behavior_json_name_custom" - in: "query" - description: "Test openapiv2 handling of required json_name fields" - required: true - type: "string" - x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" - - name: "required_field_schema_json_name_custom" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredFieldSchemaJsonNameCustom" - - name: "trailingOnly" - in: "query" - description: "Trailing only" - required: false - type: "string" - x-exportParamName: "TrailingOnly" - x-optionalDataType: "String" - - name: "trailingOnlyDot" - in: "query" - description: "Trailing only dot." - required: false - type: "string" - x-exportParamName: "TrailingOnlyDot" - x-optionalDataType: "String" - - name: "trailingBoth" - in: "query" - description: "Leading both\n\nTrailing both." - required: false - type: "string" - x-exportParamName: "TrailingBoth" - x-optionalDataType: "String" - - name: "trailingMultiline" - in: "query" - description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ - \nTrailing multiline." - required: false - type: "string" - x-exportParamName: "TrailingMultiline" - x-optionalDataType: "String" - - name: "uuids" - in: "query" - description: "Specify a custom format of repeated field items" - required: false - type: "array" - items: - type: "string" - format: "uuid" - collectionFormat: "multi" - x-exportParamName: "Uuids" - responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" - default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - security: [] - externalDocs: - description: "Find out more about GetQuery" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - deprecated: true - ? /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation} - : post: - tags: - - "ABitOfEverything" - summary: "Create a new ABitOfEverything" - description: "This API creates a new ABitOfEverything" - operationId: "ABitOfEverythingService_Create" - parameters: - - name: "floatValue" - in: "path" - description: "Float value field" - required: true - type: "number" - default: 0.2 - format: "float" - x-exportParamName: "FloatValue" - - name: "doubleValue" - in: "path" - required: true - type: "number" - format: "double" - x-exportParamName: "DoubleValue" - - name: "int64Value" - in: "path" - required: true - type: "string" - format: "int64" - x-exportParamName: "Int64Value" - - name: "uint64Value" - in: "path" - required: true - type: "string" - format: "uint64" - x-exportParamName: "Uint64Value" - - name: "int32Value" - in: "path" - required: true - type: "integer" - format: "int32" - x-exportParamName: "Int32Value" - - name: "fixed64Value" - in: "path" - required: true - type: "string" - format: "uint64" - x-exportParamName: "Fixed64Value" - - name: "fixed32Value" - in: "path" - required: true - type: "integer" - format: "int64" - x-exportParamName: "Fixed32Value" - - name: "boolValue" - in: "path" - required: true - type: "boolean" - x-exportParamName: "BoolValue" - - name: "stringValue" - in: "path" - required: true - type: "string" - pattern: "strprefix/[^/]+" - x-exportParamName: "StringValue" - - name: "uint32Value" - in: "path" - required: true - type: "integer" - format: "int64" - x-exportParamName: "Uint32Value" - - name: "sfixed32Value" - in: "path" - required: true - type: "integer" - format: "int32" - x-exportParamName: "Sfixed32Value" - - name: "sfixed64Value" - in: "path" - required: true - type: "string" - format: "int64" - x-exportParamName: "Sfixed64Value" - - name: "sint32Value" - in: "path" - required: true - type: "integer" - format: "int32" - x-exportParamName: "Sint32Value" - - name: "sint64Value" - in: "path" - required: true - type: "string" - format: "int64" - x-exportParamName: "Sint64Value" - - name: "nonConventionalNameValue" - in: "path" - required: true - type: "string" - x-exportParamName: "NonConventionalNameValue" - - name: "enumValue" - in: "path" - required: true - type: "string" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValue" - - name: "pathEnumValue" - in: "path" - required: true - type: "string" - enum: - - "ABC" - - "DEF" - x-exportParamName: "PathEnumValue" - - name: "nestedPathEnumValue" - in: "path" - required: true - type: "string" - enum: - - "GHI" - - "JKL" - x-exportParamName: "NestedPathEnumValue" - - name: "enumValueAnnotation" - in: "path" - description: "Numeric enum description." - required: true - type: "string" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValueAnnotation" - - name: "singleNested.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "SingleNestedName" - x-optionalDataType: "String" - - name: "singleNested.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "SingleNestedAmount" - x-optionalDataType: "Int64" - - name: "singleNested.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "SingleNestedOk" - x-optionalDataType: "String" - - name: "uuid" - in: "query" - required: true - type: "string" - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - format: "uuid" + - "FALSE" + - "TRUE" + default: "FALSE" + - name: uuid + in: query + required: true + style: form + explode: true + schema: + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + type: string + format: uuid + x-internal: true x-internal: true - x-exportParamName: "Uuid" - - name: "bytesValue" - in: "query" - required: false - type: "string" - format: "byte" - x-exportParamName: "BytesValue" - x-optionalDataType: "String" - - name: "repeatedStringValue" - in: "query" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringValue" - - name: "oneofEmpty" - in: "query" - required: false - type: "object" - x-exportParamName: "OneofEmpty" - - name: "oneofString" - in: "query" - required: false - type: "string" - x-exportParamName: "OneofString" - x-optionalDataType: "String" - - name: "mapValue" - in: "query" - description: "map of numeric enum" - required: false - x-exportParamName: "MapValue" - - name: "mappedStringValue" - in: "query" - description: "Map of string title\n\nMap of string description." - required: false - type: "string" - x-exportParamName: "MappedStringValue" - x-optionalDataType: "String" - - name: "mappedNestedValue" - in: "query" - required: false - x-exportParamName: "MappedNestedValue" - - name: "timestampValue" - in: "query" - required: false - type: "string" - format: "date-time" - x-exportParamName: "TimestampValue" - x-optionalDataType: "Time" - - name: "repeatedEnumValue" - in: "query" - description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" + - name: floatValue + in: query + description: Float value field + required: true + style: form + explode: true + schema: + type: number + format: float + default: 0.2 + - name: doubleValue + in: query + required: true + style: form + explode: true + schema: + type: number + format: double + - name: int64Value + in: query + required: true + style: form + explode: true + schema: + type: string + format: int64 + - name: uint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: int32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: fixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: fixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: boolValue + in: query + required: false + style: form + explode: true + schema: + type: boolean + - name: stringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: bytesValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: byte + - name: uint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: enumValue + in: query + description: |2- + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumValue" - - name: "repeatedEnumAnnotation" - in: "query" - description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ - \n - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" + - ZERO + - ONE + default: ZERO + - name: pathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumAnnotation" - - name: "repeatedStringAnnotation" - in: "query" - description: "Repeated string title\n\nRepeated string description." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringAnnotation" - - name: "nestedAnnotation.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "NestedAnnotationName" - x-optionalDataType: "String" - - name: "nestedAnnotation.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "NestedAnnotationAmount" - x-optionalDataType: "Int64" - - name: "nestedAnnotation.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "NestedAnnotationOk" - x-optionalDataType: "String" - - name: "int64OverrideType" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Int64OverrideType" - x-optionalDataType: "Int64" - - name: "requiredStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as required in Open API definition" - required: true - type: "string" - x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" - - name: "outputOnlyStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as readonly in Open API definition" - required: false - type: "string" - x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" - x-optionalDataType: "String" - - name: "optionalStringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "OptionalStringValue" - x-optionalDataType: "String" - - name: "productId" - in: "query" - description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ - \ are allowed." - required: false - type: "array" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - collectionFormat: "multi" - x-exportParamName: "ProductId" - - name: "optionalStringField" - in: "query" - description: "Test openapiv2 generation of required fields with annotation\ - \ and jsonschema to reproduce" - required: false - type: "string" - x-exportParamName: "OptionalStringField" - x-optionalDataType: "String" - - name: "requiredStringField1" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField1" - - name: "requiredStringField2" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField2" - - name: "required_field_behavior_json_name_custom" - in: "query" - description: "Test openapiv2 handling of required json_name fields" - required: true - type: "string" - x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" - - name: "required_field_schema_json_name_custom" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredFieldSchemaJsonNameCustom" - - name: "trailingOnly" - in: "query" - description: "Trailing only" - required: false - type: "string" - x-exportParamName: "TrailingOnly" - x-optionalDataType: "String" - - name: "trailingOnlyDot" - in: "query" - description: "Trailing only dot." - required: false - type: "string" - x-exportParamName: "TrailingOnlyDot" - x-optionalDataType: "String" - - name: "trailingBoth" - in: "query" - description: "Leading both\n\nTrailing both." - required: false - type: "string" - x-exportParamName: "TrailingBoth" - x-optionalDataType: "String" - - name: "trailingMultiline" - in: "query" - description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ - \nTrailing multiline." - required: false - type: "string" - x-exportParamName: "TrailingMultiline" - x-optionalDataType: "String" - - name: "uuids" - in: "query" - description: "Specify a custom format of repeated field items" - required: false - type: "array" - items: - type: "string" - format: "uuid" - collectionFormat: "multi" - x-exportParamName: "Uuids" - responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverything" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" - default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - /v1/example/a_bit_of_everything/{uuidName}: - head: - tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_Exists" - parameters: - - name: "uuidName" - in: "path" - required: true - type: "string" - format: "uuid" - x-internal: true - x-exportParamName: "UuidName" - - name: "singleNested.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "SingleNestedName" - x-optionalDataType: "String" - - name: "singleNested.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "SingleNestedAmount" - x-optionalDataType: "Int64" - - name: "singleNested.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "SingleNestedOk" - x-optionalDataType: "String" - - name: "floatValue" - in: "query" - description: "Float value field" - required: true - type: "number" - default: 0.2 - format: "float" - x-exportParamName: "FloatValue" - - name: "doubleValue" - in: "query" - required: true - type: "number" - format: "double" - x-exportParamName: "DoubleValue" - - name: "int64Value" - in: "query" - required: true - type: "string" - format: "int64" - x-exportParamName: "Int64Value" - - name: "uint64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Uint64Value" - x-optionalDataType: "String" - - name: "int32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Int32Value" - x-optionalDataType: "Int32" - - name: "fixed64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Fixed64Value" - x-optionalDataType: "String" - - name: "fixed32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Fixed32Value" - x-optionalDataType: "Int64" - - name: "boolValue" - in: "query" - required: false - type: "boolean" - x-exportParamName: "BoolValue" - x-optionalDataType: "Bool" - - name: "stringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "StringValue" - x-optionalDataType: "String" - - name: "bytesValue" - in: "query" - required: false - type: "string" - format: "byte" - x-exportParamName: "BytesValue" - x-optionalDataType: "String" - - name: "uint32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Uint32Value" - x-optionalDataType: "Int64" - - name: "enumValue" - in: "query" - description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValue" - x-optionalDataType: "String" - - name: "pathEnumValue" - in: "query" - required: false - type: "string" - default: "ABC" - enum: - - "ABC" - - "DEF" - x-exportParamName: "PathEnumValue" - x-optionalDataType: "String" - - name: "nestedPathEnumValue" - in: "query" - required: false - type: "string" - default: "GHI" - enum: - - "GHI" - - "JKL" - x-exportParamName: "NestedPathEnumValue" - x-optionalDataType: "String" - - name: "sfixed32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sfixed32Value" - x-optionalDataType: "Int32" - - name: "sfixed64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sfixed64Value" - x-optionalDataType: "String" - - name: "sint32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sint32Value" - x-optionalDataType: "Int32" - - name: "sint64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sint64Value" - x-optionalDataType: "String" - - name: "repeatedStringValue" - in: "query" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringValue" - - name: "oneofEmpty" - in: "query" - required: false - type: "object" - x-exportParamName: "OneofEmpty" - - name: "oneofString" - in: "query" - required: false - type: "string" - x-exportParamName: "OneofString" - x-optionalDataType: "String" - - name: "mapValue" - in: "query" - description: "map of numeric enum" - required: false - x-exportParamName: "MapValue" - - name: "mappedStringValue" - in: "query" - description: "Map of string title\n\nMap of string description." - required: false - type: "string" - x-exportParamName: "MappedStringValue" - x-optionalDataType: "String" - - name: "mappedNestedValue" - in: "query" - required: false - x-exportParamName: "MappedNestedValue" - - name: "nonConventionalNameValue" - in: "query" - required: false - type: "string" - x-exportParamName: "NonConventionalNameValue" - x-optionalDataType: "String" - - name: "timestampValue" - in: "query" - required: false - type: "string" - format: "date-time" - x-exportParamName: "TimestampValue" - x-optionalDataType: "Time" - - name: "repeatedEnumValue" - in: "query" - description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" + - ABC + - DEF + default: ABC + - name: nestedPathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - GHI + - JKL + default: GHI + - name: sfixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sfixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: sint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: repeatedStringValue + in: query + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: oneofEmpty + in: query + required: false + style: form + explode: true + schema: + type: object + - name: oneofString + in: query + required: false + style: form + explode: true + schema: + type: string + - name: mapValue + in: query + description: map of numeric enum + required: false + style: form + explode: true + schema: {} + - name: mappedStringValue + in: query + description: |- + Map of string title + + Map of string description. + required: false + style: form + explode: true + schema: + type: string + - name: mappedNestedValue + in: query + required: false + style: form + explode: true + schema: {} + - name: nonConventionalNameValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: timestampValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: repeatedEnumValue + in: query + description: |- + repeated enum value. it is comma-separated in query + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedEnumAnnotation + in: query + description: |- + Repeated numeric enum title + + Repeated numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: enumValueAnnotation + in: query + description: |- + Numeric enum title + + Numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumValue" - - name: "repeatedEnumAnnotation" - in: "query" - description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ - \n - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" + - ZERO + - ONE + default: ZERO + - name: repeatedStringAnnotation + in: query + description: |- + Repeated string title + + Repeated string description. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: nestedAnnotation.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: nestedAnnotation.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumAnnotation" - - name: "enumValueAnnotation" - in: "query" - description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValueAnnotation" - x-optionalDataType: "String" - - name: "repeatedStringAnnotation" - in: "query" - description: "Repeated string title\n\nRepeated string description." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringAnnotation" - - name: "nestedAnnotation.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "NestedAnnotationName" - x-optionalDataType: "String" - - name: "nestedAnnotation.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "NestedAnnotationAmount" - x-optionalDataType: "Int64" - - name: "nestedAnnotation.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "NestedAnnotationOk" - x-optionalDataType: "String" - - name: "int64OverrideType" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Int64OverrideType" - x-optionalDataType: "Int64" - - name: "requiredStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as required in Open API definition" - required: true - type: "string" - x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" - - name: "outputOnlyStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as readonly in Open API definition" - required: false - type: "string" - x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" - x-optionalDataType: "String" - - name: "optionalStringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "OptionalStringValue" - x-optionalDataType: "String" - - name: "productId" - in: "query" - description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ - \ are allowed." - required: false - type: "array" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - collectionFormat: "multi" - x-exportParamName: "ProductId" - - name: "optionalStringField" - in: "query" - description: "Test openapiv2 generation of required fields with annotation\ - \ and jsonschema to reproduce" - required: false - type: "string" - x-exportParamName: "OptionalStringField" - x-optionalDataType: "String" - - name: "requiredStringField1" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField1" - - name: "requiredStringField2" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField2" - - name: "required_field_behavior_json_name_custom" - in: "query" - description: "Test openapiv2 handling of required json_name fields" - required: true - type: "string" - x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" - - name: "required_field_schema_json_name_custom" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredFieldSchemaJsonNameCustom" - - name: "trailingOnly" - in: "query" - description: "Trailing only" - required: false - type: "string" - x-exportParamName: "TrailingOnly" - x-optionalDataType: "String" - - name: "trailingOnlyDot" - in: "query" - description: "Trailing only dot." - required: false - type: "string" - x-exportParamName: "TrailingOnlyDot" - x-optionalDataType: "String" - - name: "trailingBoth" - in: "query" - description: "Leading both\n\nTrailing both." - required: false - type: "string" - x-exportParamName: "TrailingBoth" - x-optionalDataType: "String" - - name: "trailingMultiline" - in: "query" - description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ - \nTrailing multiline." - required: false - type: "string" - x-exportParamName: "TrailingMultiline" - x-optionalDataType: "String" - - name: "uuids" - in: "query" - description: "Specify a custom format of repeated field items" - required: false - type: "array" - items: - type: "string" - format: "uuid" - collectionFormat: "multi" - x-exportParamName: "Uuids" - responses: - 200: - description: "A successful response." - schema: - type: "object" - default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - put: - tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_Update" - parameters: - - name: "uuidName" - in: "path" + - "FALSE" + - "TRUE" + default: "FALSE" + - name: int64OverrideType + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: requiredStringViaFieldBehaviorAnnotation + in: query + description: mark a field as required in Open API definition + required: true + style: form + explode: true + schema: + type: string + - name: outputOnlyStringViaFieldBehaviorAnnotation + in: query + description: mark a field as readonly in Open API definition + required: false + style: form + explode: true + schema: + type: string + - name: optionalStringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: productId + in: query + description: |- + Test openapiv2 generation of repeated fields + + Only digits are allowed. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + - name: optionalStringField + in: query + description: Test openapiv2 generation of required fields with annotation + and jsonschema to reproduce + required: false + style: form + explode: true + schema: + type: string + - name: requiredStringField1 + in: query required: true - type: "string" - format: "uuid" - x-internal: true - x-exportParamName: "UuidName" - - in: "body" - name: "body" + style: form + explode: true + schema: + type: string + - name: requiredStringField2 + in: query required: true + style: form + explode: true schema: - $ref: "#/definitions/examplepbABitOfEverythingServiceUpdateBody" - x-exportParamName: "Body" - responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" - default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - options: - tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_CustomOptionsRequest" - parameters: - - name: "uuidName" - in: "path" + type: string + - name: required_field_behavior_json_name_custom + in: query + description: Test openapiv2 handling of required json_name fields required: true - type: "string" - format: "uuid" - x-internal: true - x-exportParamName: "UuidName" - - name: "singleNested.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "SingleNestedName" - x-optionalDataType: "String" - - name: "singleNested.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "SingleNestedAmount" - x-optionalDataType: "Int64" - - name: "singleNested.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "SingleNestedOk" - x-optionalDataType: "String" - - name: "floatValue" - in: "query" - description: "Float value field" - required: true - type: "number" - default: 0.2 - format: "float" - x-exportParamName: "FloatValue" - - name: "doubleValue" - in: "query" - required: true - type: "number" - format: "double" - x-exportParamName: "DoubleValue" - - name: "int64Value" - in: "query" - required: true - type: "string" - format: "int64" - x-exportParamName: "Int64Value" - - name: "uint64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Uint64Value" - x-optionalDataType: "String" - - name: "int32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Int32Value" - x-optionalDataType: "Int32" - - name: "fixed64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Fixed64Value" - x-optionalDataType: "String" - - name: "fixed32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Fixed32Value" - x-optionalDataType: "Int64" - - name: "boolValue" - in: "query" - required: false - type: "boolean" - x-exportParamName: "BoolValue" - x-optionalDataType: "Bool" - - name: "stringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "StringValue" - x-optionalDataType: "String" - - name: "bytesValue" - in: "query" - required: false - type: "string" - format: "byte" - x-exportParamName: "BytesValue" - x-optionalDataType: "String" - - name: "uint32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Uint32Value" - x-optionalDataType: "Int64" - - name: "enumValue" - in: "query" - description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValue" - x-optionalDataType: "String" - - name: "pathEnumValue" - in: "query" - required: false - type: "string" - default: "ABC" - enum: - - "ABC" - - "DEF" - x-exportParamName: "PathEnumValue" - x-optionalDataType: "String" - - name: "nestedPathEnumValue" - in: "query" - required: false - type: "string" - default: "GHI" - enum: - - "GHI" - - "JKL" - x-exportParamName: "NestedPathEnumValue" - x-optionalDataType: "String" - - name: "sfixed32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sfixed32Value" - x-optionalDataType: "Int32" - - name: "sfixed64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sfixed64Value" - x-optionalDataType: "String" - - name: "sint32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sint32Value" - x-optionalDataType: "Int32" - - name: "sint64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sint64Value" - x-optionalDataType: "String" - - name: "repeatedStringValue" - in: "query" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringValue" - - name: "oneofEmpty" - in: "query" - required: false - type: "object" - x-exportParamName: "OneofEmpty" - - name: "oneofString" - in: "query" - required: false - type: "string" - x-exportParamName: "OneofString" - x-optionalDataType: "String" - - name: "mapValue" - in: "query" - description: "map of numeric enum" - required: false - x-exportParamName: "MapValue" - - name: "mappedStringValue" - in: "query" - description: "Map of string title\n\nMap of string description." - required: false - type: "string" - x-exportParamName: "MappedStringValue" - x-optionalDataType: "String" - - name: "mappedNestedValue" - in: "query" - required: false - x-exportParamName: "MappedNestedValue" - - name: "nonConventionalNameValue" - in: "query" - required: false - type: "string" - x-exportParamName: "NonConventionalNameValue" - x-optionalDataType: "String" - - name: "timestampValue" - in: "query" - required: false - type: "string" - format: "date-time" - x-exportParamName: "TimestampValue" - x-optionalDataType: "Time" - - name: "repeatedEnumValue" - in: "query" - description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumValue" - - name: "repeatedEnumAnnotation" - in: "query" - description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ - \n - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumAnnotation" - - name: "enumValueAnnotation" - in: "query" - description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValueAnnotation" - x-optionalDataType: "String" - - name: "repeatedStringAnnotation" - in: "query" - description: "Repeated string title\n\nRepeated string description." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringAnnotation" - - name: "nestedAnnotation.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "NestedAnnotationName" - x-optionalDataType: "String" - - name: "nestedAnnotation.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "NestedAnnotationAmount" - x-optionalDataType: "Int64" - - name: "nestedAnnotation.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "NestedAnnotationOk" - x-optionalDataType: "String" - - name: "int64OverrideType" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Int64OverrideType" - x-optionalDataType: "Int64" - - name: "requiredStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as required in Open API definition" - required: true - type: "string" - x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" - - name: "outputOnlyStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as readonly in Open API definition" - required: false - type: "string" - x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" - x-optionalDataType: "String" - - name: "optionalStringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "OptionalStringValue" - x-optionalDataType: "String" - - name: "productId" - in: "query" - description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ - \ are allowed." - required: false - type: "array" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - collectionFormat: "multi" - x-exportParamName: "ProductId" - - name: "optionalStringField" - in: "query" - description: "Test openapiv2 generation of required fields with annotation\ - \ and jsonschema to reproduce" - required: false - type: "string" - x-exportParamName: "OptionalStringField" - x-optionalDataType: "String" - - name: "requiredStringField1" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField1" - - name: "requiredStringField2" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField2" - - name: "required_field_behavior_json_name_custom" - in: "query" - description: "Test openapiv2 handling of required json_name fields" - required: true - type: "string" - x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" - - name: "required_field_schema_json_name_custom" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredFieldSchemaJsonNameCustom" - - name: "trailingOnly" - in: "query" - description: "Trailing only" - required: false - type: "string" - x-exportParamName: "TrailingOnly" - x-optionalDataType: "String" - - name: "trailingOnlyDot" - in: "query" - description: "Trailing only dot." - required: false - type: "string" - x-exportParamName: "TrailingOnlyDot" - x-optionalDataType: "String" - - name: "trailingBoth" - in: "query" - description: "Leading both\n\nTrailing both." - required: false - type: "string" - x-exportParamName: "TrailingBoth" - x-optionalDataType: "String" - - name: "trailingMultiline" - in: "query" - description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ - \nTrailing multiline." - required: false - type: "string" - x-exportParamName: "TrailingMultiline" - x-optionalDataType: "String" - - name: "uuids" - in: "query" - description: "Specify a custom format of repeated field items" - required: false - type: "array" - items: - type: "string" - format: "uuid" - collectionFormat: "multi" - x-exportParamName: "Uuids" + style: form + explode: true + schema: + type: string + - name: required_field_schema_json_name_custom + in: query + required: true + style: form + explode: true + schema: + type: string + - name: trailingOnly + in: query + description: Trailing only + required: false + style: form + explode: true + schema: + type: string + - name: trailingOnlyDot + in: query + description: Trailing only dot. + required: false + style: form + explode: true + schema: + type: string + - name: trailingBoth + in: query + description: |- + Leading both + + Trailing both. + required: false + style: form + explode: true + schema: + type: string + - name: trailingMultiline + in: query + description: |- + Leading multiline + + This is an example of a multi-line comment. + + Trailing multiline. + required: false + style: form + explode: true + schema: + type: string + - name: uuids + in: query + description: Specify a custom format of repeated field items + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid responses: - 200: - description: "A successful response." - schema: - type: "object" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - /v1/example/a_bit_of_everything/{uuidName}:custom: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + /v1/example/a_bit_of_everything/params/post/{stringValue}: post: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_Custom" + - ABitOfEverything + operationId: ABitOfEverythingService_CheckPostQueryParams parameters: - - name: "uuidName" - in: "path" + - name: stringValue + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: uuid + in: query required: true - type: "string" - format: "uuid" + style: form + explode: true + schema: + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + type: string + format: uuid + x-internal: true x-internal: true - x-exportParamName: "UuidName" - - name: "singleNested.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "SingleNestedName" - x-optionalDataType: "String" - - name: "singleNested.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "SingleNestedAmount" - x-optionalDataType: "Int64" - - name: "singleNested.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "SingleNestedOk" - x-optionalDataType: "String" - - name: "floatValue" - in: "query" - description: "Float value field" - required: true - type: "number" - default: 0.2 - format: "float" - x-exportParamName: "FloatValue" - - name: "doubleValue" - in: "query" - required: true - type: "number" - format: "double" - x-exportParamName: "DoubleValue" - - name: "int64Value" - in: "query" - required: true - type: "string" - format: "int64" - x-exportParamName: "Int64Value" - - name: "uint64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Uint64Value" - x-optionalDataType: "String" - - name: "int32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Int32Value" - x-optionalDataType: "Int32" - - name: "fixed64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Fixed64Value" - x-optionalDataType: "String" - - name: "fixed32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Fixed32Value" - x-optionalDataType: "Int64" - - name: "boolValue" - in: "query" - required: false - type: "boolean" - x-exportParamName: "BoolValue" - x-optionalDataType: "Bool" - - name: "stringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "StringValue" - x-optionalDataType: "String" - - name: "bytesValue" - in: "query" - required: false - type: "string" - format: "byte" - x-exportParamName: "BytesValue" - x-optionalDataType: "String" - - name: "uint32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Uint32Value" - x-optionalDataType: "Int64" - - name: "enumValue" - in: "query" - description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValue" - x-optionalDataType: "String" - - name: "pathEnumValue" - in: "query" - required: false - type: "string" - default: "ABC" - enum: - - "ABC" - - "DEF" - x-exportParamName: "PathEnumValue" - x-optionalDataType: "String" - - name: "nestedPathEnumValue" - in: "query" - required: false - type: "string" - default: "GHI" - enum: - - "GHI" - - "JKL" - x-exportParamName: "NestedPathEnumValue" - x-optionalDataType: "String" - - name: "sfixed32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sfixed32Value" - x-optionalDataType: "Int32" - - name: "sfixed64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sfixed64Value" - x-optionalDataType: "String" - - name: "sint32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sint32Value" - x-optionalDataType: "Int32" - - name: "sint64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sint64Value" - x-optionalDataType: "String" - - name: "repeatedStringValue" - in: "query" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringValue" - - name: "oneofEmpty" - in: "query" - required: false - type: "object" - x-exportParamName: "OneofEmpty" - - name: "oneofString" - in: "query" - required: false - type: "string" - x-exportParamName: "OneofString" - x-optionalDataType: "String" - - name: "mapValue" - in: "query" - description: "map of numeric enum" - required: false - x-exportParamName: "MapValue" - - name: "mappedStringValue" - in: "query" - description: "Map of string title\n\nMap of string description." - required: false - type: "string" - x-exportParamName: "MappedStringValue" - x-optionalDataType: "String" - - name: "mappedNestedValue" - in: "query" - required: false - x-exportParamName: "MappedNestedValue" - - name: "nonConventionalNameValue" - in: "query" - required: false - type: "string" - x-exportParamName: "NonConventionalNameValue" - x-optionalDataType: "String" - - name: "timestampValue" - in: "query" - required: false - type: "string" - format: "date-time" - x-exportParamName: "TimestampValue" - x-optionalDataType: "Time" - - name: "repeatedEnumValue" - in: "query" - description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumValue" - - name: "repeatedEnumAnnotation" - in: "query" - description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ - \n - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumAnnotation" - - name: "enumValueAnnotation" - in: "query" - description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValueAnnotation" - x-optionalDataType: "String" - - name: "repeatedStringAnnotation" - in: "query" - description: "Repeated string title\n\nRepeated string description." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringAnnotation" - - name: "nestedAnnotation.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "NestedAnnotationName" - x-optionalDataType: "String" - - name: "nestedAnnotation.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "NestedAnnotationAmount" - x-optionalDataType: "Int64" - - name: "nestedAnnotation.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "NestedAnnotationOk" - x-optionalDataType: "String" - - name: "int64OverrideType" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Int64OverrideType" - x-optionalDataType: "Int64" - - name: "requiredStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as required in Open API definition" - required: true - type: "string" - x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" - - name: "outputOnlyStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as readonly in Open API definition" - required: false - type: "string" - x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" - x-optionalDataType: "String" - - name: "optionalStringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "OptionalStringValue" - x-optionalDataType: "String" - - name: "productId" - in: "query" - description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ - \ are allowed." - required: false - type: "array" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - collectionFormat: "multi" - x-exportParamName: "ProductId" - - name: "optionalStringField" - in: "query" - description: "Test openapiv2 generation of required fields with annotation\ - \ and jsonschema to reproduce" - required: false - type: "string" - x-exportParamName: "OptionalStringField" - x-optionalDataType: "String" - - name: "requiredStringField1" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField1" - - name: "requiredStringField2" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField2" - - name: "required_field_behavior_json_name_custom" - in: "query" - description: "Test openapiv2 handling of required json_name fields" - required: true - type: "string" - x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" - - name: "required_field_schema_json_name_custom" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredFieldSchemaJsonNameCustom" - - name: "trailingOnly" - in: "query" - description: "Trailing only" - required: false - type: "string" - x-exportParamName: "TrailingOnly" - x-optionalDataType: "String" - - name: "trailingOnlyDot" - in: "query" - description: "Trailing only dot." - required: false - type: "string" - x-exportParamName: "TrailingOnlyDot" - x-optionalDataType: "String" - - name: "trailingBoth" - in: "query" - description: "Leading both\n\nTrailing both." - required: false - type: "string" - x-exportParamName: "TrailingBoth" - x-optionalDataType: "String" - - name: "trailingMultiline" - in: "query" - description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ - \nTrailing multiline." - required: false - type: "string" - x-exportParamName: "TrailingMultiline" - x-optionalDataType: "String" - - name: "uuids" - in: "query" - description: "Specify a custom format of repeated field items" - required: false - type: "array" - items: - type: "string" - format: "uuid" - collectionFormat: "multi" - x-exportParamName: "Uuids" - responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverything" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" - default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - /v1/example/a_bit_of_everything/{uuidName}:custom:custom: + - name: floatValue + in: query + description: Float value field + required: true + style: form + explode: true + schema: + type: number + format: float + default: 0.2 + - name: doubleValue + in: query + required: true + style: form + explode: true + schema: + type: number + format: double + - name: int64Value + in: query + required: true + style: form + explode: true + schema: + type: string + format: int64 + - name: uint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: int32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: fixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: fixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: boolValue + in: query + required: false + style: form + explode: true + schema: + type: boolean + - name: bytesValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: byte + - name: uint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: enumValue + in: query + description: |2- + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: pathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - ABC + - DEF + default: ABC + - name: nestedPathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - GHI + - JKL + default: GHI + - name: sfixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sfixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: sint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: repeatedStringValue + in: query + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: oneofEmpty + in: query + required: false + style: form + explode: true + schema: + type: object + - name: oneofString + in: query + required: false + style: form + explode: true + schema: + type: string + - name: mapValue + in: query + description: map of numeric enum + required: false + style: form + explode: true + schema: {} + - name: mappedStringValue + in: query + description: |- + Map of string title + + Map of string description. + required: false + style: form + explode: true + schema: + type: string + - name: mappedNestedValue + in: query + required: false + style: form + explode: true + schema: {} + - name: nonConventionalNameValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: timestampValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: repeatedEnumValue + in: query + description: |- + repeated enum value. it is comma-separated in query + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedEnumAnnotation + in: query + description: |- + Repeated numeric enum title + + Repeated numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: enumValueAnnotation + in: query + description: |- + Numeric enum title + + Numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: repeatedStringAnnotation + in: query + description: |- + Repeated string title + + Repeated string description. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: nestedAnnotation.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: nestedAnnotation.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: nestedAnnotation.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: int64OverrideType + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: requiredStringViaFieldBehaviorAnnotation + in: query + description: mark a field as required in Open API definition + required: true + style: form + explode: true + schema: + type: string + - name: outputOnlyStringViaFieldBehaviorAnnotation + in: query + description: mark a field as readonly in Open API definition + required: false + style: form + explode: true + schema: + type: string + - name: optionalStringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: productId + in: query + description: |- + Test openapiv2 generation of repeated fields + + Only digits are allowed. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + - name: optionalStringField + in: query + description: Test openapiv2 generation of required fields with annotation + and jsonschema to reproduce + required: false + style: form + explode: true + schema: + type: string + - name: requiredStringField1 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: requiredStringField2 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: required_field_behavior_json_name_custom + in: query + description: Test openapiv2 handling of required json_name fields + required: true + style: form + explode: true + schema: + type: string + - name: required_field_schema_json_name_custom + in: query + required: true + style: form + explode: true + schema: + type: string + - name: trailingOnly + in: query + description: Trailing only + required: false + style: form + explode: true + schema: + type: string + - name: trailingOnlyDot + in: query + description: Trailing only dot. + required: false + style: form + explode: true + schema: + type: string + - name: trailingBoth + in: query + description: |- + Leading both + + Trailing both. + required: false + style: form + explode: true + schema: + type: string + - name: trailingMultiline + in: query + description: |- + Leading multiline + + This is an example of a multi-line comment. + + Trailing multiline. + required: false + style: form + explode: true + schema: + type: string + - name: uuids + in: query + description: Specify a custom format of repeated field items + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ABitOfEverythingNested" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/ABitOfEverythingNested" + required: true + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: singleNested + /v1/example/a_bit_of_everything/query/{uuidName}: + get: + tags: + - ABitOfEverything + externalDocs: + description: Find out more about GetQuery + url: https://github.com/grpc-ecosystem/grpc-gateway + operationId: ABitOfEverythingService_GetQuery + parameters: + - name: uuidName + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uuid + x-internal: true + x-internal: true + - name: singleNested.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: singleNested.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: singleNested.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: floatValue + in: query + description: Float value field + required: true + style: form + explode: true + schema: + type: number + format: float + default: 0.2 + - name: doubleValue + in: query + required: true + style: form + explode: true + schema: + type: number + format: double + - name: int64Value + in: query + required: true + style: form + explode: true + schema: + type: string + format: int64 + - name: uint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: int32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: fixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: fixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: boolValue + in: query + required: false + style: form + explode: true + schema: + type: boolean + - name: stringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: bytesValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: byte + - name: uint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: enumValue + in: query + description: |2- + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: pathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - ABC + - DEF + default: ABC + - name: nestedPathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - GHI + - JKL + default: GHI + - name: sfixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sfixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: sint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: repeatedStringValue + in: query + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: oneofEmpty + in: query + required: false + style: form + explode: true + schema: + type: object + - name: oneofString + in: query + required: false + style: form + explode: true + schema: + type: string + - name: mapValue + in: query + description: map of numeric enum + required: false + style: form + explode: true + schema: {} + - name: mappedStringValue + in: query + description: |- + Map of string title + + Map of string description. + required: false + style: form + explode: true + schema: + type: string + - name: mappedNestedValue + in: query + required: false + style: form + explode: true + schema: {} + - name: nonConventionalNameValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: timestampValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: repeatedEnumValue + in: query + description: |- + repeated enum value. it is comma-separated in query + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedEnumAnnotation + in: query + description: |- + Repeated numeric enum title + + Repeated numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: enumValueAnnotation + in: query + description: |- + Numeric enum title + + Numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: repeatedStringAnnotation + in: query + description: |- + Repeated string title + + Repeated string description. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: nestedAnnotation.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: nestedAnnotation.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: nestedAnnotation.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: int64OverrideType + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: requiredStringViaFieldBehaviorAnnotation + in: query + description: mark a field as required in Open API definition + required: true + style: form + explode: true + schema: + type: string + - name: outputOnlyStringViaFieldBehaviorAnnotation + in: query + description: mark a field as readonly in Open API definition + required: false + style: form + explode: true + schema: + type: string + - name: optionalStringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: productId + in: query + description: |- + Test openapiv2 generation of repeated fields + + Only digits are allowed. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + - name: optionalStringField + in: query + description: Test openapiv2 generation of required fields with annotation + and jsonschema to reproduce + required: false + style: form + explode: true + schema: + type: string + - name: requiredStringField1 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: requiredStringField2 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: required_field_behavior_json_name_custom + in: query + description: Test openapiv2 handling of required json_name fields + required: true + style: form + explode: true + schema: + type: string + - name: required_field_schema_json_name_custom + in: query + required: true + style: form + explode: true + schema: + type: string + - name: trailingOnly + in: query + description: Trailing only + required: false + style: form + explode: true + schema: + type: string + - name: trailingOnlyDot + in: query + description: Trailing only dot. + required: false + style: form + explode: true + schema: + type: string + - name: trailingBoth + in: query + description: |- + Leading both + + Trailing both. + required: false + style: form + explode: true + schema: + type: string + - name: trailingMultiline + in: query + description: |- + Leading multiline + + This is an example of a multi-line comment. + + Trailing multiline. + required: false + style: form + explode: true + schema: + type: string + - name: uuids + in: query + description: Specify a custom format of repeated field items + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid + responses: + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + deprecated: true + security: [] + ? /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation} + : post: + tags: + - ABitOfEverything + summary: Create a new ABitOfEverything + description: This API creates a new ABitOfEverything + operationId: ABitOfEverythingService_Create + parameters: + - name: floatValue + in: path + description: Float value field + required: true + style: simple + explode: false + schema: + type: number + format: float + default: 0.2 + - name: doubleValue + in: path + required: true + style: simple + explode: false + schema: + type: number + format: double + - name: int64Value + in: path + required: true + style: simple + explode: false + schema: + type: string + format: int64 + - name: uint64Value + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uint64 + - name: int32Value + in: path + required: true + style: simple + explode: false + schema: + type: integer + format: int32 + - name: fixed64Value + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uint64 + - name: fixed32Value + in: path + required: true + style: simple + explode: false + schema: + type: integer + format: int64 + - name: boolValue + in: path + required: true + style: simple + explode: false + schema: + type: boolean + - name: stringValue + in: path + required: true + style: simple + explode: false + schema: + pattern: "strprefix/[^/]+" + type: string + - name: uint32Value + in: path + required: true + style: simple + explode: false + schema: + type: integer + format: int64 + - name: sfixed32Value + in: path + required: true + style: simple + explode: false + schema: + type: integer + format: int32 + - name: sfixed64Value + in: path + required: true + style: simple + explode: false + schema: + type: string + format: int64 + - name: sint32Value + in: path + required: true + style: simple + explode: false + schema: + type: integer + format: int32 + - name: sint64Value + in: path + required: true + style: simple + explode: false + schema: + type: string + format: int64 + - name: nonConventionalNameValue + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: enumValue + in: path + required: true + style: simple + explode: false + schema: + type: string + enum: + - ZERO + - ONE + - name: pathEnumValue + in: path + required: true + style: simple + explode: false + schema: + type: string + enum: + - ABC + - DEF + - name: nestedPathEnumValue + in: path + required: true + style: simple + explode: false + schema: + type: string + enum: + - GHI + - JKL + - name: enumValueAnnotation + in: path + description: Numeric enum description. + required: true + style: simple + explode: false + schema: + type: string + enum: + - ZERO + - ONE + - name: singleNested.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: singleNested.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: singleNested.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: uuid + in: query + required: true + style: form + explode: true + schema: + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + type: string + format: uuid + x-internal: true + x-internal: true + - name: bytesValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: byte + - name: repeatedStringValue + in: query + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: oneofEmpty + in: query + required: false + style: form + explode: true + schema: + type: object + - name: oneofString + in: query + required: false + style: form + explode: true + schema: + type: string + - name: mapValue + in: query + description: map of numeric enum + required: false + style: form + explode: true + schema: {} + - name: mappedStringValue + in: query + description: |- + Map of string title + + Map of string description. + required: false + style: form + explode: true + schema: + type: string + - name: mappedNestedValue + in: query + required: false + style: form + explode: true + schema: {} + - name: timestampValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: repeatedEnumValue + in: query + description: |- + repeated enum value. it is comma-separated in query + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedEnumAnnotation + in: query + description: |- + Repeated numeric enum title + + Repeated numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedStringAnnotation + in: query + description: |- + Repeated string title + + Repeated string description. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: nestedAnnotation.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: nestedAnnotation.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: nestedAnnotation.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: int64OverrideType + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: requiredStringViaFieldBehaviorAnnotation + in: query + description: mark a field as required in Open API definition + required: true + style: form + explode: true + schema: + type: string + - name: outputOnlyStringViaFieldBehaviorAnnotation + in: query + description: mark a field as readonly in Open API definition + required: false + style: form + explode: true + schema: + type: string + - name: optionalStringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: productId + in: query + description: |- + Test openapiv2 generation of repeated fields + + Only digits are allowed. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + - name: optionalStringField + in: query + description: Test openapiv2 generation of required fields with annotation + and jsonschema to reproduce + required: false + style: form + explode: true + schema: + type: string + - name: requiredStringField1 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: requiredStringField2 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: required_field_behavior_json_name_custom + in: query + description: Test openapiv2 handling of required json_name fields + required: true + style: form + explode: true + schema: + type: string + - name: required_field_schema_json_name_custom + in: query + required: true + style: form + explode: true + schema: + type: string + - name: trailingOnly + in: query + description: Trailing only + required: false + style: form + explode: true + schema: + type: string + - name: trailingOnlyDot + in: query + description: Trailing only dot. + required: false + style: form + explode: true + schema: + type: string + - name: trailingBoth + in: query + description: |- + Leading both + + Trailing both. + required: false + style: form + explode: true + schema: + type: string + - name: trailingMultiline + in: query + description: |- + Leading multiline + + This is an example of a multi-line comment. + + Trailing multiline. + required: false + style: form + explode: true + schema: + type: string + - name: uuids + in: query + description: Specify a custom format of repeated field items + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + /v1/example/a_bit_of_everything/{uuidName}: + put: + tags: + - ABitOfEverything + operationId: ABitOfEverythingService_Update + parameters: + - name: uuidName + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uuid + x-internal: true + x-internal: true + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverythingServiceUpdateBody" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverythingServiceUpdateBody" + required: true + responses: + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body + options: + tags: + - ABitOfEverything + operationId: ABitOfEverythingService_CustomOptionsRequest + parameters: + - name: uuidName + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uuid + x-internal: true + x-internal: true + - name: singleNested.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: singleNested.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: singleNested.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: floatValue + in: query + description: Float value field + required: true + style: form + explode: true + schema: + type: number + format: float + default: 0.2 + - name: doubleValue + in: query + required: true + style: form + explode: true + schema: + type: number + format: double + - name: int64Value + in: query + required: true + style: form + explode: true + schema: + type: string + format: int64 + - name: uint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: int32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: fixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: fixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: boolValue + in: query + required: false + style: form + explode: true + schema: + type: boolean + - name: stringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: bytesValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: byte + - name: uint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: enumValue + in: query + description: |2- + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: pathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - ABC + - DEF + default: ABC + - name: nestedPathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - GHI + - JKL + default: GHI + - name: sfixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sfixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: sint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: repeatedStringValue + in: query + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: oneofEmpty + in: query + required: false + style: form + explode: true + schema: + type: object + - name: oneofString + in: query + required: false + style: form + explode: true + schema: + type: string + - name: mapValue + in: query + description: map of numeric enum + required: false + style: form + explode: true + schema: {} + - name: mappedStringValue + in: query + description: |- + Map of string title + + Map of string description. + required: false + style: form + explode: true + schema: + type: string + - name: mappedNestedValue + in: query + required: false + style: form + explode: true + schema: {} + - name: nonConventionalNameValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: timestampValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: repeatedEnumValue + in: query + description: |- + repeated enum value. it is comma-separated in query + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedEnumAnnotation + in: query + description: |- + Repeated numeric enum title + + Repeated numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: enumValueAnnotation + in: query + description: |- + Numeric enum title + + Numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: repeatedStringAnnotation + in: query + description: |- + Repeated string title + + Repeated string description. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: nestedAnnotation.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: nestedAnnotation.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: nestedAnnotation.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: int64OverrideType + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: requiredStringViaFieldBehaviorAnnotation + in: query + description: mark a field as required in Open API definition + required: true + style: form + explode: true + schema: + type: string + - name: outputOnlyStringViaFieldBehaviorAnnotation + in: query + description: mark a field as readonly in Open API definition + required: false + style: form + explode: true + schema: + type: string + - name: optionalStringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: productId + in: query + description: |- + Test openapiv2 generation of repeated fields + + Only digits are allowed. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + - name: optionalStringField + in: query + description: Test openapiv2 generation of required fields with annotation + and jsonschema to reproduce + required: false + style: form + explode: true + schema: + type: string + - name: requiredStringField1 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: requiredStringField2 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: required_field_behavior_json_name_custom + in: query + description: Test openapiv2 handling of required json_name fields + required: true + style: form + explode: true + schema: + type: string + - name: required_field_schema_json_name_custom + in: query + required: true + style: form + explode: true + schema: + type: string + - name: trailingOnly + in: query + description: Trailing only + required: false + style: form + explode: true + schema: + type: string + - name: trailingOnlyDot + in: query + description: Trailing only dot. + required: false + style: form + explode: true + schema: + type: string + - name: trailingBoth + in: query + description: |- + Leading both + + Trailing both. + required: false + style: form + explode: true + schema: + type: string + - name: trailingMultiline + in: query + description: |- + Leading multiline + + This is an example of a multi-line comment. + + Trailing multiline. + required: false + style: form + explode: true + schema: + type: string + - name: uuids + in: query + description: Specify a custom format of repeated field items + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid + responses: + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + head: + tags: + - ABitOfEverything + operationId: ABitOfEverythingService_Exists + parameters: + - name: uuidName + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uuid + x-internal: true + x-internal: true + - name: singleNested.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: singleNested.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: singleNested.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: floatValue + in: query + description: Float value field + required: true + style: form + explode: true + schema: + type: number + format: float + default: 0.2 + - name: doubleValue + in: query + required: true + style: form + explode: true + schema: + type: number + format: double + - name: int64Value + in: query + required: true + style: form + explode: true + schema: + type: string + format: int64 + - name: uint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: int32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: fixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: fixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: boolValue + in: query + required: false + style: form + explode: true + schema: + type: boolean + - name: stringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: bytesValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: byte + - name: uint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: enumValue + in: query + description: |2- + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: pathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - ABC + - DEF + default: ABC + - name: nestedPathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - GHI + - JKL + default: GHI + - name: sfixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sfixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: sint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: repeatedStringValue + in: query + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: oneofEmpty + in: query + required: false + style: form + explode: true + schema: + type: object + - name: oneofString + in: query + required: false + style: form + explode: true + schema: + type: string + - name: mapValue + in: query + description: map of numeric enum + required: false + style: form + explode: true + schema: {} + - name: mappedStringValue + in: query + description: |- + Map of string title + + Map of string description. + required: false + style: form + explode: true + schema: + type: string + - name: mappedNestedValue + in: query + required: false + style: form + explode: true + schema: {} + - name: nonConventionalNameValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: timestampValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: repeatedEnumValue + in: query + description: |- + repeated enum value. it is comma-separated in query + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedEnumAnnotation + in: query + description: |- + Repeated numeric enum title + + Repeated numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: enumValueAnnotation + in: query + description: |- + Numeric enum title + + Numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: repeatedStringAnnotation + in: query + description: |- + Repeated string title + + Repeated string description. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: nestedAnnotation.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: nestedAnnotation.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: nestedAnnotation.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: int64OverrideType + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: requiredStringViaFieldBehaviorAnnotation + in: query + description: mark a field as required in Open API definition + required: true + style: form + explode: true + schema: + type: string + - name: outputOnlyStringViaFieldBehaviorAnnotation + in: query + description: mark a field as readonly in Open API definition + required: false + style: form + explode: true + schema: + type: string + - name: optionalStringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: productId + in: query + description: |- + Test openapiv2 generation of repeated fields + + Only digits are allowed. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + - name: optionalStringField + in: query + description: Test openapiv2 generation of required fields with annotation + and jsonschema to reproduce + required: false + style: form + explode: true + schema: + type: string + - name: requiredStringField1 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: requiredStringField2 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: required_field_behavior_json_name_custom + in: query + description: Test openapiv2 handling of required json_name fields + required: true + style: form + explode: true + schema: + type: string + - name: required_field_schema_json_name_custom + in: query + required: true + style: form + explode: true + schema: + type: string + - name: trailingOnly + in: query + description: Trailing only + required: false + style: form + explode: true + schema: + type: string + - name: trailingOnlyDot + in: query + description: Trailing only dot. + required: false + style: form + explode: true + schema: + type: string + - name: trailingBoth + in: query + description: |- + Leading both + + Trailing both. + required: false + style: form + explode: true + schema: + type: string + - name: trailingMultiline + in: query + description: |- + Leading multiline + + This is an example of a multi-line comment. + + Trailing multiline. + required: false + style: form + explode: true + schema: + type: string + - name: uuids + in: query + description: Specify a custom format of repeated field items + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid + responses: + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + /v1/example/a_bit_of_everything/{uuidName}:custom: + post: + tags: + - ABitOfEverything + operationId: ABitOfEverythingService_Custom + parameters: + - name: uuidName + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uuid + x-internal: true + x-internal: true + - name: singleNested.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: singleNested.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: singleNested.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: floatValue + in: query + description: Float value field + required: true + style: form + explode: true + schema: + type: number + format: float + default: 0.2 + - name: doubleValue + in: query + required: true + style: form + explode: true + schema: + type: number + format: double + - name: int64Value + in: query + required: true + style: form + explode: true + schema: + type: string + format: int64 + - name: uint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: int32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: fixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: fixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: boolValue + in: query + required: false + style: form + explode: true + schema: + type: boolean + - name: stringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: bytesValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: byte + - name: uint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: enumValue + in: query + description: |2- + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: pathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - ABC + - DEF + default: ABC + - name: nestedPathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - GHI + - JKL + default: GHI + - name: sfixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sfixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: sint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: repeatedStringValue + in: query + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: oneofEmpty + in: query + required: false + style: form + explode: true + schema: + type: object + - name: oneofString + in: query + required: false + style: form + explode: true + schema: + type: string + - name: mapValue + in: query + description: map of numeric enum + required: false + style: form + explode: true + schema: {} + - name: mappedStringValue + in: query + description: |- + Map of string title + + Map of string description. + required: false + style: form + explode: true + schema: + type: string + - name: mappedNestedValue + in: query + required: false + style: form + explode: true + schema: {} + - name: nonConventionalNameValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: timestampValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: repeatedEnumValue + in: query + description: |- + repeated enum value. it is comma-separated in query + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedEnumAnnotation + in: query + description: |- + Repeated numeric enum title + + Repeated numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: enumValueAnnotation + in: query + description: |- + Numeric enum title + + Numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: repeatedStringAnnotation + in: query + description: |- + Repeated string title + + Repeated string description. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: nestedAnnotation.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: nestedAnnotation.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: nestedAnnotation.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: int64OverrideType + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: requiredStringViaFieldBehaviorAnnotation + in: query + description: mark a field as required in Open API definition + required: true + style: form + explode: true + schema: + type: string + - name: outputOnlyStringViaFieldBehaviorAnnotation + in: query + description: mark a field as readonly in Open API definition + required: false + style: form + explode: true + schema: + type: string + - name: optionalStringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: productId + in: query + description: |- + Test openapiv2 generation of repeated fields + + Only digits are allowed. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + - name: optionalStringField + in: query + description: Test openapiv2 generation of required fields with annotation + and jsonschema to reproduce + required: false + style: form + explode: true + schema: + type: string + - name: requiredStringField1 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: requiredStringField2 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: required_field_behavior_json_name_custom + in: query + description: Test openapiv2 handling of required json_name fields + required: true + style: form + explode: true + schema: + type: string + - name: required_field_schema_json_name_custom + in: query + required: true + style: form + explode: true + schema: + type: string + - name: trailingOnly + in: query + description: Trailing only + required: false + style: form + explode: true + schema: + type: string + - name: trailingOnlyDot + in: query + description: Trailing only dot. + required: false + style: form + explode: true + schema: + type: string + - name: trailingBoth + in: query + description: |- + Leading both + + Trailing both. + required: false + style: form + explode: true + schema: + type: string + - name: trailingMultiline + in: query + description: |- + Leading multiline + + This is an example of a multi-line comment. + + Trailing multiline. + required: false + style: form + explode: true + schema: + type: string + - name: uuids + in: query + description: Specify a custom format of repeated field items + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + /v1/example/a_bit_of_everything/{uuidName}:custom:custom: post: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_DoubleColon" + - ABitOfEverything + operationId: ABitOfEverythingService_DoubleColon parameters: - - name: "uuidName" - in: "path" + - name: uuidName + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uuid + x-internal: true + x-internal: true + - name: singleNested.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: singleNested.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: singleNested.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: floatValue + in: query + description: Float value field + required: true + style: form + explode: true + schema: + type: number + format: float + default: 0.2 + - name: doubleValue + in: query + required: true + style: form + explode: true + schema: + type: number + format: double + - name: int64Value + in: query + required: true + style: form + explode: true + schema: + type: string + format: int64 + - name: uint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: int32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: fixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: fixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: boolValue + in: query + required: false + style: form + explode: true + schema: + type: boolean + - name: stringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: bytesValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: byte + - name: uint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: enumValue + in: query + description: |2- + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: pathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - ABC + - DEF + default: ABC + - name: nestedPathEnumValue + in: query + required: false + style: form + explode: true + schema: + type: string + enum: + - GHI + - JKL + default: GHI + - name: sfixed32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sfixed64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: sint32Value + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int32 + - name: sint64Value + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: repeatedStringValue + in: query + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: oneofEmpty + in: query + required: false + style: form + explode: true + schema: + type: object + - name: oneofString + in: query + required: false + style: form + explode: true + schema: + type: string + - name: mapValue + in: query + description: map of numeric enum + required: false + style: form + explode: true + schema: {} + - name: mappedStringValue + in: query + description: |- + Map of string title + + Map of string description. + required: false + style: form + explode: true + schema: + type: string + - name: mappedNestedValue + in: query + required: false + style: form + explode: true + schema: {} + - name: nonConventionalNameValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: timestampValue + in: query + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: repeatedEnumValue + in: query + description: |- + repeated enum value. it is comma-separated in query + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: repeatedEnumAnnotation + in: query + description: |- + Repeated numeric enum title + + Repeated numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: enumValueAnnotation + in: query + description: |- + Numeric enum title + + Numeric enum description. + + - ZERO: ZERO means 0 + - ONE: ONE means 1 + required: false + style: form + explode: true + schema: + type: string + enum: + - ZERO + - ONE + default: ZERO + - name: repeatedStringAnnotation + in: query + description: |- + Repeated string title + + Repeated string description. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + - name: nestedAnnotation.name + in: query + description: name is nested field. + required: false + style: form + explode: true + schema: + type: string + - name: nestedAnnotation.amount + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: nestedAnnotation.ok + in: query + description: |- + DeepEnum description. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + required: false + style: form + explode: true + schema: + type: string + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + - name: int64OverrideType + in: query + required: false + style: form + explode: true + schema: + type: integer + format: int64 + - name: requiredStringViaFieldBehaviorAnnotation + in: query + description: mark a field as required in Open API definition + required: true + style: form + explode: true + schema: + type: string + - name: outputOnlyStringViaFieldBehaviorAnnotation + in: query + description: mark a field as readonly in Open API definition + required: false + style: form + explode: true + schema: + type: string + - name: optionalStringValue + in: query + required: false + style: form + explode: true + schema: + type: string + - name: productId + in: query + description: |- + Test openapiv2 generation of repeated fields + + Only digits are allowed. + required: false + style: form + explode: true + schema: + type: array + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + - name: optionalStringField + in: query + description: Test openapiv2 generation of required fields with annotation + and jsonschema to reproduce + required: false + style: form + explode: true + schema: + type: string + - name: requiredStringField1 + in: query + required: true + style: form + explode: true + schema: + type: string + - name: requiredStringField2 + in: query required: true - type: "string" - format: "uuid" - x-internal: true - x-exportParamName: "UuidName" - - name: "singleNested.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "SingleNestedName" - x-optionalDataType: "String" - - name: "singleNested.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "SingleNestedAmount" - x-optionalDataType: "Int64" - - name: "singleNested.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "SingleNestedOk" - x-optionalDataType: "String" - - name: "floatValue" - in: "query" - description: "Float value field" - required: true - type: "number" - default: 0.2 - format: "float" - x-exportParamName: "FloatValue" - - name: "doubleValue" - in: "query" - required: true - type: "number" - format: "double" - x-exportParamName: "DoubleValue" - - name: "int64Value" - in: "query" - required: true - type: "string" - format: "int64" - x-exportParamName: "Int64Value" - - name: "uint64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Uint64Value" - x-optionalDataType: "String" - - name: "int32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Int32Value" - x-optionalDataType: "Int32" - - name: "fixed64Value" - in: "query" - required: false - type: "string" - format: "uint64" - x-exportParamName: "Fixed64Value" - x-optionalDataType: "String" - - name: "fixed32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Fixed32Value" - x-optionalDataType: "Int64" - - name: "boolValue" - in: "query" - required: false - type: "boolean" - x-exportParamName: "BoolValue" - x-optionalDataType: "Bool" - - name: "stringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "StringValue" - x-optionalDataType: "String" - - name: "bytesValue" - in: "query" - required: false - type: "string" - format: "byte" - x-exportParamName: "BytesValue" - x-optionalDataType: "String" - - name: "uint32Value" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Uint32Value" - x-optionalDataType: "Int64" - - name: "enumValue" - in: "query" - description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValue" - x-optionalDataType: "String" - - name: "pathEnumValue" - in: "query" - required: false - type: "string" - default: "ABC" - enum: - - "ABC" - - "DEF" - x-exportParamName: "PathEnumValue" - x-optionalDataType: "String" - - name: "nestedPathEnumValue" - in: "query" - required: false - type: "string" - default: "GHI" - enum: - - "GHI" - - "JKL" - x-exportParamName: "NestedPathEnumValue" - x-optionalDataType: "String" - - name: "sfixed32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sfixed32Value" - x-optionalDataType: "Int32" - - name: "sfixed64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sfixed64Value" - x-optionalDataType: "String" - - name: "sint32Value" - in: "query" - required: false - type: "integer" - format: "int32" - x-exportParamName: "Sint32Value" - x-optionalDataType: "Int32" - - name: "sint64Value" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Sint64Value" - x-optionalDataType: "String" - - name: "repeatedStringValue" - in: "query" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringValue" - - name: "oneofEmpty" - in: "query" - required: false - type: "object" - x-exportParamName: "OneofEmpty" - - name: "oneofString" - in: "query" - required: false - type: "string" - x-exportParamName: "OneofString" - x-optionalDataType: "String" - - name: "mapValue" - in: "query" - description: "map of numeric enum" - required: false - x-exportParamName: "MapValue" - - name: "mappedStringValue" - in: "query" - description: "Map of string title\n\nMap of string description." - required: false - type: "string" - x-exportParamName: "MappedStringValue" - x-optionalDataType: "String" - - name: "mappedNestedValue" - in: "query" - required: false - x-exportParamName: "MappedNestedValue" - - name: "nonConventionalNameValue" - in: "query" - required: false - type: "string" - x-exportParamName: "NonConventionalNameValue" - x-optionalDataType: "String" - - name: "timestampValue" - in: "query" - required: false - type: "string" - format: "date-time" - x-exportParamName: "TimestampValue" - x-optionalDataType: "Time" - - name: "repeatedEnumValue" - in: "query" - description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumValue" - - name: "repeatedEnumAnnotation" - in: "query" - description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ - \n - ZERO: ZERO means 0\n - ONE: ONE means 1" - required: false - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "multi" - x-exportParamName: "RepeatedEnumAnnotation" - - name: "enumValueAnnotation" - in: "query" - description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ - \ ZERO means 0\n - ONE: ONE means 1" - required: false - type: "string" - default: "ZERO" - enum: - - "ZERO" - - "ONE" - x-exportParamName: "EnumValueAnnotation" - x-optionalDataType: "String" - - name: "repeatedStringAnnotation" - in: "query" - description: "Repeated string title\n\nRepeated string description." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - x-exportParamName: "RepeatedStringAnnotation" - - name: "nestedAnnotation.name" - in: "query" - description: "name is nested field." - required: false - type: "string" - x-exportParamName: "NestedAnnotationName" - x-optionalDataType: "String" - - name: "nestedAnnotation.amount" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "NestedAnnotationAmount" - x-optionalDataType: "Int64" - - name: "nestedAnnotation.ok" - in: "query" - description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - required: false - type: "string" - default: "FALSE" - enum: - - "FALSE" - - "TRUE" - x-exportParamName: "NestedAnnotationOk" - x-optionalDataType: "String" - - name: "int64OverrideType" - in: "query" - required: false - type: "integer" - format: "int64" - x-exportParamName: "Int64OverrideType" - x-optionalDataType: "Int64" - - name: "requiredStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as required in Open API definition" - required: true - type: "string" - x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" - - name: "outputOnlyStringViaFieldBehaviorAnnotation" - in: "query" - description: "mark a field as readonly in Open API definition" - required: false - type: "string" - x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" - x-optionalDataType: "String" - - name: "optionalStringValue" - in: "query" - required: false - type: "string" - x-exportParamName: "OptionalStringValue" - x-optionalDataType: "String" - - name: "productId" - in: "query" - description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ - \ are allowed." - required: false - type: "array" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - collectionFormat: "multi" - x-exportParamName: "ProductId" - - name: "optionalStringField" - in: "query" - description: "Test openapiv2 generation of required fields with annotation\ - \ and jsonschema to reproduce" - required: false - type: "string" - x-exportParamName: "OptionalStringField" - x-optionalDataType: "String" - - name: "requiredStringField1" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField1" - - name: "requiredStringField2" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredStringField2" - - name: "required_field_behavior_json_name_custom" - in: "query" - description: "Test openapiv2 handling of required json_name fields" - required: true - type: "string" - x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" - - name: "required_field_schema_json_name_custom" - in: "query" - required: true - type: "string" - x-exportParamName: "RequiredFieldSchemaJsonNameCustom" - - name: "trailingOnly" - in: "query" - description: "Trailing only" - required: false - type: "string" - x-exportParamName: "TrailingOnly" - x-optionalDataType: "String" - - name: "trailingOnlyDot" - in: "query" - description: "Trailing only dot." - required: false - type: "string" - x-exportParamName: "TrailingOnlyDot" - x-optionalDataType: "String" - - name: "trailingBoth" - in: "query" - description: "Leading both\n\nTrailing both." - required: false - type: "string" - x-exportParamName: "TrailingBoth" - x-optionalDataType: "String" - - name: "trailingMultiline" - in: "query" - description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ - \nTrailing multiline." - required: false - type: "string" - x-exportParamName: "TrailingMultiline" - x-optionalDataType: "String" - - name: "uuids" - in: "query" - description: "Specify a custom format of repeated field items" - required: false - type: "array" - items: - type: "string" - format: "uuid" - collectionFormat: "multi" - x-exportParamName: "Uuids" + style: form + explode: true + schema: + type: string + - name: required_field_behavior_json_name_custom + in: query + description: Test openapiv2 handling of required json_name fields + required: true + style: form + explode: true + schema: + type: string + - name: required_field_schema_json_name_custom + in: query + required: true + style: form + explode: true + schema: + type: string + - name: trailingOnly + in: query + description: Trailing only + required: false + style: form + explode: true + schema: + type: string + - name: trailingOnlyDot + in: query + description: Trailing only dot. + required: false + style: form + explode: true + schema: + type: string + - name: trailingBoth + in: query + description: |- + Leading both + + Trailing both. + required: false + style: form + explode: true + schema: + type: string + - name: trailingMultiline + in: query + description: |- + Leading multiline + + This is an example of a multi-line comment. + + Trailing multiline. + required: false + style: form + explode: true + schema: + type: string + - name: uuids + in: query + description: Specify a custom format of repeated field items + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverything" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/a_bit_of_everything/{uuid}: get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_Lookup" + - ABitOfEverything + operationId: ABitOfEverythingService_Lookup parameters: - - name: "uuid" - in: "path" + - name: uuid + in: path required: true - type: "string" - x-exportParamName: "Uuid" + style: simple + explode: false + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverything" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" delete: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_Delete" + - ABitOfEverything + operationId: ABitOfEverythingService_Delete parameters: - - name: "uuid" - in: "path" + - name: uuid + in: path required: true - type: "string" - x-exportParamName: "Uuid" + style: simple + explode: false + schema: + type: string responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" security: - ApiKeyAuth: [] OAuth2: - - "read" - - "write" + - read + - write x-irreversible: true ? /v1/example/a_bit_of_everything_repeated/{pathRepeatedFloatValue}/{pathRepeatedDoubleValue}/{pathRepeatedInt64Value}/{pathRepeatedUint64Value}/{pathRepeatedInt32Value}/{pathRepeatedFixed64Value}/{pathRepeatedFixed32Value}/{pathRepeatedBoolValue}/{pathRepeatedStringValue}/{pathRepeatedBytesValue}/{pathRepeatedUint32Value}/{pathRepeatedEnumValue}/{pathRepeatedSfixed32Value}/{pathRepeatedSfixed64Value}/{pathRepeatedSint32Value}/{pathRepeatedSint64Value} : get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_GetRepeatedQuery" + - ABitOfEverything + operationId: ABitOfEverythingService_GetRepeatedQuery parameters: - - name: "pathRepeatedFloatValue" - in: "path" - description: "repeated values. they are comma-separated in path" - required: true - type: "array" - items: - type: "number" - format: "float" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedFloatValue" - - name: "pathRepeatedDoubleValue" - in: "path" - required: true - type: "array" - items: - type: "number" - format: "double" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedDoubleValue" - - name: "pathRepeatedInt64Value" - in: "path" - required: true - type: "array" - items: - type: "string" - format: "int64" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedInt64Value" - - name: "pathRepeatedUint64Value" - in: "path" - required: true - type: "array" - items: - type: "string" - format: "uint64" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedUint64Value" - - name: "pathRepeatedInt32Value" - in: "path" - required: true - type: "array" - items: - type: "integer" - format: "int32" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedInt32Value" - - name: "pathRepeatedFixed64Value" - in: "path" - required: true - type: "array" - items: - type: "string" - format: "uint64" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedFixed64Value" - - name: "pathRepeatedFixed32Value" - in: "path" - required: true - type: "array" - items: - type: "integer" - format: "int64" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedFixed32Value" - - name: "pathRepeatedBoolValue" - in: "path" - required: true - type: "array" - items: - type: "boolean" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedBoolValue" - - name: "pathRepeatedStringValue" - in: "path" - required: true - type: "array" - items: - type: "string" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedStringValue" - - name: "pathRepeatedBytesValue" - in: "path" - required: true - type: "array" - items: - type: "string" - format: "byte" - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedBytesValue" - - name: "pathRepeatedUint32Value" - in: "path" - required: true - type: "array" - items: - type: "integer" - format: "int64" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedUint32Value" - - name: "pathRepeatedEnumValue" - in: "path" - required: true - type: "array" - items: - type: "string" - enum: - - "ZERO" - - "ONE" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedEnumValue" - - name: "pathRepeatedSfixed32Value" - in: "path" - required: true - type: "array" - items: - type: "integer" - format: "int32" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedSfixed32Value" - - name: "pathRepeatedSfixed64Value" - in: "path" - required: true - type: "array" - items: - type: "string" - format: "int64" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedSfixed64Value" - - name: "pathRepeatedSint32Value" - in: "path" - required: true - type: "array" - items: - type: "integer" - format: "int32" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedSint32Value" - - name: "pathRepeatedSint64Value" - in: "path" - required: true - type: "array" - items: - type: "string" - format: "int64" - collectionFormat: "csv" - minItems: 1 - x-exportParamName: "PathRepeatedSint64Value" + - name: pathRepeatedFloatValue + in: path + description: repeated values. they are comma-separated in path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: number + format: float + - name: pathRepeatedDoubleValue + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: number + format: double + - name: pathRepeatedInt64Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: string + format: int64 + - name: pathRepeatedUint64Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: string + format: uint64 + - name: pathRepeatedInt32Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: integer + format: int32 + - name: pathRepeatedFixed64Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: string + format: uint64 + - name: pathRepeatedFixed32Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: integer + format: int64 + - name: pathRepeatedBoolValue + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: boolean + - name: pathRepeatedStringValue + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: string + - name: pathRepeatedBytesValue + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + format: byte + - name: pathRepeatedUint32Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: integer + format: int64 + - name: pathRepeatedEnumValue + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: string + enum: + - ZERO + - ONE + - name: pathRepeatedSfixed32Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: integer + format: int32 + - name: pathRepeatedSfixed64Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: string + format: int64 + - name: pathRepeatedSint32Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: integer + format: int32 + - name: pathRepeatedSint64Value + in: path + required: true + style: simple + explode: false + schema: + minItems: 1 + type: array + items: + type: string + format: int64 responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverythingRepeated" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverythingRepeated" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverythingRepeated" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/checkStatus: get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_CheckStatus" - parameters: [] + - ABitOfEverything + operationId: ABitOfEverythingService_CheckStatus responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbCheckStatusResponse" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbCheckStatusResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbCheckStatusResponse" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/deep_path/{singleNested.name}: post: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_DeepPathEcho" + - ABitOfEverything + operationId: ABitOfEverythingService_DeepPathEcho parameters: - - name: "singleNested.name" - in: "path" - description: "name is nested field." - required: true - type: "string" - x-exportParamName: "SingleNestedName" - - in: "body" - name: "body" + - name: singleNested.name + in: path + description: name is nested field. required: true + style: simple + explode: false schema: - $ref: "#/definitions/ABitOfEverythingServiceDeepPathEchoBody" - x-exportParamName: "Body" + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ABitOfEverythingServiceDeepPathEchoBody" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/ABitOfEverythingServiceDeepPathEchoBody" + required: true responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbABitOfEverything" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbABitOfEverything" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /v1/example/oneofenum: post: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_PostOneofEnum" - parameters: - - in: "body" - name: "exampleEnum" + - ABitOfEverything + operationId: ABitOfEverythingService_PostOneofEnum + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/oneofenumExampleEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/oneofenumExampleEnum" required: true - schema: - $ref: "#/definitions/oneofenumExampleEnum" - x-exportParamName: "ExampleEnum" responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: exampleEnum /v1/example/requiredmessagetype: post: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_PostRequiredMessageType" - parameters: - - in: "body" - name: "body" + - ABitOfEverything + operationId: ABitOfEverythingService_PostRequiredMessageType + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbRequiredMessageTypeRequest" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbRequiredMessageTypeRequest" required: true - schema: - $ref: "#/definitions/examplepbRequiredMessageTypeRequest" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /v1/example/snake/{who}/{what}/{where}: get: tags: - - "SnakeEnumService" - operationId: "SnakeEnumService_SnakeEnum" + - SnakeEnumService + operationId: SnakeEnumService_SnakeEnum parameters: - - name: "who" - in: "path" - required: true - type: "string" - enum: - - "value_e" - - "value_f" - x-exportParamName: "Who" - - name: "what" - in: "path" - required: true - type: "string" - enum: - - "value_c" - - "value_d" - x-exportParamName: "What" - - name: "where" - in: "path" - required: true - type: "string" - enum: - - "value_x" - - "value_y" - x-exportParamName: "Where" + - name: who + in: path + required: true + style: simple + explode: false + schema: + type: string + enum: + - value_e + - value_f + - name: what + in: path + required: true + style: simple + explode: false + schema: + type: string + enum: + - value_c + - value_d + - name: where + in: path + required: true + style: simple + explode: false + schema: + type: string + enum: + - value_x + - value_y responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSnakeEnumResponse" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSnakeEnumResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbSnakeEnumResponse" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/{book.name}: patch: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_UpdateBook" + - ABitOfEverything + operationId: ABitOfEverythingService_UpdateBook parameters: - - name: "book.name" - in: "path" - description: "The resource name of the book.\n\nFormat: `publishers/{publisher}/books/{book}`\n\ - \nExample: `publishers/1257894000000000000/books/my-book`" - required: true - type: "string" - pattern: "publishers/[^/]+/books/[^/]+" - x-exportParamName: "BookName" - - in: "body" - name: "book" - description: "The book to update.\n\nThe book's `name` field is used to identify\ - \ the book to be updated.\nFormat: publishers/{publisher}/books/{book}" - required: true - schema: - $ref: "The book to update." - x-exportParamName: "Book" - - name: "allowMissing" - in: "query" - description: "If set to true, and the book is not found, a new book will be\ - \ created.\nIn this situation, `update_mask` is ignored." - required: false - type: "boolean" - x-exportParamName: "AllowMissing" - x-optionalDataType: "Bool" + - name: book.name + in: path + description: |- + The resource name of the book. + + Format: `publishers/{publisher}/books/{book}` + + Example: `publishers/1257894000000000000/books/my-book` + required: true + style: simple + explode: false + schema: + pattern: "publishers/[^/]+/books/[^/]+" + type: string + - name: allowMissing + in: query + description: |- + If set to true, and the book is not found, a new book will be created. + In this situation, `update_mask` is ignored. + required: false + style: form + explode: true + schema: + type: boolean + requestBody: + description: |- + The book to update. + + The book's `name` field is used to identify the book to be updated. + Format: publishers/{publisher}/books/{book} + content: + application/json: + schema: + $ref: "#/components/schemas/v1_book_name_body" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/v1_book_name_body_1" + required: true responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbBook" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbBook" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbBook" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: book /v1/{parent}/books: post: tags: - - "ABitOfEverything" - summary: "Create a book." - operationId: "ABitOfEverythingService_CreateBook" + - ABitOfEverything + summary: Create a book. + operationId: ABitOfEverythingService_CreateBook parameters: - - name: "parent" - in: "path" - description: "The publisher in which to create the book.\n\nFormat: `publishers/{publisher}`\n\ - \nExample: `publishers/1257894000000000000`" - required: true - type: "string" - pattern: "publishers/[^/]+" - x-exportParamName: "Parent" - - in: "body" - name: "book" - description: "The book to create." - required: true - schema: - $ref: "#/definitions/examplepbBook" - x-exportParamName: "Book" - - name: "bookId" - in: "query" - description: "The ID to use for the book.\n\nThis must start with an alphanumeric\ - \ character." - required: false - type: "string" - x-exportParamName: "BookId" - x-optionalDataType: "String" + - name: parent + in: path + description: |- + The publisher in which to create the book. + + Format: `publishers/{publisher}` + + Example: `publishers/1257894000000000000` + required: true + style: simple + explode: false + schema: + pattern: "publishers/[^/]+" + type: string + - name: bookId + in: query + description: |- + The ID to use for the book. + + This must start with an alphanumeric character. + required: false + style: form + explode: true + schema: + type: string + requestBody: + description: The book to create. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbBook" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbBook" + required: true responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbBook" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbBook" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbBook" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: book /v2/example/a_bit_of_everything/{uuidName}: put: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_UpdateV2" + - ABitOfEverything + operationId: ABitOfEverythingService_UpdateV2 parameters: - - name: "uuidName" - in: "path" + - name: uuidName + in: path required: true - type: "string" - format: "uuid" + style: simple + explode: false + schema: + type: string + format: uuid + x-internal: true x-internal: true - x-exportParamName: "UuidName" - - in: "body" - name: "abe" - description: "A bit of everything\n\nIntentionally complicated message type\ - \ to cover many features of Protobuf." - required: true - schema: - $ref: "#/definitions/A bit of everything" - x-exportParamName: "Abe" - - name: "updateMask" - in: "query" - description: "The paths to update." - required: false - type: "string" - x-exportParamName: "UpdateMask" - x-optionalDataType: "String" + - name: updateMask + in: query + description: The paths to update. + required: false + style: form + explode: true + schema: + type: string + requestBody: + description: |- + A bit of everything + + Intentionally complicated message type to cover many features of Protobuf. + content: + application/json: + schema: + $ref: "#/components/schemas/A bit of everything" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/A bit of everything_1" + required: true responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: abe patch: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_UpdateV22" + - ABitOfEverything + operationId: ABitOfEverythingService_UpdateV22 parameters: - - name: "uuidName" - in: "path" + - name: uuidName + in: path required: true - type: "string" - format: "uuid" + style: simple + explode: false + schema: + type: string + format: uuid + x-internal: true x-internal: true - x-exportParamName: "UuidName" - - in: "body" - name: "abe" - description: "A bit of everything\n\nIntentionally complicated message type\ - \ to cover many features of Protobuf." + requestBody: + description: |- + A bit of everything + + Intentionally complicated message type to cover many features of Protobuf. + content: + application/json: + schema: + $ref: "#/components/schemas/A bit of everything_2" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/A bit of everything_3" required: true - schema: - $ref: "#/definitions/A bit of everything_1" - x-exportParamName: "Abe" responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: abe /v2/example/echo: get: tags: - - "echo rpc" + - echo rpc summary: "Summary: Echo rpc" - description: "Description Echo" - operationId: "ABitOfEverythingService_Echo3" + description: Description Echo + externalDocs: + description: Find out more Echo + url: https://github.com/grpc-ecosystem/grpc-gateway + operationId: ABitOfEverythingService_Echo3 parameters: - - name: "value" - in: "query" + - name: value + in: query required: false - type: "string" - x-exportParamName: "Value" - x-optionalDataType: "String" + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - examples: - application/json: - value: "the input value" - schema: - $ref: "#/definitions/subStringMessage" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "integer" - format: "integer" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" - 503: - description: "Returned when the resource is temporarily unavailable." - schema: {} + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/subStringMessage" + example: + value: the input value + application/x-foo-mime: + schema: + $ref: "#/components/schemas/subStringMessage" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: integer + format: integer + x-content-type: application/json + application/x-foo-mime: + schema: + type: integer + format: integer + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + "503": + description: Returned when the resource is temporarily unavailable. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object x-number: 100 default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - externalDocs: - description: "Find out more Echo" - url: "https://github.com/grpc-ecosystem/grpc-gateway" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" post: tags: - - "echo rpc" + - echo rpc summary: "Summary: Echo rpc" - description: "Description Echo" - operationId: "ABitOfEverythingService_Echo2" - parameters: - - in: "body" - name: "value" + description: Description Echo + externalDocs: + description: Find out more Echo + url: https://github.com/grpc-ecosystem/grpc-gateway + operationId: ABitOfEverythingService_Echo2 + requestBody: + content: + application/json: + schema: + type: string + application/x-foo-mime: + schema: + type: string required: true - schema: - type: "string" - x-exportParamName: "Value" responses: - 200: - description: "A successful response." - examples: - application/json: - value: "the input value" - schema: - $ref: "#/definitions/subStringMessage" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "integer" - format: "integer" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" - 503: - description: "Returned when the resource is temporarily unavailable." - schema: {} + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/subStringMessage" + example: + value: the input value + application/x-foo-mime: + schema: + $ref: "#/components/schemas/subStringMessage" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: integer + format: integer + x-content-type: application/json + application/x-foo-mime: + schema: + type: integer + format: integer + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + "503": + description: Returned when the resource is temporarily unavailable. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object x-number: 100 default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - externalDocs: - description: "Find out more Echo" - url: "https://github.com/grpc-ecosystem/grpc-gateway" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: value /v2/example/empty: get: tags: - - "camelCaseServiceName" - operationId: "camelCaseServiceName_Empty" - parameters: [] + - camelCaseServiceName + operationId: camelCaseServiceName_Empty responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v2/example/errorwithdetails: get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_ErrorWithDetails" - parameters: [] + - ABitOfEverything + operationId: ABitOfEverythingService_ErrorWithDetails responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v2/example/overwriterequestcontenttype: post: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_OverwriteRequestContentType" - consumes: - - "application/x-bar-mime" - parameters: - - in: "body" - name: "body" + - ABitOfEverything + operationId: ABitOfEverythingService_OverwriteRequestContentType + requestBody: + content: + application/x-bar-mime: + schema: + $ref: "#/components/schemas/examplepbBody" required: true - schema: - $ref: "#/definitions/examplepbBody" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /v2/example/overwriteresponsecontenttype: get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_OverwriteResponseContentType" - produces: - - "application/text" - parameters: [] + - ABitOfEverything + operationId: ABitOfEverythingService_OverwriteResponseContentType responses: - 200: - description: "A successful response." - schema: - type: "string" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/text: + schema: + type: string + x-content-type: application/text + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/text: + schema: + type: object + x-content-type: application/text + "404": + description: Returned when the resource does not exist. + content: + application/text: + schema: + type: string + format: string + x-content-type: application/text + "418": + description: I'm a teapot. + content: + application/text: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/text: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/text: + schema: + $ref: "#/components/schemas/rpcStatus" /v2/example/postwithemptybody/{name}: post: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_PostWithEmptyBody" + - ABitOfEverything + operationId: ABitOfEverythingService_PostWithEmptyBody parameters: - - name: "name" - in: "path" - required: true - type: "string" - x-exportParamName: "Name" - - in: "body" - name: "body" + - name: name + in: path required: true + style: simple + explode: false schema: - $ref: "#/definitions/ABitOfEverythingServicePostWithEmptyBodyBody" - x-exportParamName: "Body" + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ABitOfEverythingServicePostWithEmptyBodyBody" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/ABitOfEverythingServicePostWithEmptyBodyBody" + required: true responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /v2/example/timeout: get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_Timeout" - parameters: [] + - ABitOfEverything + operationId: ABitOfEverythingService_Timeout responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v2/example/withbody/{id}: post: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_GetMessageWithBody" + - ABitOfEverything + operationId: ABitOfEverythingService_GetMessageWithBody parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "data" + - name: id + in: path required: true + style: simple + explode: false schema: - $ref: "#/definitions/examplepbBody" - x-exportParamName: "Data" + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbBody" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbBody" + required: true responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: data /v2/{value}:check: get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_CheckExternalPathEnum" + - ABitOfEverything + operationId: ABitOfEverythingService_CheckExternalPathEnum parameters: - - name: "value" - in: "path" - required: true - type: "string" - enum: - - "ABC" - - "DEF" - x-exportParamName: "Value" + - name: value + in: path + required: true + style: simple + explode: false + schema: + type: string + enum: + - ABC + - DEF responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v2a/example/a_bit_of_everything/{uuidName}: patch: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_UpdateV23" + - ABitOfEverything + operationId: ABitOfEverythingService_UpdateV23 parameters: - - name: "uuidName" - in: "path" + - name: uuidName + in: path required: true - type: "string" - format: "uuid" + style: simple + explode: false + schema: + type: string + format: uuid + x-internal: true x-internal: true - x-exportParamName: "UuidName" - - in: "body" - name: "body" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ABitOfEverythingServiceUpdateV2Body" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/ABitOfEverythingServiceUpdateV2Body" required: true - schema: - $ref: "#/definitions/ABitOfEverythingServiceUpdateV2Body" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /v3/{value}:check: get: tags: - - "ABitOfEverything" - operationId: "ABitOfEverythingService_CheckExternalNestedPathEnum" + - ABitOfEverything + operationId: ABitOfEverythingService_CheckExternalNestedPathEnum parameters: - - name: "value" - in: "path" - required: true - type: "string" - enum: - - "GHI" - - "JKL" - x-exportParamName: "Value" + - name: value + in: path + required: true + style: simple + explode: false + schema: + type: string + enum: + - GHI + - JKL responses: - 200: - description: "A successful response." - schema: - type: "object" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" - 418: - description: "I'm a teapot." - schema: - $ref: "#/definitions/examplepbNumericEnum" - 500: - description: "Server error" - schema: - $ref: "#/definitions/examplepbErrorResponse" + "200": + description: A successful response. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string + "418": + description: I'm a teapot. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbNumericEnum" + "500": + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbErrorResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" -securityDefinitions: - ApiKeyAuth: - type: "apiKey" - name: "X-API-Key" - in: "header" - x-amazon-apigateway-authorizer: - authorizerResultTtlInSeconds: 60 - type: "token" - x-amazon-apigateway-authtype: "oauth2" - BasicAuth: - type: "basic" - OAuth2: - type: "oauth2" - authorizationUrl: "https://example.com/oauth/authorize" - tokenUrl: "https://example.com/oauth/token" - flow: "accessCode" - scopes: - admin: "Grants read and write access to administrative information" - read: "Grants read access" - write: "Grants write access" -definitions: - ABitOfEverythingNested: - type: "object" - properties: - name: - type: "string" - description: "name is nested field." - amount: - type: "integer" - format: "int64" - ok: - description: "DeepEnum description." - $ref: "#/definitions/NestedDeepEnum" - description: "Nested is nested type." - example: - ok: "TRUE" - ABitOfEverythingServiceDeepPathEchoBody: - type: "object" - required: - - "doubleValue" - - "floatValue" - - "int64Value" - - "requiredStringField1" - - "requiredStringField2" - - "requiredStringViaFieldBehaviorAnnotation" - - "required_field_behavior_json_name_custom" - - "required_field_schema_json_name_custom" - - "uuid" - properties: - singleNested: - $ref: "#/definitions/ABitOfEverythingServiceDeepPathEchoBody_singleNested" - uuid: - type: "string" - format: "uuid" - minLength: 1 - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - x-internal: true - nested: - type: "array" - items: - $ref: "#/definitions/ABitOfEverythingNested" - floatValue: - type: "number" - format: "float" - description: "Float value field" - default: 0.2 - doubleValue: - type: "number" - format: "double" - int64Value: - type: "string" - format: "int64" - uint64Value: - type: "string" - format: "uint64" - int32Value: - type: "integer" - format: "int32" - fixed64Value: - type: "string" - format: "uint64" - fixed32Value: - type: "integer" - format: "int64" - boolValue: - type: "boolean" - stringValue: - type: "string" - bytesValue: - type: "string" - format: "byte" - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - uint32Value: - type: "integer" - format: "int64" - enumValue: - $ref: "#/definitions/examplepbNumericEnum" - pathEnumValue: - $ref: "#/definitions/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/definitions/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: "integer" - format: "int32" - sfixed64Value: - type: "string" - format: "int64" - sint32Value: - type: "integer" - format: "int32" - sint64Value: - type: "string" - format: "int64" - repeatedStringValue: - type: "array" - items: - type: "string" - oneofEmpty: - type: "object" - properties: {} - oneofString: - type: "string" - mapValue: - type: "object" - title: "map of numeric enum" - additionalProperties: - $ref: "#/definitions/examplepbNumericEnum" - mappedStringValue: - type: "object" - description: "Map of string description." - title: "Map of string title" - additionalProperties: - type: "string" - mappedNestedValue: - type: "object" - additionalProperties: - $ref: "#/definitions/ABitOfEverythingNested" - nonConventionalNameValue: - type: "string" - timestampValue: - type: "string" - format: "date-time" - repeatedEnumValue: - type: "array" - title: "repeated enum value. it is comma-separated in query" - items: - $ref: "#/definitions/examplepbNumericEnum" - repeatedEnumAnnotation: - type: "array" - description: "Repeated numeric enum description." - title: "Repeated numeric enum title" - items: - $ref: "#/definitions/examplepbNumericEnum" - enumValueAnnotation: - description: "Numeric enum description." - title: "Numeric enum title" - $ref: "#/definitions/examplepbNumericEnum" - repeatedStringAnnotation: - type: "array" - description: "Repeated string description." - title: "Repeated string title" - items: - type: "string" - repeatedNestedAnnotation: - type: "array" - description: "Repeated nested object description." - title: "Repeated nested object title" - items: - $ref: "#/definitions/ABitOfEverythingNested" - nestedAnnotation: - description: "Nested object description." - title: "Nested object title" - $ref: "#/definitions/ABitOfEverythingNested" - int64OverrideType: - type: "integer" - format: "int64" - requiredStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as required in Open API definition" - outputOnlyStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as readonly in Open API definition" - readOnly: true - optionalStringValue: - type: "string" - productId: - type: "array" - description: "Only digits are allowed." - title: "Test openapiv2 generation of repeated fields" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - optionalStringField: - type: "string" - title: "Test openapiv2 generation of required fields with annotation and jsonschema\ - \ to reproduce" - requiredStringField1: - type: "string" - requiredStringField2: - type: "string" - required_field_behavior_json_name_custom: - type: "string" - title: "Test openapiv2 handling of required json_name fields" - required_field_schema_json_name_custom: - type: "string" - trailingOnly: - type: "string" - title: "Trailing only" - trailingOnlyDot: - type: "string" - description: "Trailing only dot." - trailingBoth: - type: "string" - description: "Trailing both." - title: "Leading both" - trailingMultiline: - type: "string" - description: "This is an example of a multi-line comment.\n\nTrailing multiline." - title: "Leading multiline" - uuids: - type: "array" - title: "Specify a custom format of repeated field items" - items: - type: "string" - format: "uuid" - externalDocs: - description: "Find out more about ABitOfEverything" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - title: "A bit of everything" - description: "Intentionally complicated message type to cover many features of\ - \ Protobuf." - example: - int64_value: 12 - double_value: 12.3 - x-a-bit-of-everything-foo: "bar" - ABitOfEverythingServicePostWithEmptyBodyBody: - type: "object" - ABitOfEverythingServiceUpdateV2Body: - type: "object" - properties: - abe: - $ref: "#/definitions/A bit of everything_2" - updateMask: - type: "string" - description: "The paths to update." - title: "UpdateV2Request request for update includes the message and the update\ - \ mask" - example: - abe: "{\"int64_value\":12,\"double_value\":12.3}" - updateMask: "updateMask" - MessagePathEnumNestedPathEnum: - type: "string" - enum: - - "GHI" - - "JKL" - default: "GHI" - NestedDeepEnum: - type: "string" - description: "DeepEnum is one or zero.\n\n - FALSE: FALSE is false.\n - TRUE:\ - \ TRUE is true." - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - examplepbABitOfEverything: - type: "object" - required: - - "doubleValue" - - "floatValue" - - "int64Value" - - "requiredStringField1" - - "requiredStringField2" - - "requiredStringViaFieldBehaviorAnnotation" - - "required_field_behavior_json_name_custom" - - "required_field_schema_json_name_custom" - - "uuid" - properties: - singleNested: - $ref: "#/definitions/ABitOfEverythingNested" - uuid: - type: "string" - format: "uuid" - minLength: 1 - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - x-internal: true - nested: - type: "array" - items: - $ref: "#/definitions/ABitOfEverythingNested" - floatValue: - type: "number" - format: "float" - description: "Float value field" - default: 0.2 - doubleValue: - type: "number" - format: "double" - int64Value: - type: "string" - format: "int64" - uint64Value: - type: "string" - format: "uint64" - int32Value: - type: "integer" - format: "int32" - fixed64Value: - type: "string" - format: "uint64" - fixed32Value: - type: "integer" - format: "int64" - boolValue: - type: "boolean" - stringValue: - type: "string" - bytesValue: - type: "string" - format: "byte" - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - uint32Value: - type: "integer" - format: "int64" - enumValue: - $ref: "#/definitions/examplepbNumericEnum" - pathEnumValue: - $ref: "#/definitions/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/definitions/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: "integer" - format: "int32" - sfixed64Value: - type: "string" - format: "int64" - sint32Value: - type: "integer" - format: "int32" - sint64Value: - type: "string" - format: "int64" - repeatedStringValue: - type: "array" - items: - type: "string" - oneofEmpty: - type: "object" - properties: {} - oneofString: - type: "string" - mapValue: - type: "object" - title: "map of numeric enum" - additionalProperties: - $ref: "#/definitions/examplepbNumericEnum" - mappedStringValue: - type: "object" - description: "Map of string description." - title: "Map of string title" - additionalProperties: - type: "string" - mappedNestedValue: - type: "object" - additionalProperties: - $ref: "#/definitions/ABitOfEverythingNested" - nonConventionalNameValue: - type: "string" - timestampValue: - type: "string" - format: "date-time" - repeatedEnumValue: - type: "array" - title: "repeated enum value. it is comma-separated in query" - items: - $ref: "#/definitions/examplepbNumericEnum" - repeatedEnumAnnotation: - type: "array" - description: "Repeated numeric enum description." - title: "Repeated numeric enum title" - items: - $ref: "#/definitions/examplepbNumericEnum" - enumValueAnnotation: - description: "Numeric enum description." - title: "Numeric enum title" - $ref: "#/definitions/examplepbNumericEnum" - repeatedStringAnnotation: - type: "array" - description: "Repeated string description." - title: "Repeated string title" - items: - type: "string" - repeatedNestedAnnotation: - type: "array" - description: "Repeated nested object description." - title: "Repeated nested object title" - items: - $ref: "#/definitions/ABitOfEverythingNested" - nestedAnnotation: - description: "Nested object description." - title: "Nested object title" - $ref: "#/definitions/ABitOfEverythingNested" - int64OverrideType: - type: "integer" - format: "int64" - requiredStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as required in Open API definition" - outputOnlyStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as readonly in Open API definition" - readOnly: true - optionalStringValue: - type: "string" - productId: - type: "array" - description: "Only digits are allowed." - title: "Test openapiv2 generation of repeated fields" - items: - type: "string" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" +components: + schemas: + ABitOfEverythingNested: + type: object + properties: + name: + type: string + description: name is nested field. + amount: + type: integer + format: int64 + ok: + $ref: "#/components/schemas/NestedDeepEnum" + description: Nested is nested type. + example: + ok: "TRUE" + ABitOfEverythingServiceDeepPathEchoBody: + title: A bit of everything + required: + - doubleValue + - floatValue + - int64Value + - requiredStringField1 + - requiredStringField2 + - requiredStringViaFieldBehaviorAnnotation + - required_field_behavior_json_name_custom + - required_field_schema_json_name_custom + - uuid + type: object + properties: + singleNested: + $ref: "#/components/schemas/ABitOfEverythingServiceDeepPathEchoBody_singleNested" + uuid: minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - optionalStringField: - type: "string" - title: "Test openapiv2 generation of required fields with annotation and jsonschema\ - \ to reproduce" - requiredStringField1: - type: "string" - requiredStringField2: - type: "string" - required_field_behavior_json_name_custom: - type: "string" - title: "Test openapiv2 handling of required json_name fields" - required_field_schema_json_name_custom: - type: "string" - trailingOnly: - type: "string" - title: "Trailing only" - trailingOnlyDot: - type: "string" - description: "Trailing only dot." - trailingBoth: - type: "string" - description: "Trailing both." - title: "Leading both" - trailingMultiline: - type: "string" - description: "This is an example of a multi-line comment.\n\nTrailing multiline." - title: "Leading multiline" - uuids: - type: "array" - title: "Specify a custom format of repeated field items" - items: - type: "string" - format: "uuid" - externalDocs: - description: "Find out more about ABitOfEverything" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - title: "A bit of everything" - description: "Intentionally complicated message type to cover many features of\ - \ Protobuf." - example: - int64_value: 12 - double_value: 12.3 - x-a-bit-of-everything-foo: "bar" - examplepbABitOfEverythingRepeated: - type: "object" - properties: - pathRepeatedFloatValue: - type: "array" - title: "repeated values. they are comma-separated in path" - items: - type: "number" - format: "float" - pathRepeatedDoubleValue: - type: "array" - items: - type: "number" - format: "double" - pathRepeatedInt64Value: - type: "array" - items: - type: "string" - format: "int64" - pathRepeatedUint64Value: - type: "array" - items: - type: "string" - format: "uint64" - pathRepeatedInt32Value: - type: "array" - items: - type: "integer" - format: "int32" - pathRepeatedFixed64Value: - type: "array" - items: - type: "string" - format: "uint64" - pathRepeatedFixed32Value: - type: "array" - items: - type: "integer" - format: "int64" - pathRepeatedBoolValue: - type: "array" - items: - type: "boolean" - pathRepeatedStringValue: - type: "array" - items: - type: "string" - pathRepeatedBytesValue: - type: "array" - items: - type: "string" - format: "byte" + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + type: string + format: uuid + x-internal: true + nested: + type: array + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + floatValue: + type: number + description: Float value field + format: float + default: 0.2 + doubleValue: + type: number + format: double + int64Value: + type: string + format: int64 + uint64Value: + type: string + format: uint64 + int32Value: + type: integer + format: int32 + fixed64Value: + type: string + format: uint64 + fixed32Value: + type: integer + format: int64 + boolValue: + type: boolean + stringValue: + type: string + bytesValue: pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - pathRepeatedUint32Value: - type: "array" - items: - type: "integer" - format: "int64" - pathRepeatedEnumValue: - type: "array" - items: - $ref: "#/definitions/examplepbNumericEnum" - pathRepeatedSfixed32Value: - type: "array" - items: - type: "integer" - format: "int32" - pathRepeatedSfixed64Value: - type: "array" - items: - type: "string" - format: "int64" - pathRepeatedSint32Value: - type: "array" - items: - type: "integer" - format: "int32" - pathRepeatedSint64Value: - type: "array" - items: - type: "string" - format: "int64" - title: "ABitOfEverythingRepeated is used to validate repeated path parameter functionality" - example: - path_repeated_bool_value: - - true - - true - - false - - true - path_repeated_int32_value: - - 1 - - 2 - - 3 - examplepbABitOfEverythingServiceUpdateBody: - type: "object" - required: - - "doubleValue" - - "floatValue" - - "int64Value" - - "requiredStringField1" - - "requiredStringField2" - - "requiredStringViaFieldBehaviorAnnotation" - - "required_field_behavior_json_name_custom" - - "required_field_schema_json_name_custom" - properties: - singleNested: - $ref: "#/definitions/ABitOfEverythingNested" - nested: - type: "array" - items: - $ref: "#/definitions/ABitOfEverythingNested" - floatValue: - type: "number" - format: "float" - description: "Float value field" - default: 0.2 - doubleValue: - type: "number" - format: "double" - int64Value: - type: "string" - format: "int64" - uint64Value: - type: "string" - format: "uint64" - int32Value: - type: "integer" - format: "int32" - fixed64Value: - type: "string" - format: "uint64" - fixed32Value: - type: "integer" - format: "int64" - boolValue: - type: "boolean" - stringValue: - type: "string" - bytesValue: - type: "string" - format: "byte" - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - uint32Value: - type: "integer" - format: "int64" - enumValue: - $ref: "#/definitions/examplepbNumericEnum" - pathEnumValue: - $ref: "#/definitions/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/definitions/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: "integer" - format: "int32" - sfixed64Value: - type: "string" - format: "int64" - sint32Value: - type: "integer" - format: "int32" - sint64Value: - type: "string" - format: "int64" - repeatedStringValue: - type: "array" - items: - type: "string" - oneofEmpty: - type: "object" - properties: {} - oneofString: - type: "string" - mapValue: - type: "object" - title: "map of numeric enum" - additionalProperties: - $ref: "#/definitions/examplepbNumericEnum" - mappedStringValue: - type: "object" - description: "Map of string description." - title: "Map of string title" - additionalProperties: - type: "string" - mappedNestedValue: - type: "object" - additionalProperties: - $ref: "#/definitions/ABitOfEverythingNested" - nonConventionalNameValue: - type: "string" - timestampValue: - type: "string" - format: "date-time" - repeatedEnumValue: - type: "array" - title: "repeated enum value. it is comma-separated in query" - items: - $ref: "#/definitions/examplepbNumericEnum" - repeatedEnumAnnotation: - type: "array" - description: "Repeated numeric enum description." - title: "Repeated numeric enum title" - items: - $ref: "#/definitions/examplepbNumericEnum" - enumValueAnnotation: - description: "Numeric enum description." - title: "Numeric enum title" - $ref: "#/definitions/examplepbNumericEnum" - repeatedStringAnnotation: - type: "array" - description: "Repeated string description." - title: "Repeated string title" - items: - type: "string" - repeatedNestedAnnotation: - type: "array" - description: "Repeated nested object description." - title: "Repeated nested object title" - items: - $ref: "#/definitions/ABitOfEverythingNested" - nestedAnnotation: - description: "Nested object description." - title: "Nested object title" - $ref: "#/definitions/ABitOfEverythingNested" - int64OverrideType: - type: "integer" - format: "int64" - requiredStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as required in Open API definition" - outputOnlyStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as readonly in Open API definition" - readOnly: true - optionalStringValue: - type: "string" - productId: - type: "array" - description: "Only digits are allowed." - title: "Test openapiv2 generation of repeated fields" - items: - type: "string" + type: string + format: byte + uint32Value: + type: integer + format: int64 + enumValue: + $ref: "#/components/schemas/examplepbNumericEnum" + pathEnumValue: + $ref: "#/components/schemas/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: integer + format: int32 + sfixed64Value: + type: string + format: int64 + sint32Value: + type: integer + format: int32 + sint64Value: + type: string + format: int64 + repeatedStringValue: + type: array + items: + type: string + oneofEmpty: + type: object + properties: {} + oneofString: + type: string + mapValue: + title: map of numeric enum + type: object + additionalProperties: + $ref: "#/components/schemas/examplepbNumericEnum" + mappedStringValue: + title: Map of string title + type: object + additionalProperties: + type: string + description: Map of string description. + mappedNestedValue: + type: object + additionalProperties: + $ref: "#/components/schemas/ABitOfEverythingNested" + nonConventionalNameValue: + type: string + timestampValue: + type: string + format: date-time + repeatedEnumValue: + title: repeated enum value. it is comma-separated in query + type: array + items: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedEnumAnnotation: + title: Repeated numeric enum title + type: array + description: Repeated numeric enum description. + items: + $ref: "#/components/schemas/examplepbNumericEnum" + enumValueAnnotation: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedStringAnnotation: + title: Repeated string title + type: array + description: Repeated string description. + items: + type: string + repeatedNestedAnnotation: + title: Repeated nested object title + type: array + description: Repeated nested object description. + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + nestedAnnotation: + $ref: "#/components/schemas/ABitOfEverythingNested" + int64OverrideType: + type: integer + format: int64 + requiredStringViaFieldBehaviorAnnotation: + title: mark a field as required in Open API definition + type: string + outputOnlyStringViaFieldBehaviorAnnotation: + title: mark a field as readonly in Open API definition + type: string + readOnly: true + optionalStringValue: + type: string + productId: + title: Test openapiv2 generation of repeated fields + type: array + description: Only digits are allowed. + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + optionalStringField: + title: Test openapiv2 generation of required fields with annotation and + jsonschema to reproduce + type: string + requiredStringField1: + type: string + requiredStringField2: + type: string + required_field_behavior_json_name_custom: + title: Test openapiv2 handling of required json_name fields + type: string + required_field_schema_json_name_custom: + type: string + trailingOnly: + title: Trailing only + type: string + trailingOnlyDot: + type: string + description: Trailing only dot. + trailingBoth: + title: Leading both + type: string + description: Trailing both. + trailingMultiline: + title: Leading multiline + type: string + description: |- + This is an example of a multi-line comment. + + Trailing multiline. + uuids: + title: Specify a custom format of repeated field items + type: array + items: + type: string + format: uuid + description: Intentionally complicated message type to cover many features of + Protobuf. + example: + int64_value: 12 + double_value: 12.3 + externalDocs: + description: Find out more about ABitOfEverything + url: https://github.com/grpc-ecosystem/grpc-gateway + x-a-bit-of-everything-foo: bar + ABitOfEverythingServicePostWithEmptyBodyBody: + type: object + ABitOfEverythingServiceUpdateV2Body: + title: UpdateV2Request request for update includes the message and the update + mask + type: object + properties: + abe: + $ref: "#/components/schemas/A bit of everything_4" + updateMask: + type: string + description: The paths to update. + MessagePathEnumNestedPathEnum: + type: string + enum: + - GHI + - JKL + default: GHI + NestedDeepEnum: + type: string + description: |- + DeepEnum is one or zero. + + - FALSE: FALSE is false. + - TRUE: TRUE is true. + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + examplepbABitOfEverything: + title: A bit of everything + required: + - doubleValue + - floatValue + - int64Value + - requiredStringField1 + - requiredStringField2 + - requiredStringViaFieldBehaviorAnnotation + - required_field_behavior_json_name_custom + - required_field_schema_json_name_custom + - uuid + type: object + properties: + singleNested: + $ref: "#/components/schemas/ABitOfEverythingNested" + uuid: minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - optionalStringField: - type: "string" - title: "Test openapiv2 generation of required fields with annotation and jsonschema\ - \ to reproduce" - requiredStringField1: - type: "string" - requiredStringField2: - type: "string" - required_field_behavior_json_name_custom: - type: "string" - title: "Test openapiv2 handling of required json_name fields" - required_field_schema_json_name_custom: - type: "string" - trailingOnly: - type: "string" - title: "Trailing only" - trailingOnlyDot: - type: "string" - description: "Trailing only dot." - trailingBoth: - type: "string" - description: "Trailing both." - title: "Leading both" - trailingMultiline: - type: "string" - description: "This is an example of a multi-line comment.\n\nTrailing multiline." - title: "Leading multiline" - uuids: - type: "array" - title: "Specify a custom format of repeated field items" - items: - type: "string" - format: "uuid" - externalDocs: - description: "Find out more about ABitOfEverything" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - title: "A bit of everything" - description: "Intentionally complicated message type to cover many features of\ - \ Protobuf." - example: - int64_value: 12 - double_value: 12.3 - x-a-bit-of-everything-foo: "bar" - examplepbBar: - type: "object" - required: - - "id" - properties: - id: - type: "string" - examplepbBody: - type: "object" - properties: - name: - type: "string" - examplepbBook: - type: "object" - properties: - name: - type: "string" - description: "The resource name of the book.\n\nFormat: `publishers/{publisher}/books/{book}`\n\ - \nExample: `publishers/1257894000000000000/books/my-book`" - id: - type: "string" - description: "Output only. The book's ID." - readOnly: true - createTime: - type: "string" - format: "date-time" - description: "Output only. Creation time of the book." - readOnly: true - description: "An example resource type from AIP-123 used to test the behavior\ - \ described in\nthe CreateBookRequest message.\n\nSee: https://google.aip.dev/123" - example: - createTime: "2000-01-23T04:56:07.000+00:00" - name: "name" - id: "id" - examplepbCheckStatusResponse: - type: "object" - properties: - status: - $ref: "#/definitions/rpcStatus" - example: - status: + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + type: string + format: uuid + x-internal: true + nested: + type: array + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + floatValue: + type: number + description: Float value field + format: float + default: 0.2 + doubleValue: + type: number + format: double + int64Value: + type: string + format: int64 + uint64Value: + type: string + format: uint64 + int32Value: + type: integer + format: int32 + fixed64Value: + type: string + format: uint64 + fixed32Value: + type: integer + format: int64 + boolValue: + type: boolean + stringValue: + type: string + bytesValue: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + format: byte + uint32Value: + type: integer + format: int64 + enumValue: + $ref: "#/components/schemas/examplepbNumericEnum" + pathEnumValue: + $ref: "#/components/schemas/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: integer + format: int32 + sfixed64Value: + type: string + format: int64 + sint32Value: + type: integer + format: int32 + sint64Value: + type: string + format: int64 + repeatedStringValue: + type: array + items: + type: string + oneofEmpty: + type: object + properties: {} + oneofString: + type: string + mapValue: + title: map of numeric enum + type: object + additionalProperties: + $ref: "#/components/schemas/examplepbNumericEnum" + mappedStringValue: + title: Map of string title + type: object + additionalProperties: + type: string + description: Map of string description. + mappedNestedValue: + type: object + additionalProperties: + $ref: "#/components/schemas/ABitOfEverythingNested" + nonConventionalNameValue: + type: string + timestampValue: + type: string + format: date-time + repeatedEnumValue: + title: repeated enum value. it is comma-separated in query + type: array + items: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedEnumAnnotation: + title: Repeated numeric enum title + type: array + description: Repeated numeric enum description. + items: + $ref: "#/components/schemas/examplepbNumericEnum" + enumValueAnnotation: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedStringAnnotation: + title: Repeated string title + type: array + description: Repeated string description. + items: + type: string + repeatedNestedAnnotation: + title: Repeated nested object title + type: array + description: Repeated nested object description. + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + nestedAnnotation: + $ref: "#/components/schemas/ABitOfEverythingNested" + int64OverrideType: + type: integer + format: int64 + requiredStringViaFieldBehaviorAnnotation: + title: mark a field as required in Open API definition + type: string + outputOnlyStringViaFieldBehaviorAnnotation: + title: mark a field as readonly in Open API definition + type: string + readOnly: true + optionalStringValue: + type: string + productId: + title: Test openapiv2 generation of repeated fields + type: array + description: Only digits are allowed. + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + optionalStringField: + title: Test openapiv2 generation of required fields with annotation and + jsonschema to reproduce + type: string + requiredStringField1: + type: string + requiredStringField2: + type: string + required_field_behavior_json_name_custom: + title: Test openapiv2 handling of required json_name fields + type: string + required_field_schema_json_name_custom: + type: string + trailingOnly: + title: Trailing only + type: string + trailingOnlyDot: + type: string + description: Trailing only dot. + trailingBoth: + title: Leading both + type: string + description: Trailing both. + trailingMultiline: + title: Leading multiline + type: string + description: |- + This is an example of a multi-line comment. + + Trailing multiline. + uuids: + title: Specify a custom format of repeated field items + type: array + items: + type: string + format: uuid + description: Intentionally complicated message type to cover many features of + Protobuf. + example: + int64_value: 12 + double_value: 12.3 + externalDocs: + description: Find out more about ABitOfEverything + url: https://github.com/grpc-ecosystem/grpc-gateway + x-a-bit-of-everything-foo: bar + examplepbABitOfEverythingRepeated: + title: ABitOfEverythingRepeated is used to validate repeated path parameter + functionality + type: object + properties: + pathRepeatedFloatValue: + title: repeated values. they are comma-separated in path + type: array + items: + type: number + format: float + pathRepeatedDoubleValue: + type: array + items: + type: number + format: double + pathRepeatedInt64Value: + type: array + items: + type: string + format: int64 + pathRepeatedUint64Value: + type: array + items: + type: string + format: uint64 + pathRepeatedInt32Value: + type: array + items: + type: integer + format: int32 + pathRepeatedFixed64Value: + type: array + items: + type: string + format: uint64 + pathRepeatedFixed32Value: + type: array + items: + type: integer + format: int64 + pathRepeatedBoolValue: + type: array + items: + type: boolean + pathRepeatedStringValue: + type: array + items: + type: string + pathRepeatedBytesValue: + type: array + items: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + format: byte + pathRepeatedUint32Value: + type: array + items: + type: integer + format: int64 + pathRepeatedEnumValue: + type: array + items: + $ref: "#/components/schemas/examplepbNumericEnum" + pathRepeatedSfixed32Value: + type: array + items: + type: integer + format: int32 + pathRepeatedSfixed64Value: + type: array + items: + type: string + format: int64 + pathRepeatedSint32Value: + type: array + items: + type: integer + format: int32 + pathRepeatedSint64Value: + type: array + items: + type: string + format: int64 + example: + path_repeated_bool_value: + - true + - true + - false + - true + path_repeated_int32_value: + - 1 + - 2 + - 3 + examplepbABitOfEverythingServiceUpdateBody: + title: A bit of everything + required: + - doubleValue + - floatValue + - int64Value + - requiredStringField1 + - requiredStringField2 + - requiredStringViaFieldBehaviorAnnotation + - required_field_behavior_json_name_custom + - required_field_schema_json_name_custom + type: object + properties: + singleNested: + $ref: "#/components/schemas/ABitOfEverythingNested" + nested: + type: array + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + floatValue: + type: number + description: Float value field + format: float + default: 0.2 + doubleValue: + type: number + format: double + int64Value: + type: string + format: int64 + uint64Value: + type: string + format: uint64 + int32Value: + type: integer + format: int32 + fixed64Value: + type: string + format: uint64 + fixed32Value: + type: integer + format: int64 + boolValue: + type: boolean + stringValue: + type: string + bytesValue: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + format: byte + uint32Value: + type: integer + format: int64 + enumValue: + $ref: "#/components/schemas/examplepbNumericEnum" + pathEnumValue: + $ref: "#/components/schemas/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: integer + format: int32 + sfixed64Value: + type: string + format: int64 + sint32Value: + type: integer + format: int32 + sint64Value: + type: string + format: int64 + repeatedStringValue: + type: array + items: + type: string + oneofEmpty: + type: object + properties: {} + oneofString: + type: string + mapValue: + title: map of numeric enum + type: object + additionalProperties: + $ref: "#/components/schemas/examplepbNumericEnum" + mappedStringValue: + title: Map of string title + type: object + additionalProperties: + type: string + description: Map of string description. + mappedNestedValue: + type: object + additionalProperties: + $ref: "#/components/schemas/ABitOfEverythingNested" + nonConventionalNameValue: + type: string + timestampValue: + type: string + format: date-time + repeatedEnumValue: + title: repeated enum value. it is comma-separated in query + type: array + items: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedEnumAnnotation: + title: Repeated numeric enum title + type: array + description: Repeated numeric enum description. + items: + $ref: "#/components/schemas/examplepbNumericEnum" + enumValueAnnotation: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedStringAnnotation: + title: Repeated string title + type: array + description: Repeated string description. + items: + type: string + repeatedNestedAnnotation: + title: Repeated nested object title + type: array + description: Repeated nested object description. + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + nestedAnnotation: + $ref: "#/components/schemas/ABitOfEverythingNested" + int64OverrideType: + type: integer + format: int64 + requiredStringViaFieldBehaviorAnnotation: + title: mark a field as required in Open API definition + type: string + outputOnlyStringViaFieldBehaviorAnnotation: + title: mark a field as readonly in Open API definition + type: string + readOnly: true + optionalStringValue: + type: string + productId: + title: Test openapiv2 generation of repeated fields + type: array + description: Only digits are allowed. + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + optionalStringField: + title: Test openapiv2 generation of required fields with annotation and + jsonschema to reproduce + type: string + requiredStringField1: + type: string + requiredStringField2: + type: string + required_field_behavior_json_name_custom: + title: Test openapiv2 handling of required json_name fields + type: string + required_field_schema_json_name_custom: + type: string + trailingOnly: + title: Trailing only + type: string + trailingOnlyDot: + type: string + description: Trailing only dot. + trailingBoth: + title: Leading both + type: string + description: Trailing both. + trailingMultiline: + title: Leading multiline + type: string + description: |- + This is an example of a multi-line comment. + + Trailing multiline. + uuids: + title: Specify a custom format of repeated field items + type: array + items: + type: string + format: uuid + description: Intentionally complicated message type to cover many features of + Protobuf. + example: + int64_value: 12 + double_value: 12.3 + externalDocs: + description: Find out more about ABitOfEverything + url: https://github.com/grpc-ecosystem/grpc-gateway + x-a-bit-of-everything-foo: bar + examplepbBar: + required: + - id + type: object + properties: + id: + type: string + examplepbBody: + type: object + properties: + name: + type: string + examplepbBook: + type: object + properties: + name: + type: string + description: |- + The resource name of the book. + + Format: `publishers/{publisher}/books/{book}` + + Example: `publishers/1257894000000000000/books/my-book` + id: + type: string + description: Output only. The book's ID. + readOnly: true + createTime: + type: string + description: Output only. Creation time of the book. + format: date-time + readOnly: true + description: |- + An example resource type from AIP-123 used to test the behavior described in + the CreateBookRequest message. + + See: https://google.aip.dev/123 + example: + createTime: 2000-01-23T04:56:07.000+00:00 + name: name + id: id + examplepbCheckStatusResponse: + type: object + properties: + status: + $ref: "#/components/schemas/rpcStatus" + example: + status: + code: 0 + details: + - key: {} + - key: {} + message: message + examplepbErrorObject: + type: object + properties: + code: + title: code + type: integer + description: Response code + format: integer + message: + title: message + pattern: "^[a-zA-Z0-9]{1, 32}$" + type: string + description: Response message + examplepbErrorResponse: + type: object + properties: + correlationId: + title: x-correlation-id + pattern: "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$" + type: string + description: Unique event identifier for server requests + format: uuid + example: 2438ac3c-37eb-4902-adef-ed16b4431030 + error: + $ref: "#/components/schemas/examplepbErrorObject" + examplepbNumericEnum: + title: NumericEnum + type: string + description: NumericEnum is one or zero. + example: ZERO + externalDocs: + description: Find out more about ABitOfEverything + url: https://github.com/grpc-ecosystem/grpc-gateway + enum: + - ZERO + - ONE + default: ZERO + x-a-bit-of-everything-foo: bar + examplepbRequiredMessageTypeRequest: + title: |- + Required message type -> OpenAPI + https://github.com/grpc-ecosystem/grpc-gateway/issues/2837 + required: + - foo + - id + type: object + properties: + id: + type: string + foo: + $ref: "#/components/schemas/protoexamplepbFoo" + examplepbSnakeEnumResponse: + type: object + examplepbsnake_case_0_enum: + title: |- + Ignoring lint warnings as this enum type exist to validate proper functionality + for projects that don't follow these lint rules. + buf:lint:ignore ENUM_PASCAL_CASE + type: string + description: |- + - value_e: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + - value_f: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + enum: + - value_e + - value_f + default: value_e + examplepbsnake_case_enum: + title: |- + Ignoring lint warnings as this enum type exist to validate proper functionality + for projects that don't follow these lint rules. + buf:lint:ignore ENUM_PASCAL_CASE + type: string + description: |- + - value_c: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + - value_d: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + enum: + - value_c + - value_d + default: value_c + oneofenumExampleEnum: + type: string + enum: + - EXAMPLE_ENUM_UNSPECIFIED + - EXAMPLE_ENUM_FIRST + default: EXAMPLE_ENUM_UNSPECIFIED + pathenumPathEnum: + type: string + enum: + - ABC + - DEF + default: ABC + pathenumsnake_case_for_import: + title: |- + Ignoring lint warnings as this enum type exist to validate proper functionality + for projects that don't follow these lint rules. + buf:lint:ignore ENUM_PASCAL_CASE + type: string + description: |- + - value_x: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + - value_y: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + enum: + - value_x + - value_y + default: value_x + protobufAny: + type: object + properties: + '@type': + type: string + description: |- + A URL/resource name that uniquely identifies the type of the serialized + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a canonical form + (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that they + expect it to use in the context of Any. However, for URLs which use the + scheme `http`, `https`, or no scheme, one can optionally set up a type + server that maps type URLs to message definitions as follows: + + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. As of May 2023, there are no widely used type server + implementations and no plans to implement one. + + Schemes other than `http`, `https` (or the empty scheme) might be + used with implementation specific semantics. + additionalProperties: + type: object + description: |- + `Any` contains an arbitrary serialized protocol buffer message along with a + URL that describes the type of the serialized message. + + Protobuf library provides support to pack/unpack Any values in the form + of utility functions or additional generated methods of the Any type. + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the unpack + methods only use the fully qualified type name after the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type + name "y.z". + + JSON + ==== + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with an + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + representation, that representation will be embedded adding a field + `value` which holds the custom JSON in addition to the `@type` + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + x-schema-name: protobufAny + protoexamplepbFoo: + required: + - bar + type: object + properties: + bar: + $ref: "#/components/schemas/examplepbBar" + rpcStatus: + type: object + properties: + code: + type: integer + description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." + format: int32 + message: + type: string + description: |- + A developer-facing error message, which should be in English. Any + user-facing error message should be localized and sent in the + [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + details: + type: array + description: |- + A list of messages that carry the error details. There is a common set of + message types for APIs to use. + items: + $ref: "#/components/schemas/protobufAny" + description: |- + The `Status` type defines a logical error model that is suitable for + different programming environments, including REST APIs and RPC APIs. It is + used by [gRPC](https://github.com/grpc). Each `Status` message contains + three pieces of data: error code, error message, and error details. + + You can find out more about this error model and how to work with it in the + [API Design Guide](https://cloud.google.com/apis/design/errors). + example: code: 0 details: - - '@type': "@type" - - '@type': "@type" - message: "message" - examplepbErrorObject: - type: "object" - properties: - code: - type: "integer" - format: "integer" - description: "Response code" - title: "code" - message: - type: "string" - description: "Response message" - title: "message" - pattern: "^[a-zA-Z0-9]{1, 32}$" - examplepbErrorResponse: - type: "object" - properties: - correlationId: - type: "string" - format: "uuid" - example: "2438ac3c-37eb-4902-adef-ed16b4431030" - description: "Unique event identifier for server requests" - title: "x-correlation-id" - pattern: "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$" - error: - $ref: "#/definitions/examplepbErrorObject" - examplepbNumericEnum: - type: "string" - externalDocs: - description: "Find out more about ABitOfEverything" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - title: "NumericEnum" - description: "NumericEnum is one or zero." - example: "ZERO" - enum: - - "ZERO" - - "ONE" - default: "ZERO" - x-a-bit-of-everything-foo: "bar" - examplepbRequiredMessageTypeRequest: - type: "object" - required: - - "foo" - - "id" - properties: - id: - type: "string" - foo: - $ref: "#/definitions/protoexamplepbFoo" - title: "Required message type -> OpenAPI\nhttps://github.com/grpc-ecosystem/grpc-gateway/issues/2837" - examplepbSnakeEnumResponse: - type: "object" - examplepbsnake_case_0_enum: - type: "string" - title: "Ignoring lint warnings as this enum type exist to validate proper functionality\n\ - for projects that don't follow these lint rules.\nbuf:lint:ignore ENUM_PASCAL_CASE" - description: "- value_e: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n - value_f:\ - \ buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE" - enum: - - "value_e" - - "value_f" - default: "value_e" - examplepbsnake_case_enum: - type: "string" - title: "Ignoring lint warnings as this enum type exist to validate proper functionality\n\ - for projects that don't follow these lint rules.\nbuf:lint:ignore ENUM_PASCAL_CASE" - description: "- value_c: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n - value_d:\ - \ buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE" - enum: - - "value_c" - - "value_d" - default: "value_c" - oneofenumExampleEnum: - type: "string" - enum: - - "EXAMPLE_ENUM_UNSPECIFIED" - - "EXAMPLE_ENUM_FIRST" - default: "EXAMPLE_ENUM_UNSPECIFIED" - pathenumPathEnum: - type: "string" - enum: - - "ABC" - - "DEF" - default: "ABC" - pathenumsnake_case_for_import: - type: "string" - title: "Ignoring lint warnings as this enum type exist to validate proper functionality\n\ - for projects that don't follow these lint rules.\nbuf:lint:ignore ENUM_PASCAL_CASE" - description: "- value_x: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n - value_y:\ - \ buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE" - enum: - - "value_x" - - "value_y" - default: "value_x" - protobufAny: - type: "object" - properties: - '@type': - type: "string" - description: "A URL/resource name that uniquely identifies the type of the\ - \ serialized\nprotocol buffer message. This string must contain at least\n\ - one \"/\" character. The last segment of the URL's path must represent\n\ - the fully qualified name of the type (as in\n`path/google.protobuf.Duration`).\ - \ The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\ - \nIn practice, teams usually precompile into the binary all types that they\n\ - expect it to use in the context of Any. However, for URLs which use the\n\ - scheme `http`, `https`, or no scheme, one can optionally set up a type\n\ - server that maps type URLs to message definitions as follows:\n\n* If no\ - \ scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must\ - \ yield a [google.protobuf.Type][]\n value in binary format, or produce\ - \ an error.\n* Applications are allowed to cache lookup results based on\ - \ the\n URL, or have them precompiled into a binary to avoid any\n lookup.\ - \ Therefore, binary compatibility needs to be preserved\n on changes to\ - \ types. (Use versioned type names to manage\n breaking changes.)\n\nNote:\ - \ this functionality is not currently available in the official\nprotobuf\ - \ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\ - \ As of May 2023, there are no widely used type server\nimplementations\ - \ and no plans to implement one.\n\nSchemes other than `http`, `https` (or\ - \ the empty scheme) might be\nused with implementation specific semantics." - description: "`Any` contains an arbitrary serialized protocol buffer message along\ - \ with a\nURL that describes the type of the serialized message.\n\nProtobuf\ - \ library provides support to pack/unpack Any values in the form\nof utility\ - \ functions or additional generated methods of the Any type.\n\nExample 1: Pack\ - \ and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n\ - \ ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack\ - \ and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n\ - \ ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n\ - \ }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n\ - \ foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack\ - \ and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n \ - \ any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n\ - \ ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n\ - \ any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n\ - \ ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err !=\ - \ nil {\n ...\n }\n\nThe pack methods provided by protobuf library\ - \ will by default use\n'type.googleapis.com/full.type.name' as the type URL\ - \ and the unpack\nmethods only use the fully qualified type name after the last\ - \ '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\ - name \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses\ - \ the regular\nrepresentation of the deserialized, embedded message, with an\n\ - additional field `@type` which contains the type URL. Example:\n\n package\ - \ google.profile;\n message Person {\n string first_name = 1;\n \ - \ string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\ - ,\n \"firstName\": ,\n \"lastName\": \n }\n\nIf\ - \ the embedded message type is well-known and has a custom JSON\nrepresentation,\ - \ that representation will be embedded adding a field\n`value` which holds the\ - \ custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\ - \n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n\ - \ \"value\": \"1.212s\"\n }" - example: - '@type': "@type" - additionalProperties: {} - protoexamplepbFoo: - type: "object" - required: - - "bar" - properties: - bar: - $ref: "#/definitions/examplepbBar" - rpcStatus: - type: "object" - properties: - code: - type: "integer" - format: "int32" - description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - message: - type: "string" - description: "A developer-facing error message, which should be in English.\ - \ Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details]\ - \ field, or localized by the client." - details: - type: "array" - description: "A list of messages that carry the error details. There is a\ - \ common set of\nmessage types for APIs to use." - items: - $ref: "#/definitions/protobufAny" - description: "The `Status` type defines a logical error model that is suitable\ - \ for\ndifferent programming environments, including REST APIs and RPC APIs.\ - \ It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\n\ - three pieces of data: error code, error message, and error details.\n\nYou can\ - \ find out more about this error model and how to work with it in the\n[API\ - \ Design Guide](https://cloud.google.com/apis/design/errors)." - example: - code: 0 - details: - - '@type': "@type" - - '@type': "@type" - message: "message" - subStringMessage: - type: "object" - properties: - value: - type: "string" - The book to update.: - type: "object" - properties: - id: - type: "string" - description: "Output only. The book's ID." - readOnly: true - createTime: - type: "string" - format: "date-time" - description: "Output only. Creation time of the book." - readOnly: true - title: "The book to update." - description: "The book's `name` field is used to identify the book to be updated.\n\ - Format: publishers/{publisher}/books/{book}" - A bit of everything: - type: "object" - required: - - "doubleValue" - - "floatValue" - - "int64Value" - - "requiredStringField1" - - "requiredStringField2" - - "requiredStringViaFieldBehaviorAnnotation" - - "required_field_behavior_json_name_custom" - - "required_field_schema_json_name_custom" - properties: - singleNested: - $ref: "#/definitions/ABitOfEverythingNested" - nested: - type: "array" - items: - $ref: "#/definitions/ABitOfEverythingNested" - floatValue: - type: "number" - format: "float" - description: "Float value field" - default: 0.2 - doubleValue: - type: "number" - format: "double" - int64Value: - type: "string" - format: "int64" - uint64Value: - type: "string" - format: "uint64" - int32Value: - type: "integer" - format: "int32" - fixed64Value: - type: "string" - format: "uint64" - fixed32Value: - type: "integer" - format: "int64" - boolValue: - type: "boolean" - stringValue: - type: "string" - bytesValue: - type: "string" - format: "byte" - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - uint32Value: - type: "integer" - format: "int64" - enumValue: - $ref: "#/definitions/examplepbNumericEnum" - pathEnumValue: - $ref: "#/definitions/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/definitions/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: "integer" - format: "int32" - sfixed64Value: - type: "string" - format: "int64" - sint32Value: - type: "integer" - format: "int32" - sint64Value: - type: "string" - format: "int64" - repeatedStringValue: - type: "array" - items: - type: "string" - oneofEmpty: - type: "object" - properties: {} - oneofString: - type: "string" - mapValue: - type: "object" - title: "map of numeric enum" - additionalProperties: - $ref: "#/definitions/examplepbNumericEnum" - mappedStringValue: - type: "object" - description: "Map of string description." - title: "Map of string title" - additionalProperties: - type: "string" - mappedNestedValue: - type: "object" - additionalProperties: - $ref: "#/definitions/ABitOfEverythingNested" - nonConventionalNameValue: - type: "string" - timestampValue: - type: "string" - format: "date-time" - repeatedEnumValue: - type: "array" - title: "repeated enum value. it is comma-separated in query" - items: - $ref: "#/definitions/examplepbNumericEnum" - repeatedEnumAnnotation: - type: "array" - description: "Repeated numeric enum description." - title: "Repeated numeric enum title" - items: - $ref: "#/definitions/examplepbNumericEnum" - enumValueAnnotation: - description: "Numeric enum description." - title: "Numeric enum title" - $ref: "#/definitions/examplepbNumericEnum" - repeatedStringAnnotation: - type: "array" - description: "Repeated string description." - title: "Repeated string title" - items: - type: "string" - repeatedNestedAnnotation: - type: "array" - description: "Repeated nested object description." - title: "Repeated nested object title" - items: - $ref: "#/definitions/ABitOfEverythingNested" - nestedAnnotation: - description: "Nested object description." - title: "Nested object title" - $ref: "#/definitions/ABitOfEverythingNested" - int64OverrideType: - type: "integer" - format: "int64" - requiredStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as required in Open API definition" - outputOnlyStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as readonly in Open API definition" - readOnly: true - optionalStringValue: - type: "string" - productId: - type: "array" - description: "Only digits are allowed." - title: "Test openapiv2 generation of repeated fields" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - optionalStringField: - type: "string" - title: "Test openapiv2 generation of required fields with annotation and jsonschema\ - \ to reproduce" - requiredStringField1: - type: "string" - requiredStringField2: - type: "string" - required_field_behavior_json_name_custom: - type: "string" - title: "Test openapiv2 handling of required json_name fields" - required_field_schema_json_name_custom: - type: "string" - trailingOnly: - type: "string" - title: "Trailing only" - trailingOnlyDot: - type: "string" - description: "Trailing only dot." - trailingBoth: - type: "string" - description: "Trailing both." - title: "Leading both" - trailingMultiline: - type: "string" - description: "This is an example of a multi-line comment.\n\nTrailing multiline." - title: "Leading multiline" - uuids: - type: "array" - title: "Specify a custom format of repeated field items" - items: - type: "string" - format: "uuid" - externalDocs: - description: "Find out more about ABitOfEverything" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - title: "A bit of everything" - description: "Intentionally complicated message type to cover many features of\ - \ Protobuf." - example: - int64_value: 12 - double_value: 12.3 - x-a-bit-of-everything-foo: "bar" - A bit of everything_1: - type: "object" - required: - - "doubleValue" - - "floatValue" - - "int64Value" - - "requiredStringField1" - - "requiredStringField2" - - "requiredStringViaFieldBehaviorAnnotation" - - "required_field_behavior_json_name_custom" - - "required_field_schema_json_name_custom" - properties: - singleNested: - $ref: "#/definitions/ABitOfEverythingNested" - nested: - type: "array" - items: - $ref: "#/definitions/ABitOfEverythingNested" - floatValue: - type: "number" - format: "float" - description: "Float value field" - default: 0.2 - doubleValue: - type: "number" - format: "double" - int64Value: - type: "string" - format: "int64" - uint64Value: - type: "string" - format: "uint64" - int32Value: - type: "integer" - format: "int32" - fixed64Value: - type: "string" - format: "uint64" - fixed32Value: - type: "integer" - format: "int64" - boolValue: - type: "boolean" - stringValue: - type: "string" - bytesValue: - type: "string" - format: "byte" - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - uint32Value: - type: "integer" - format: "int64" - enumValue: - $ref: "#/definitions/examplepbNumericEnum" - pathEnumValue: - $ref: "#/definitions/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/definitions/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: "integer" - format: "int32" - sfixed64Value: - type: "string" - format: "int64" - sint32Value: - type: "integer" - format: "int32" - sint64Value: - type: "string" - format: "int64" - repeatedStringValue: - type: "array" - items: - type: "string" - oneofEmpty: - type: "object" - properties: {} - oneofString: - type: "string" - mapValue: - type: "object" - title: "map of numeric enum" - additionalProperties: - $ref: "#/definitions/examplepbNumericEnum" - mappedStringValue: - type: "object" - description: "Map of string description." - title: "Map of string title" - additionalProperties: - type: "string" - mappedNestedValue: - type: "object" - additionalProperties: - $ref: "#/definitions/ABitOfEverythingNested" - nonConventionalNameValue: - type: "string" - timestampValue: - type: "string" - format: "date-time" - repeatedEnumValue: - type: "array" - title: "repeated enum value. it is comma-separated in query" - items: - $ref: "#/definitions/examplepbNumericEnum" - repeatedEnumAnnotation: - type: "array" - description: "Repeated numeric enum description." - title: "Repeated numeric enum title" - items: - $ref: "#/definitions/examplepbNumericEnum" - enumValueAnnotation: - description: "Numeric enum description." - title: "Numeric enum title" - $ref: "#/definitions/examplepbNumericEnum" - repeatedStringAnnotation: - type: "array" - description: "Repeated string description." - title: "Repeated string title" - items: - type: "string" - repeatedNestedAnnotation: - type: "array" - description: "Repeated nested object description." - title: "Repeated nested object title" - items: - $ref: "#/definitions/ABitOfEverythingNested" - nestedAnnotation: - description: "Nested object description." - title: "Nested object title" - $ref: "#/definitions/ABitOfEverythingNested" - int64OverrideType: - type: "integer" - format: "int64" - requiredStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as required in Open API definition" - outputOnlyStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as readonly in Open API definition" - readOnly: true - optionalStringValue: - type: "string" - productId: - type: "array" - description: "Only digits are allowed." - title: "Test openapiv2 generation of repeated fields" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - optionalStringField: - type: "string" - title: "Test openapiv2 generation of required fields with annotation and jsonschema\ - \ to reproduce" - requiredStringField1: - type: "string" - requiredStringField2: - type: "string" - required_field_behavior_json_name_custom: - type: "string" - title: "Test openapiv2 handling of required json_name fields" - required_field_schema_json_name_custom: - type: "string" - trailingOnly: - type: "string" - title: "Trailing only" - trailingOnlyDot: - type: "string" - description: "Trailing only dot." - trailingBoth: - type: "string" - description: "Trailing both." - title: "Leading both" - trailingMultiline: - type: "string" - description: "This is an example of a multi-line comment.\n\nTrailing multiline." - title: "Leading multiline" - uuids: - type: "array" - title: "Specify a custom format of repeated field items" - items: - type: "string" - format: "uuid" - externalDocs: - description: "Find out more about ABitOfEverything" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - title: "A bit of everything" - description: "Intentionally complicated message type to cover many features of\ - \ Protobuf." - example: - int64_value: 12 - double_value: 12.3 - x-a-bit-of-everything-foo: "bar" - ABitOfEverythingServiceDeepPathEchoBody_singleNested: - properties: - amount: - type: "integer" - format: "int64" - ok: - description: "DeepEnum description." - $ref: "#/definitions/NestedDeepEnum" - description: "Nested is nested type." - example: "{\"ok\":\"TRUE\"}" - A bit of everything_2: - properties: - singleNested: - $ref: "#/definitions/ABitOfEverythingNested" - nested: - type: "array" - items: - $ref: "#/definitions/ABitOfEverythingNested" - floatValue: - type: "number" - format: "float" - description: "Float value field" - default: 0.2 - doubleValue: - type: "number" - format: "double" - int64Value: - type: "string" - format: "int64" - uint64Value: - type: "string" - format: "uint64" - int32Value: - type: "integer" - format: "int32" - fixed64Value: - type: "string" - format: "uint64" - fixed32Value: - type: "integer" - format: "int64" - boolValue: - type: "boolean" - stringValue: - type: "string" - bytesValue: - type: "string" - format: "byte" - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - uint32Value: - type: "integer" - format: "int64" - enumValue: - $ref: "#/definitions/examplepbNumericEnum" - pathEnumValue: - $ref: "#/definitions/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/definitions/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: "integer" - format: "int32" - sfixed64Value: - type: "string" - format: "int64" - sint32Value: - type: "integer" - format: "int32" - sint64Value: - type: "string" - format: "int64" - repeatedStringValue: - type: "array" - items: - type: "string" - oneofEmpty: - type: "object" - properties: {} - oneofString: - type: "string" - mapValue: - type: "object" - title: "map of numeric enum" - additionalProperties: - $ref: "#/definitions/examplepbNumericEnum" - mappedStringValue: - type: "object" - description: "Map of string description." - title: "Map of string title" - additionalProperties: - type: "string" - mappedNestedValue: - type: "object" - additionalProperties: - $ref: "#/definitions/ABitOfEverythingNested" - nonConventionalNameValue: - type: "string" - timestampValue: - type: "string" - format: "date-time" - repeatedEnumValue: - type: "array" - title: "repeated enum value. it is comma-separated in query" - items: - $ref: "#/definitions/examplepbNumericEnum" - repeatedEnumAnnotation: - type: "array" - description: "Repeated numeric enum description." - title: "Repeated numeric enum title" - items: - $ref: "#/definitions/examplepbNumericEnum" - enumValueAnnotation: - description: "Numeric enum description." - title: "Numeric enum title" - $ref: "#/definitions/examplepbNumericEnum" - repeatedStringAnnotation: - type: "array" - description: "Repeated string description." - title: "Repeated string title" - items: - type: "string" - repeatedNestedAnnotation: - type: "array" - description: "Repeated nested object description." - title: "Repeated nested object title" - items: - $ref: "#/definitions/ABitOfEverythingNested" - nestedAnnotation: - description: "Nested object description." - title: "Nested object title" - $ref: "#/definitions/ABitOfEverythingNested" - int64OverrideType: - type: "integer" - format: "int64" - requiredStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as required in Open API definition" - outputOnlyStringViaFieldBehaviorAnnotation: - type: "string" - title: "mark a field as readonly in Open API definition" - readOnly: true - optionalStringValue: - type: "string" - productId: - type: "array" - description: "Only digits are allowed." - title: "Test openapiv2 generation of repeated fields" - items: - type: "string" - minLength: 1 - maxLength: 19 - pattern: "^[0-9]+$" - optionalStringField: - type: "string" - title: "Test openapiv2 generation of required fields with annotation and jsonschema\ - \ to reproduce" - requiredStringField1: - type: "string" - requiredStringField2: - type: "string" - required_field_behavior_json_name_custom: - type: "string" - title: "Test openapiv2 handling of required json_name fields" - required_field_schema_json_name_custom: - type: "string" - trailingOnly: - type: "string" - title: "Trailing only" - trailingOnlyDot: - type: "string" - description: "Trailing only dot." - trailingBoth: - type: "string" - description: "Trailing both." - title: "Leading both" - trailingMultiline: - type: "string" - description: "This is an example of a multi-line comment.\n\nTrailing multiline." - title: "Leading multiline" - uuids: - type: "array" - title: "Specify a custom format of repeated field items" - items: - type: "string" - format: "uuid" - description: "Intentionally complicated message type to cover many features of\ - \ Protobuf." - example: "{\"int64_value\":12,\"double_value\":12.3}" -externalDocs: - description: "More about gRPC-Gateway" - url: "https://github.com/grpc-ecosystem/grpc-gateway" + - key: {} + - key: {} + message: message + subStringMessage: + type: object + properties: + value: + type: string + example: + value: value + v1_book_name_body: + type: object + properties: + id: + type: string + description: Output only. The book's ID. + readOnly: true + createTime: + type: string + description: Output only. Creation time of the book. + format: date-time + readOnly: true + description: |- + An example resource type from AIP-123 used to test the behavior described in + the CreateBookRequest message. + + See: https://google.aip.dev/123 + v1_book_name_body_1: + type: object + properties: + id: + type: string + description: Output only. The book's ID. + readOnly: true + createTime: + type: string + description: Output only. Creation time of the book. + format: date-time + readOnly: true + description: |- + An example resource type from AIP-123 used to test the behavior described in + the CreateBookRequest message. + + See: https://google.aip.dev/123 + A bit of everything: + title: A bit of everything + required: + - doubleValue + - floatValue + - int64Value + - requiredStringField1 + - requiredStringField2 + - requiredStringViaFieldBehaviorAnnotation + - required_field_behavior_json_name_custom + - required_field_schema_json_name_custom + type: object + properties: + singleNested: + $ref: "#/components/schemas/ABitOfEverythingNested" + nested: + type: array + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + floatValue: + type: number + description: Float value field + format: float + default: 0.2 + doubleValue: + type: number + format: double + int64Value: + type: string + format: int64 + uint64Value: + type: string + format: uint64 + int32Value: + type: integer + format: int32 + fixed64Value: + type: string + format: uint64 + fixed32Value: + type: integer + format: int64 + boolValue: + type: boolean + stringValue: + type: string + bytesValue: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + format: byte + uint32Value: + type: integer + format: int64 + enumValue: + $ref: "#/components/schemas/examplepbNumericEnum" + pathEnumValue: + $ref: "#/components/schemas/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: integer + format: int32 + sfixed64Value: + type: string + format: int64 + sint32Value: + type: integer + format: int32 + sint64Value: + type: string + format: int64 + repeatedStringValue: + type: array + items: + type: string + oneofEmpty: + type: object + properties: {} + oneofString: + type: string + mapValue: + title: map of numeric enum + type: object + additionalProperties: + $ref: "#/components/schemas/examplepbNumericEnum" + mappedStringValue: + title: Map of string title + type: object + additionalProperties: + type: string + description: Map of string description. + mappedNestedValue: + type: object + additionalProperties: + $ref: "#/components/schemas/ABitOfEverythingNested" + nonConventionalNameValue: + type: string + timestampValue: + type: string + format: date-time + repeatedEnumValue: + title: repeated enum value. it is comma-separated in query + type: array + items: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedEnumAnnotation: + title: Repeated numeric enum title + type: array + description: Repeated numeric enum description. + items: + $ref: "#/components/schemas/examplepbNumericEnum" + enumValueAnnotation: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedStringAnnotation: + title: Repeated string title + type: array + description: Repeated string description. + items: + type: string + repeatedNestedAnnotation: + title: Repeated nested object title + type: array + description: Repeated nested object description. + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + nestedAnnotation: + $ref: "#/components/schemas/ABitOfEverythingNested" + int64OverrideType: + type: integer + format: int64 + requiredStringViaFieldBehaviorAnnotation: + title: mark a field as required in Open API definition + type: string + outputOnlyStringViaFieldBehaviorAnnotation: + title: mark a field as readonly in Open API definition + type: string + readOnly: true + optionalStringValue: + type: string + productId: + title: Test openapiv2 generation of repeated fields + type: array + description: Only digits are allowed. + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + optionalStringField: + title: Test openapiv2 generation of required fields with annotation and + jsonschema to reproduce + type: string + requiredStringField1: + type: string + requiredStringField2: + type: string + required_field_behavior_json_name_custom: + title: Test openapiv2 handling of required json_name fields + type: string + required_field_schema_json_name_custom: + type: string + trailingOnly: + title: Trailing only + type: string + trailingOnlyDot: + type: string + description: Trailing only dot. + trailingBoth: + title: Leading both + type: string + description: Trailing both. + trailingMultiline: + title: Leading multiline + type: string + description: |- + This is an example of a multi-line comment. + + Trailing multiline. + uuids: + title: Specify a custom format of repeated field items + type: array + items: + type: string + format: uuid + description: Intentionally complicated message type to cover many features of + Protobuf. + example: + int64_value: 12 + double_value: 12.3 + externalDocs: + description: Find out more about ABitOfEverything + url: https://github.com/grpc-ecosystem/grpc-gateway + x-a-bit-of-everything-foo: bar + A bit of everything_1: + title: A bit of everything + required: + - doubleValue + - floatValue + - int64Value + - requiredStringField1 + - requiredStringField2 + - requiredStringViaFieldBehaviorAnnotation + - required_field_behavior_json_name_custom + - required_field_schema_json_name_custom + type: object + properties: + singleNested: + $ref: "#/components/schemas/ABitOfEverythingNested" + nested: + type: array + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + floatValue: + type: number + description: Float value field + format: float + default: 0.2 + doubleValue: + type: number + format: double + int64Value: + type: string + format: int64 + uint64Value: + type: string + format: uint64 + int32Value: + type: integer + format: int32 + fixed64Value: + type: string + format: uint64 + fixed32Value: + type: integer + format: int64 + boolValue: + type: boolean + stringValue: + type: string + bytesValue: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + format: byte + uint32Value: + type: integer + format: int64 + enumValue: + $ref: "#/components/schemas/examplepbNumericEnum" + pathEnumValue: + $ref: "#/components/schemas/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: integer + format: int32 + sfixed64Value: + type: string + format: int64 + sint32Value: + type: integer + format: int32 + sint64Value: + type: string + format: int64 + repeatedStringValue: + type: array + items: + type: string + oneofEmpty: + type: object + properties: {} + oneofString: + type: string + mapValue: + title: map of numeric enum + type: object + additionalProperties: + $ref: "#/components/schemas/examplepbNumericEnum" + mappedStringValue: + title: Map of string title + type: object + additionalProperties: + type: string + description: Map of string description. + mappedNestedValue: + type: object + additionalProperties: + $ref: "#/components/schemas/ABitOfEverythingNested" + nonConventionalNameValue: + type: string + timestampValue: + type: string + format: date-time + repeatedEnumValue: + title: repeated enum value. it is comma-separated in query + type: array + items: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedEnumAnnotation: + title: Repeated numeric enum title + type: array + description: Repeated numeric enum description. + items: + $ref: "#/components/schemas/examplepbNumericEnum" + enumValueAnnotation: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedStringAnnotation: + title: Repeated string title + type: array + description: Repeated string description. + items: + type: string + repeatedNestedAnnotation: + title: Repeated nested object title + type: array + description: Repeated nested object description. + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + nestedAnnotation: + $ref: "#/components/schemas/ABitOfEverythingNested" + int64OverrideType: + type: integer + format: int64 + requiredStringViaFieldBehaviorAnnotation: + title: mark a field as required in Open API definition + type: string + outputOnlyStringViaFieldBehaviorAnnotation: + title: mark a field as readonly in Open API definition + type: string + readOnly: true + optionalStringValue: + type: string + productId: + title: Test openapiv2 generation of repeated fields + type: array + description: Only digits are allowed. + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + optionalStringField: + title: Test openapiv2 generation of required fields with annotation and + jsonschema to reproduce + type: string + requiredStringField1: + type: string + requiredStringField2: + type: string + required_field_behavior_json_name_custom: + title: Test openapiv2 handling of required json_name fields + type: string + required_field_schema_json_name_custom: + type: string + trailingOnly: + title: Trailing only + type: string + trailingOnlyDot: + type: string + description: Trailing only dot. + trailingBoth: + title: Leading both + type: string + description: Trailing both. + trailingMultiline: + title: Leading multiline + type: string + description: |- + This is an example of a multi-line comment. + + Trailing multiline. + uuids: + title: Specify a custom format of repeated field items + type: array + items: + type: string + format: uuid + description: Intentionally complicated message type to cover many features of + Protobuf. + example: + int64_value: 12 + double_value: 12.3 + externalDocs: + description: Find out more about ABitOfEverything + url: https://github.com/grpc-ecosystem/grpc-gateway + x-a-bit-of-everything-foo: bar + A bit of everything_2: + title: A bit of everything + required: + - doubleValue + - floatValue + - int64Value + - requiredStringField1 + - requiredStringField2 + - requiredStringViaFieldBehaviorAnnotation + - required_field_behavior_json_name_custom + - required_field_schema_json_name_custom + type: object + properties: + singleNested: + $ref: "#/components/schemas/ABitOfEverythingNested" + nested: + type: array + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + floatValue: + type: number + description: Float value field + format: float + default: 0.2 + doubleValue: + type: number + format: double + int64Value: + type: string + format: int64 + uint64Value: + type: string + format: uint64 + int32Value: + type: integer + format: int32 + fixed64Value: + type: string + format: uint64 + fixed32Value: + type: integer + format: int64 + boolValue: + type: boolean + stringValue: + type: string + bytesValue: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + format: byte + uint32Value: + type: integer + format: int64 + enumValue: + $ref: "#/components/schemas/examplepbNumericEnum" + pathEnumValue: + $ref: "#/components/schemas/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: integer + format: int32 + sfixed64Value: + type: string + format: int64 + sint32Value: + type: integer + format: int32 + sint64Value: + type: string + format: int64 + repeatedStringValue: + type: array + items: + type: string + oneofEmpty: + type: object + properties: {} + oneofString: + type: string + mapValue: + title: map of numeric enum + type: object + additionalProperties: + $ref: "#/components/schemas/examplepbNumericEnum" + mappedStringValue: + title: Map of string title + type: object + additionalProperties: + type: string + description: Map of string description. + mappedNestedValue: + type: object + additionalProperties: + $ref: "#/components/schemas/ABitOfEverythingNested" + nonConventionalNameValue: + type: string + timestampValue: + type: string + format: date-time + repeatedEnumValue: + title: repeated enum value. it is comma-separated in query + type: array + items: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedEnumAnnotation: + title: Repeated numeric enum title + type: array + description: Repeated numeric enum description. + items: + $ref: "#/components/schemas/examplepbNumericEnum" + enumValueAnnotation: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedStringAnnotation: + title: Repeated string title + type: array + description: Repeated string description. + items: + type: string + repeatedNestedAnnotation: + title: Repeated nested object title + type: array + description: Repeated nested object description. + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + nestedAnnotation: + $ref: "#/components/schemas/ABitOfEverythingNested" + int64OverrideType: + type: integer + format: int64 + requiredStringViaFieldBehaviorAnnotation: + title: mark a field as required in Open API definition + type: string + outputOnlyStringViaFieldBehaviorAnnotation: + title: mark a field as readonly in Open API definition + type: string + readOnly: true + optionalStringValue: + type: string + productId: + title: Test openapiv2 generation of repeated fields + type: array + description: Only digits are allowed. + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + optionalStringField: + title: Test openapiv2 generation of required fields with annotation and + jsonschema to reproduce + type: string + requiredStringField1: + type: string + requiredStringField2: + type: string + required_field_behavior_json_name_custom: + title: Test openapiv2 handling of required json_name fields + type: string + required_field_schema_json_name_custom: + type: string + trailingOnly: + title: Trailing only + type: string + trailingOnlyDot: + type: string + description: Trailing only dot. + trailingBoth: + title: Leading both + type: string + description: Trailing both. + trailingMultiline: + title: Leading multiline + type: string + description: |- + This is an example of a multi-line comment. + + Trailing multiline. + uuids: + title: Specify a custom format of repeated field items + type: array + items: + type: string + format: uuid + description: Intentionally complicated message type to cover many features of + Protobuf. + example: + int64_value: 12 + double_value: 12.3 + externalDocs: + description: Find out more about ABitOfEverything + url: https://github.com/grpc-ecosystem/grpc-gateway + x-a-bit-of-everything-foo: bar + A bit of everything_3: + title: A bit of everything + required: + - doubleValue + - floatValue + - int64Value + - requiredStringField1 + - requiredStringField2 + - requiredStringViaFieldBehaviorAnnotation + - required_field_behavior_json_name_custom + - required_field_schema_json_name_custom + type: object + properties: + singleNested: + $ref: "#/components/schemas/ABitOfEverythingNested" + nested: + type: array + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + floatValue: + type: number + description: Float value field + format: float + default: 0.2 + doubleValue: + type: number + format: double + int64Value: + type: string + format: int64 + uint64Value: + type: string + format: uint64 + int32Value: + type: integer + format: int32 + fixed64Value: + type: string + format: uint64 + fixed32Value: + type: integer + format: int64 + boolValue: + type: boolean + stringValue: + type: string + bytesValue: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + format: byte + uint32Value: + type: integer + format: int64 + enumValue: + $ref: "#/components/schemas/examplepbNumericEnum" + pathEnumValue: + $ref: "#/components/schemas/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: integer + format: int32 + sfixed64Value: + type: string + format: int64 + sint32Value: + type: integer + format: int32 + sint64Value: + type: string + format: int64 + repeatedStringValue: + type: array + items: + type: string + oneofEmpty: + type: object + properties: {} + oneofString: + type: string + mapValue: + title: map of numeric enum + type: object + additionalProperties: + $ref: "#/components/schemas/examplepbNumericEnum" + mappedStringValue: + title: Map of string title + type: object + additionalProperties: + type: string + description: Map of string description. + mappedNestedValue: + type: object + additionalProperties: + $ref: "#/components/schemas/ABitOfEverythingNested" + nonConventionalNameValue: + type: string + timestampValue: + type: string + format: date-time + repeatedEnumValue: + title: repeated enum value. it is comma-separated in query + type: array + items: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedEnumAnnotation: + title: Repeated numeric enum title + type: array + description: Repeated numeric enum description. + items: + $ref: "#/components/schemas/examplepbNumericEnum" + enumValueAnnotation: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedStringAnnotation: + title: Repeated string title + type: array + description: Repeated string description. + items: + type: string + repeatedNestedAnnotation: + title: Repeated nested object title + type: array + description: Repeated nested object description. + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + nestedAnnotation: + $ref: "#/components/schemas/ABitOfEverythingNested" + int64OverrideType: + type: integer + format: int64 + requiredStringViaFieldBehaviorAnnotation: + title: mark a field as required in Open API definition + type: string + outputOnlyStringViaFieldBehaviorAnnotation: + title: mark a field as readonly in Open API definition + type: string + readOnly: true + optionalStringValue: + type: string + productId: + title: Test openapiv2 generation of repeated fields + type: array + description: Only digits are allowed. + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + optionalStringField: + title: Test openapiv2 generation of required fields with annotation and + jsonschema to reproduce + type: string + requiredStringField1: + type: string + requiredStringField2: + type: string + required_field_behavior_json_name_custom: + title: Test openapiv2 handling of required json_name fields + type: string + required_field_schema_json_name_custom: + type: string + trailingOnly: + title: Trailing only + type: string + trailingOnlyDot: + type: string + description: Trailing only dot. + trailingBoth: + title: Leading both + type: string + description: Trailing both. + trailingMultiline: + title: Leading multiline + type: string + description: |- + This is an example of a multi-line comment. + + Trailing multiline. + uuids: + title: Specify a custom format of repeated field items + type: array + items: + type: string + format: uuid + description: Intentionally complicated message type to cover many features of + Protobuf. + example: + int64_value: 12 + double_value: 12.3 + externalDocs: + description: Find out more about ABitOfEverything + url: https://github.com/grpc-ecosystem/grpc-gateway + x-a-bit-of-everything-foo: bar + ABitOfEverythingServiceDeepPathEchoBody_singleNested: + type: object + properties: + amount: + type: integer + format: int64 + ok: + $ref: "#/components/schemas/NestedDeepEnum" + description: Nested is nested type. + example: "{\"ok\":\"TRUE\"}" + A bit of everything_4: + title: A bit of everything + type: object + properties: + singleNested: + $ref: "#/components/schemas/ABitOfEverythingNested" + nested: + type: array + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + floatValue: + type: number + description: Float value field + format: float + default: 0.2 + doubleValue: + type: number + format: double + int64Value: + type: string + format: int64 + uint64Value: + type: string + format: uint64 + int32Value: + type: integer + format: int32 + fixed64Value: + type: string + format: uint64 + fixed32Value: + type: integer + format: int64 + boolValue: + type: boolean + stringValue: + type: string + bytesValue: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + format: byte + uint32Value: + type: integer + format: int64 + enumValue: + $ref: "#/components/schemas/examplepbNumericEnum" + pathEnumValue: + $ref: "#/components/schemas/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: integer + format: int32 + sfixed64Value: + type: string + format: int64 + sint32Value: + type: integer + format: int32 + sint64Value: + type: string + format: int64 + repeatedStringValue: + type: array + items: + type: string + oneofEmpty: + type: object + properties: {} + oneofString: + type: string + mapValue: + title: map of numeric enum + type: object + additionalProperties: + $ref: "#/components/schemas/examplepbNumericEnum" + mappedStringValue: + title: Map of string title + type: object + additionalProperties: + type: string + description: Map of string description. + mappedNestedValue: + type: object + additionalProperties: + $ref: "#/components/schemas/ABitOfEverythingNested" + nonConventionalNameValue: + type: string + timestampValue: + type: string + format: date-time + repeatedEnumValue: + title: repeated enum value. it is comma-separated in query + type: array + items: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedEnumAnnotation: + title: Repeated numeric enum title + type: array + description: Repeated numeric enum description. + items: + $ref: "#/components/schemas/examplepbNumericEnum" + enumValueAnnotation: + $ref: "#/components/schemas/examplepbNumericEnum" + repeatedStringAnnotation: + title: Repeated string title + type: array + description: Repeated string description. + items: + type: string + repeatedNestedAnnotation: + title: Repeated nested object title + type: array + description: Repeated nested object description. + items: + $ref: "#/components/schemas/ABitOfEverythingNested" + nestedAnnotation: + $ref: "#/components/schemas/ABitOfEverythingNested" + int64OverrideType: + type: integer + format: int64 + requiredStringViaFieldBehaviorAnnotation: + title: mark a field as required in Open API definition + type: string + outputOnlyStringViaFieldBehaviorAnnotation: + title: mark a field as readonly in Open API definition + type: string + readOnly: true + optionalStringValue: + type: string + productId: + title: Test openapiv2 generation of repeated fields + type: array + description: Only digits are allowed. + items: + maxLength: 19 + minLength: 1 + pattern: "^[0-9]+$" + type: string + optionalStringField: + title: Test openapiv2 generation of required fields with annotation and + jsonschema to reproduce + type: string + requiredStringField1: + type: string + requiredStringField2: + type: string + required_field_behavior_json_name_custom: + title: Test openapiv2 handling of required json_name fields + type: string + required_field_schema_json_name_custom: + type: string + trailingOnly: + title: Trailing only + type: string + trailingOnlyDot: + type: string + description: Trailing only dot. + trailingBoth: + title: Leading both + type: string + description: Trailing both. + trailingMultiline: + title: Leading multiline + type: string + description: |- + This is an example of a multi-line comment. + + Trailing multiline. + uuids: + title: Specify a custom format of repeated field items + type: array + items: + type: string + format: uuid + description: Intentionally complicated message type to cover many features of + Protobuf. + example: "{\"int64_value\":12,\"double_value\":12.3}" + securitySchemes: + ApiKeyAuth: + type: apiKey + name: X-API-Key + in: header + x-amazon-apigateway-authorizer: + authorizerResultTtlInSeconds: 60 + type: token + x-amazon-apigateway-authtype: oauth2 + BasicAuth: + type: http + scheme: basic + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + admin: Grants read and write access to administrative information + read: Grants read access + write: Grants write access x-grpc-gateway-baz-list: -- "one" +- one - true -x-grpc-gateway-foo: "bar" +x-grpc-gateway-foo: bar +x-original-swagger-version: "2.0" diff --git a/examples/internal/clients/abe/api_a_bit_of_everything.go b/examples/internal/clients/abe/api_a_bit_of_everything.go index c072d76c84f..c2c8104474d 100644 --- a/examples/internal/clients/abe/api_a_bit_of_everything.go +++ b/examples/internal/clients/abe/api_a_bit_of_everything.go @@ -1,3 +1,4 @@ + /* * A Bit of Everything * @@ -7,7 +8,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe import ( @@ -26,12 +26,10 @@ var ( ) type ABitOfEverythingApiService service - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param value - @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedPathEnum(ctx context.Context, value string) (interface{}, *http.Response, error) { @@ -52,7 +50,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -110,7 +108,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -121,7 +118,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -132,7 +128,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -143,7 +138,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -154,7 +148,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -165,7 +158,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -176,18 +168,15 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param value - @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnum(ctx context.Context, value string) (interface{}, *http.Response, error) { @@ -208,7 +197,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -266,7 +255,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -277,7 +265,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -288,7 +275,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -299,7 +285,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -310,7 +295,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -321,7 +305,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -332,14 +315,12 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param singleNestedName name is nested field. @@ -352,7 +333,7 @@ ABitOfEverythingApiService * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param optional nil or *ABitOfEverythingServiceCheckGetQueryParamsOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceCheckGetQueryParamsOpts - Optional Parameters: * @param "SingleNestedAmount" (optional.Int64) - * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. * @param "Uint64Value" (optional.String) - @@ -371,11 +352,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofEmpty" (optional.Interface of interface{}) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum + * @param "MapValue" (optional.Interface of Object) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of interface{}) - + * @param "MappedNestedValue" (optional.Interface of Object) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -394,55 +375,54 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items - @return ExamplepbABitOfEverything */ -type ABitOfEverythingServiceCheckGetQueryParamsOpts struct { - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCheckGetQueryParamsOpts struct { + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams(ctx context.Context, singleNestedName string, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceCheckGetQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams(ctx context.Context, singleNestedName string, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCheckGetQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -592,7 +572,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -650,7 +630,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -661,7 +640,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -672,7 +650,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -683,7 +660,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -694,7 +670,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -705,7 +680,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -716,14 +690,12 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param singleNestedOk DeepEnum description. @@ -736,7 +708,7 @@ ABitOfEverythingApiService * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param optional nil or *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts - Optional Parameters: * @param "SingleNestedName" (optional.String) - name is nested field. * @param "SingleNestedAmount" (optional.Int64) - * @param "Uint64Value" (optional.String) - @@ -755,11 +727,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofEmpty" (optional.Interface of interface{}) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum + * @param "MapValue" (optional.Interface of Object) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of interface{}) - + * @param "MappedNestedValue" (optional.Interface of Object) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -778,55 +750,54 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items - @return ExamplepbABitOfEverything */ -type ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQueryParams(ctx context.Context, singleNestedOk string, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQueryParams(ctx context.Context, singleNestedOk string, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -976,7 +947,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1034,7 +1005,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1045,7 +1015,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1056,7 +1025,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1067,7 +1035,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1078,7 +1045,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1089,7 +1055,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1100,18 +1065,15 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param stringValue - * @param singleNested + * @param body * @param uuid * @param floatValue Float value field * @param doubleValue @@ -1121,7 +1083,8 @@ ABitOfEverythingApiService * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param optional nil or *ABitOfEverythingServiceCheckPostQueryParamsOpts - Optional Parameters: + * @param stringValue + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceCheckPostQueryParamsOpts - Optional Parameters: * @param "Uint64Value" (optional.String) - * @param "Int32Value" (optional.Int32) - * @param "Fixed64Value" (optional.String) - @@ -1137,11 +1100,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofEmpty" (optional.Interface of interface{}) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum + * @param "MapValue" (optional.Interface of Object) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of interface{}) - + * @param "MappedNestedValue" (optional.Interface of Object) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -1161,53 +1124,52 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items - @return ExamplepbABitOfEverything */ -type ABitOfEverythingServiceCheckPostQueryParamsOpts struct { - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCheckPostQueryParamsOpts struct { + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams(ctx context.Context, stringValue string, singleNested ABitOfEverythingNested, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceCheckPostQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams(ctx context.Context, body ABitOfEverythingNested, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, stringValue string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCheckPostQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -1368,7 +1330,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &singleNested + localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -1411,7 +1373,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1422,7 +1383,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1433,7 +1393,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1444,7 +1403,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1455,7 +1413,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1466,7 +1423,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1477,17 +1433,14 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ExamplepbCheckStatusResponse */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx context.Context) (ExamplepbCheckStatusResponse, *http.Response, error) { @@ -1507,7 +1460,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1565,7 +1518,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbCheckStatusResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1576,7 +1528,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1587,7 +1538,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1598,7 +1548,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1609,7 +1558,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1620,7 +1568,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1631,14 +1578,12 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService Create a new ABitOfEverything This API creates a new ABitOfEverything * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1667,17 +1612,17 @@ This API creates a new ABitOfEverything * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param optional nil or *ABitOfEverythingServiceCreateOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceCreateOpts - Optional Parameters: * @param "SingleNestedName" (optional.String) - name is nested field. * @param "SingleNestedAmount" (optional.Int64) - * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. * @param "BytesValue" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofEmpty" (optional.Interface of interface{}) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum + * @param "MapValue" (optional.Interface of Object) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of interface{}) - + * @param "MappedNestedValue" (optional.Interface of Object) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "RepeatedEnumAnnotation" (optional.Interface of []string) - Repeated numeric enum title Repeated numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -1695,41 +1640,40 @@ This API creates a new ABitOfEverything * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items - @return ExamplepbABitOfEverything */ -type ABitOfEverythingServiceCreateOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - BytesValue optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCreateOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + BytesValue optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.Context, floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, nonConventionalNameValue string, enumValue string, pathEnumValue string, nestedPathEnumValue string, enumValueAnnotation string, uuid string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceCreateOpts) (ExamplepbABitOfEverything, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.Context, floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, nonConventionalNameValue string, enumValue string, pathEnumValue string, nestedPathEnumValue string, enumValueAnnotation string, uuid string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCreateOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -1852,7 +1796,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1910,7 +1854,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1921,7 +1864,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1932,7 +1874,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1943,7 +1884,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1954,7 +1894,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1965,7 +1904,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1976,18 +1914,15 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Intentionally complicated message type to cover many features of Protobuf. - @return ExamplepbABitOfEverything */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx context.Context, body ExamplepbABitOfEverything) (ExamplepbABitOfEverything, *http.Response, error) { @@ -2067,7 +2002,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2078,7 +2012,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2089,7 +2022,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2100,7 +2032,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2111,7 +2042,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2122,7 +2052,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2133,29 +2062,26 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService Create a book. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body The book to create. * @param parent The publisher in which to create the book. Format: `publishers/{publisher}` Example: `publishers/1257894000000000000` - * @param book The book to create. - * @param optional nil or *ABitOfEverythingServiceCreateBookOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceCreateBookOpts - Optional Parameters: * @param "BookId" (optional.String) - The ID to use for the book. This must start with an alphanumeric character. - @return ExamplepbBook */ -type ABitOfEverythingServiceCreateBookOpts struct { - BookId optional.String +type ABitOfEverythingApiABitOfEverythingServiceCreateBookOpts struct { + BookId optional.String } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx context.Context, parent string, book ExamplepbBook, localVarOptionals *ABitOfEverythingServiceCreateBookOpts) (ExamplepbBook, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx context.Context, body ExamplepbBook, parent string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCreateBookOpts) (ExamplepbBook, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -2193,7 +2119,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &book + localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -2236,7 +2162,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbBook err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2247,7 +2172,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2258,7 +2182,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2269,7 +2192,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2280,7 +2202,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2291,7 +2212,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2302,14 +2222,12 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuidName @@ -2321,7 +2239,7 @@ ABitOfEverythingApiService * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param optional nil or *ABitOfEverythingServiceCustomOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceCustomOpts - Optional Parameters: * @param "SingleNestedName" (optional.String) - name is nested field. * @param "SingleNestedAmount" (optional.Int64) - * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. @@ -2341,11 +2259,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofEmpty" (optional.Interface of interface{}) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum + * @param "MapValue" (optional.Interface of Object) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of interface{}) - + * @param "MappedNestedValue" (optional.Interface of Object) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -2365,57 +2283,56 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items - @return ExamplepbABitOfEverything */ -type ABitOfEverythingServiceCustomOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCustomOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceCustomOpts) (ExamplepbABitOfEverything, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCustomOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -2570,7 +2487,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -2628,7 +2545,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2639,7 +2555,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2650,7 +2565,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2661,7 +2575,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2672,7 +2585,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2683,7 +2595,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2694,14 +2605,12 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuidName @@ -2713,7 +2622,7 @@ ABitOfEverythingApiService * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param optional nil or *ABitOfEverythingServiceCustomOptionsRequestOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceCustomOptionsRequestOpts - Optional Parameters: * @param "SingleNestedName" (optional.String) - name is nested field. * @param "SingleNestedAmount" (optional.Int64) - * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. @@ -2733,11 +2642,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofEmpty" (optional.Interface of interface{}) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum + * @param "MapValue" (optional.Interface of Object) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of interface{}) - + * @param "MappedNestedValue" (optional.Interface of Object) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -2757,57 +2666,56 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items - @return interface{} */ -type ABitOfEverythingServiceCustomOptionsRequestOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCustomOptionsRequestOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceCustomOptionsRequestOpts) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCustomOptionsRequestOpts) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Options") localVarPostBody interface{} @@ -2962,7 +2870,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -3020,7 +2928,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3031,7 +2938,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3042,22 +2948,19 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param singleNestedName name is nested field. * @param body - + * @param singleNestedName name is nested field. @return ExamplepbABitOfEverything */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx context.Context, singleNestedName string, body ABitOfEverythingServiceDeepPathEchoBody) (ExamplepbABitOfEverything, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx context.Context, body ABitOfEverythingServiceDeepPathEchoBody, singleNestedName string) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -3135,7 +3038,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3146,7 +3048,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3157,7 +3058,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3168,7 +3068,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3179,7 +3078,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3190,7 +3088,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3201,18 +3098,15 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuid - @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.Context, uuid string) (interface{}, *http.Response, error) { @@ -3233,7 +3127,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -3291,7 +3185,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3302,7 +3195,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3313,7 +3205,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3324,7 +3215,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3335,7 +3225,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3346,7 +3235,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3357,14 +3245,12 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuidName @@ -3376,7 +3262,7 @@ ABitOfEverythingApiService * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param optional nil or *ABitOfEverythingServiceDoubleColonOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceDoubleColonOpts - Optional Parameters: * @param "SingleNestedName" (optional.String) - name is nested field. * @param "SingleNestedAmount" (optional.Int64) - * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. @@ -3396,11 +3282,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofEmpty" (optional.Interface of interface{}) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum + * @param "MapValue" (optional.Interface of Object) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of interface{}) - + * @param "MappedNestedValue" (optional.Interface of Object) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -3420,57 +3306,56 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items - @return ExamplepbABitOfEverything */ -type ABitOfEverythingServiceDoubleColonOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceDoubleColonOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceDoubleColonOpts) (ExamplepbABitOfEverything, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceDoubleColonOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -3625,7 +3510,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -3683,7 +3568,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3694,7 +3578,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3705,7 +3588,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3716,7 +3598,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3727,7 +3608,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3738,7 +3618,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3749,17 +3628,14 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx context.Context) (interface{}, *http.Response, error) { @@ -3779,7 +3655,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -3837,7 +3713,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3848,7 +3723,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3859,7 +3733,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3870,7 +3743,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3881,7 +3753,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3892,7 +3763,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3903,14 +3773,12 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuidName @@ -3922,7 +3790,7 @@ ABitOfEverythingApiService * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param optional nil or *ABitOfEverythingServiceExistsOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceExistsOpts - Optional Parameters: * @param "SingleNestedName" (optional.String) - name is nested field. * @param "SingleNestedAmount" (optional.Int64) - * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. @@ -3942,11 +3810,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofEmpty" (optional.Interface of interface{}) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum + * @param "MapValue" (optional.Interface of Object) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of interface{}) - + * @param "MappedNestedValue" (optional.Interface of Object) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -3966,57 +3834,56 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items - @return interface{} */ -type ABitOfEverythingServiceExistsOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceExistsOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceExistsOpts) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceExistsOpts) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Head") localVarPostBody interface{} @@ -4171,7 +4038,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.C localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -4229,7 +4096,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4240,7 +4106,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4251,22 +4116,19 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body * @param id - * @param data - @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(ctx context.Context, id string, data ExamplepbBody) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(ctx context.Context, body ExamplepbBody, id string) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -4301,7 +4163,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &data + localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -4344,7 +4206,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4355,7 +4216,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4366,7 +4226,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4377,7 +4236,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4388,7 +4246,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4399,7 +4256,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4410,14 +4266,12 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuidName @@ -4429,7 +4283,7 @@ ABitOfEverythingApiService * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param optional nil or *ABitOfEverythingServiceGetQueryOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceGetQueryOpts - Optional Parameters: * @param "SingleNestedName" (optional.String) - name is nested field. * @param "SingleNestedAmount" (optional.Int64) - * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. @@ -4449,11 +4303,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofEmpty" (optional.Interface of interface{}) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum + * @param "MapValue" (optional.Interface of Object) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of interface{}) - + * @param "MappedNestedValue" (optional.Interface of Object) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -4473,57 +4327,56 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items - @return interface{} */ -type ABitOfEverythingServiceGetQueryOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceGetQueryOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceGetQueryOpts) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceGetQueryOpts) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -4678,7 +4531,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -4723,7 +4576,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4734,7 +4586,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4745,7 +4596,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4756,7 +4606,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4767,7 +4616,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4778,7 +4626,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4789,14 +4636,12 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param pathRepeatedFloatValue repeated values. they are comma-separated in path @@ -4815,7 +4660,6 @@ ABitOfEverythingApiService * @param pathRepeatedSfixed64Value * @param pathRepeatedSint32Value * @param pathRepeatedSint64Value - @return ExamplepbABitOfEverythingRepeated */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx context.Context, pathRepeatedFloatValue []float32, pathRepeatedDoubleValue []float64, pathRepeatedInt64Value []string, pathRepeatedUint64Value []string, pathRepeatedInt32Value []int32, pathRepeatedFixed64Value []string, pathRepeatedFixed32Value []int64, pathRepeatedBoolValue []bool, pathRepeatedStringValue []string, pathRepeatedBytesValue []string, pathRepeatedUint32Value []int64, pathRepeatedEnumValue []string, pathRepeatedSfixed32Value []int32, pathRepeatedSfixed64Value []string, pathRepeatedSint32Value []int32, pathRepeatedSint64Value []string) (ExamplepbABitOfEverythingRepeated, *http.Response, error) { @@ -4899,7 +4743,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -4957,7 +4801,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverythingRepeated err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4968,7 +4811,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4979,7 +4821,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4990,7 +4831,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5001,7 +4841,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5012,7 +4851,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5023,18 +4861,15 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuid - @return ExamplepbABitOfEverything */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.Context, uuid string) (ExamplepbABitOfEverything, *http.Response, error) { @@ -5055,7 +4890,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -5113,7 +4948,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5124,7 +4958,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5135,7 +4968,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5146,7 +4978,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5157,7 +4988,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5168,7 +4998,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5179,18 +5008,15 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body - @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestContentType(ctx context.Context, body ExamplepbBody) (interface{}, *http.Response, error) { @@ -5270,7 +5096,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5281,7 +5106,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5292,7 +5116,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5303,7 +5126,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5314,7 +5136,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5325,7 +5146,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5336,17 +5156,14 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return string */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseContentType(ctx context.Context) (string, *http.Response, error) { @@ -5366,7 +5183,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -5424,7 +5241,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5435,7 +5251,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5446,7 +5261,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5457,7 +5271,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5468,7 +5281,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5479,7 +5291,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5490,21 +5301,18 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param exampleEnum - + * @param body @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx context.Context, exampleEnum OneofenumExampleEnum) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx context.Context, body string) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -5538,7 +5346,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &exampleEnum + localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -5581,7 +5389,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5592,7 +5399,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5603,7 +5409,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5614,7 +5419,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5625,7 +5429,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5636,7 +5439,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5647,18 +5449,15 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body - @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageType(ctx context.Context, body ExamplepbRequiredMessageTypeRequest) (interface{}, *http.Response, error) { @@ -5738,7 +5537,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5749,7 +5547,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5760,7 +5557,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5771,7 +5567,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5782,7 +5577,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5793,7 +5587,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5804,22 +5597,19 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param name * @param body - + * @param name @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ctx context.Context, name string, body ABitOfEverythingServicePostWithEmptyBodyBody) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ctx context.Context, body ABitOfEverythingServicePostWithEmptyBodyBody, name string) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -5897,7 +5687,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5908,7 +5697,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5919,7 +5707,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5930,7 +5717,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5941,7 +5727,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5952,7 +5737,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5963,17 +5747,14 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context.Context) (interface{}, *http.Response, error) { @@ -5993,7 +5774,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -6051,7 +5832,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6062,7 +5842,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6073,7 +5852,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6084,7 +5862,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6095,7 +5872,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6106,7 +5882,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6117,22 +5892,19 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param uuidName * @param body - + * @param uuidName @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.Context, uuidName string, body ExamplepbABitOfEverythingServiceUpdateBody) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.Context, body ExamplepbABitOfEverythingServiceUpdateBody, uuidName string) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -6210,7 +5982,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6221,7 +5992,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6232,7 +6002,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6243,7 +6012,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6254,7 +6022,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6265,7 +6032,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6276,29 +6042,26 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body The book to update. The book's `name` field is used to identify the book to be updated. Format: publishers/{publisher}/books/{book} * @param bookName The resource name of the book. Format: `publishers/{publisher}/books/{book}` Example: `publishers/1257894000000000000/books/my-book` - * @param book The book to update. The book's `name` field is used to identify the book to be updated. Format: publishers/{publisher}/books/{book} - * @param optional nil or *ABitOfEverythingServiceUpdateBookOpts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceUpdateBookOpts - Optional Parameters: * @param "AllowMissing" (optional.Bool) - If set to true, and the book is not found, a new book will be created. In this situation, `update_mask` is ignored. - @return ExamplepbBook */ -type ABitOfEverythingServiceUpdateBookOpts struct { - AllowMissing optional.Bool +type ABitOfEverythingApiABitOfEverythingServiceUpdateBookOpts struct { + AllowMissing optional.Bool } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx context.Context, bookName string, book TheBookToUpdate_, localVarOptionals *ABitOfEverythingServiceUpdateBookOpts) (ExamplepbBook, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx context.Context, body V1BookNameBody, bookName string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceUpdateBookOpts) (ExamplepbBook, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -6336,7 +6099,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &book + localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -6379,7 +6142,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbBook err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6390,7 +6152,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6401,7 +6162,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6412,7 +6172,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6423,7 +6182,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6434,7 +6192,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6445,29 +6202,26 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body A bit of everything Intentionally complicated message type to cover many features of Protobuf. * @param uuidName - * @param abe A bit of everything Intentionally complicated message type to cover many features of Protobuf. - * @param optional nil or *ABitOfEverythingServiceUpdateV2Opts - Optional Parameters: + * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceUpdateV2Opts - Optional Parameters: * @param "UpdateMask" (optional.String) - The paths to update. - @return interface{} */ -type ABitOfEverythingServiceUpdateV2Opts struct { - UpdateMask optional.String +type ABitOfEverythingApiABitOfEverythingServiceUpdateV2Opts struct { + UpdateMask optional.String } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context.Context, uuidName string, abe ABitOfEverything, localVarOptionals *ABitOfEverythingServiceUpdateV2Opts) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context.Context, body ABitOfEverything, uuidName string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceUpdateV2Opts) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -6505,7 +6259,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &abe + localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -6548,7 +6302,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6559,7 +6312,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6570,7 +6322,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6581,7 +6332,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6592,7 +6342,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6603,7 +6352,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6614,22 +6362,19 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body A bit of everything Intentionally complicated message type to cover many features of Protobuf. * @param uuidName - * @param abe A bit of everything Intentionally complicated message type to cover many features of Protobuf. - @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx context.Context, uuidName string, abe ABitOfEverything1) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx context.Context, body ABitOfEverything2, uuidName string) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -6664,7 +6409,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &abe + localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -6707,7 +6452,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6718,7 +6462,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6729,7 +6472,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6740,7 +6482,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6751,7 +6492,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6762,7 +6502,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6773,22 +6512,19 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param uuidName * @param body - + * @param uuidName @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx context.Context, uuidName string, body ABitOfEverythingServiceUpdateV2Body) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx context.Context, body ABitOfEverythingServiceUpdateV2Body, uuidName string) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -6866,7 +6602,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6877,7 +6612,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6888,7 +6622,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6899,7 +6632,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6910,7 +6642,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6921,7 +6652,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6932,7 +6662,6 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/examples/internal/clients/abe/api_camel_case_service_name.go b/examples/internal/clients/abe/api_camel_case_service_name.go index ea4269f06b4..b591883a66b 100644 --- a/examples/internal/clients/abe/api_camel_case_service_name.go +++ b/examples/internal/clients/abe/api_camel_case_service_name.go @@ -1,3 +1,4 @@ + /* * A Bit of Everything * @@ -7,7 +8,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe import ( @@ -24,11 +24,9 @@ var ( ) type CamelCaseServiceNameApiService service - -/* +/* CamelCaseServiceNameApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return interface{} */ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.Context) (interface{}, *http.Response, error) { @@ -48,7 +46,7 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -106,7 +104,6 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -117,7 +114,6 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -128,7 +124,6 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -139,7 +134,6 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -150,7 +144,6 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -161,7 +154,6 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -172,7 +164,6 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/examples/internal/clients/abe/api_echo_rpc.go b/examples/internal/clients/abe/api_echo_rpc.go index 1578fbff89b..a5ac9e42361 100644 --- a/examples/internal/clients/abe/api_echo_rpc.go +++ b/examples/internal/clients/abe/api_echo_rpc.go @@ -1,3 +1,4 @@ + /* * A Bit of Everything * @@ -7,7 +8,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe import ( @@ -26,13 +26,11 @@ var ( ) type EchoRpcApiService service - -/* +/* EchoRpcApiService Summary: Echo rpc Description Echo * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param value - @return SubStringMessage */ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, value string) (SubStringMessage, *http.Response, error) { @@ -53,7 +51,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -111,7 +109,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v SubStringMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -122,7 +119,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -133,7 +129,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -144,7 +139,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -155,7 +149,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -166,7 +159,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -177,7 +169,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -188,22 +179,19 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoRpcApiService Summary: Echo rpc Description Echo * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param value - + * @param body @return SubStringMessage */ -func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, value string) (SubStringMessage, *http.Response, error) { +func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, body string) (SubStringMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -237,7 +225,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, va localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &value + localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -280,7 +268,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, va body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v SubStringMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -291,7 +278,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, va newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -302,7 +288,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, va newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -313,7 +298,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, va newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -324,7 +308,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, va newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -335,7 +318,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, va newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -346,7 +328,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, va newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -357,28 +338,25 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, va newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoRpcApiService Summary: Echo rpc Description Echo * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *ABitOfEverythingServiceEcho3Opts - Optional Parameters: + * @param optional nil or *EchoRpcApiABitOfEverythingServiceEcho3Opts - Optional Parameters: * @param "Value" (optional.String) - - @return SubStringMessage */ -type ABitOfEverythingServiceEcho3Opts struct { - Value optional.String +type EchoRpcApiABitOfEverythingServiceEcho3Opts struct { + Value optional.String } -func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, localVarOptionals *ABitOfEverythingServiceEcho3Opts) (SubStringMessage, *http.Response, error) { +func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, localVarOptionals *EchoRpcApiABitOfEverythingServiceEcho3Opts) (SubStringMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -398,7 +376,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo localVarQueryParams.Add("value", parameterToString(localVarOptionals.Value.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -456,7 +434,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v SubStringMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -467,7 +444,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -478,7 +454,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -489,7 +464,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -500,7 +474,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -511,7 +484,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -522,7 +494,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -533,7 +504,6 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/examples/internal/clients/abe/api_snake_enum_service.go b/examples/internal/clients/abe/api_snake_enum_service.go index 0c28d4ab4f4..2edcbd7177d 100644 --- a/examples/internal/clients/abe/api_snake_enum_service.go +++ b/examples/internal/clients/abe/api_snake_enum_service.go @@ -1,3 +1,4 @@ + /* * A Bit of Everything * @@ -7,7 +8,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe import ( @@ -25,14 +25,12 @@ var ( ) type SnakeEnumServiceApiService service - -/* +/* SnakeEnumServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param who * @param what * @param where - @return ExamplepbSnakeEnumResponse */ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Context, who string, what string, where string) (ExamplepbSnakeEnumResponse, *http.Response, error) { @@ -55,7 +53,7 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -113,7 +111,6 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSnakeEnumResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -124,7 +121,6 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -135,7 +131,6 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -146,7 +141,6 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -157,7 +151,6 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -168,7 +161,6 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -179,7 +171,6 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/examples/internal/clients/abe/client.go b/examples/internal/clients/abe/client.go index 3293aadf212..0a5e27a187f 100644 --- a/examples/internal/clients/abe/client.go +++ b/examples/internal/clients/abe/client.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe import ( @@ -191,7 +190,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -230,6 +229,16 @@ func (c *APIClient) prepareRequest( w.Close() } + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + // Setup path and query parameters url, err := url.Parse(path) if err != nil { @@ -471,4 +480,4 @@ func (e GenericSwaggerError) Body() []byte { // Model returns the unpacked model of the error func (e GenericSwaggerError) Model() interface{} { return e.model -} \ No newline at end of file +} diff --git a/examples/internal/clients/abe/configuration.go b/examples/internal/clients/abe/configuration.go index 3e85ff02f0f..20454201be0 100644 --- a/examples/internal/clients/abe/configuration.go +++ b/examples/internal/clients/abe/configuration.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe import ( @@ -61,7 +60,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "http://localhost", + BasePath: "/", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/abe/model_a_bit_of_everything.go b/examples/internal/clients/abe/model_a_bit_of_everything.go index 80fe399f711..ee16bbd16b6 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything.go @@ -7,9 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe - import ( "time" ) @@ -49,13 +47,11 @@ type ABitOfEverything struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` - // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` - // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_1.go b/examples/internal/clients/abe/model_a_bit_of_everything_1.go index bef01473473..0b3d67749a8 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_1.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_1.go @@ -7,9 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe - import ( "time" ) @@ -49,13 +47,11 @@ type ABitOfEverything1 struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` - // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` - // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_2.go b/examples/internal/clients/abe/model_a_bit_of_everything_2.go index 62c5847f084..2088fc504fa 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_2.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_2.go @@ -7,9 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe - import ( "time" ) @@ -19,9 +17,9 @@ type ABitOfEverything2 struct { SingleNested *ABitOfEverythingNested `json:"singleNested,omitempty"` Nested []ABitOfEverythingNested `json:"nested,omitempty"` // Float value field - FloatValue float32 `json:"floatValue,omitempty"` - DoubleValue float64 `json:"doubleValue,omitempty"` - Int64Value string `json:"int64Value,omitempty"` + FloatValue float32 `json:"floatValue"` + DoubleValue float64 `json:"doubleValue"` + Int64Value string `json:"int64Value"` Uint64Value string `json:"uint64Value,omitempty"` Int32Value int32 `json:"int32Value,omitempty"` Fixed64Value string `json:"fixed64Value,omitempty"` @@ -49,25 +47,23 @@ type ABitOfEverything2 struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` - // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` - // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` - RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation,omitempty"` + RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` OutputOnlyStringViaFieldBehaviorAnnotation string `json:"outputOnlyStringViaFieldBehaviorAnnotation,omitempty"` OptionalStringValue string `json:"optionalStringValue,omitempty"` // Only digits are allowed. ProductId []string `json:"productId,omitempty"` OptionalStringField string `json:"optionalStringField,omitempty"` - RequiredStringField1 string `json:"requiredStringField1,omitempty"` - RequiredStringField2 string `json:"requiredStringField2,omitempty"` - RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom,omitempty"` - RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom,omitempty"` + RequiredStringField1 string `json:"requiredStringField1"` + RequiredStringField2 string `json:"requiredStringField2"` + RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom"` + RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom"` TrailingOnly string `json:"trailingOnly,omitempty"` // Trailing only dot. TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_3.go b/examples/internal/clients/abe/model_a_bit_of_everything_3.go index e187a495328..ab034181653 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_3.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_3.go @@ -7,9 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe - import ( "time" ) @@ -41,6 +39,7 @@ type ABitOfEverything3 struct { OneofEmpty *interface{} `json:"oneofEmpty,omitempty"` OneofString string `json:"oneofString,omitempty"` MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"` + // Map of string description. MappedStringValue map[string]string `json:"mappedStringValue,omitempty"` MappedNestedValue map[string]ABitOfEverythingNested `json:"mappedNestedValue,omitempty"` NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"` @@ -48,13 +47,11 @@ type ABitOfEverything3 struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` - // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` - // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_4.go b/examples/internal/clients/abe/model_a_bit_of_everything_4.go index f389abd637f..193eaed9585 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_4.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_4.go @@ -7,9 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe - import ( "time" ) @@ -41,6 +39,7 @@ type ABitOfEverything4 struct { OneofEmpty *interface{} `json:"oneofEmpty,omitempty"` OneofString string `json:"oneofString,omitempty"` MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"` + // Map of string description. MappedStringValue map[string]string `json:"mappedStringValue,omitempty"` MappedNestedValue map[string]ABitOfEverythingNested `json:"mappedNestedValue,omitempty"` NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"` @@ -48,13 +47,11 @@ type ABitOfEverything4 struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` - // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` - // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation,omitempty"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_nested.go b/examples/internal/clients/abe/model_a_bit_of_everything_nested.go index 586778feaaa..39afd7713e8 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_nested.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_nested.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe // Nested is nested type. @@ -15,6 +14,5 @@ type ABitOfEverythingNested struct { // name is nested field. Name string `json:"name,omitempty"` Amount int64 `json:"amount,omitempty"` - // DeepEnum description. Ok *NestedDeepEnum `json:"ok,omitempty"` } diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body.go b/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body.go index 28f63ffccdf..3d832d84a4c 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body.go @@ -7,9 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe - import ( "time" ) @@ -50,13 +48,11 @@ type ABitOfEverythingServiceDeepPathEchoBody struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` - // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` - // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body_single_nested.go b/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body_single_nested.go index 2a60d84b6ef..e66242956a9 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body_single_nested.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body_single_nested.go @@ -7,12 +7,10 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe // Nested is nested type. type ABitOfEverythingServiceDeepPathEchoBodySingleNested struct { Amount int64 `json:"amount,omitempty"` - // DeepEnum description. Ok *NestedDeepEnum `json:"ok,omitempty"` } diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go b/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go index 8bdd7165a2d..3890cb98898 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ABitOfEverythingServicePostWithEmptyBodyBody struct { diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_service_update_v2_body.go b/examples/internal/clients/abe/model_a_bit_of_everything_service_update_v2_body.go index b9c2a37682d..bee582f5c40 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_service_update_v2_body.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_service_update_v2_body.go @@ -7,11 +7,10 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ABitOfEverythingServiceUpdateV2Body struct { - Abe *ABitOfEverything2 `json:"abe,omitempty"` + Abe *ABitOfEverything4 `json:"abe,omitempty"` // The paths to update. UpdateMask string `json:"updateMask,omitempty"` } diff --git a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go index 12a19aa4cab..478c6277789 100644 --- a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go +++ b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go @@ -7,9 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe - import ( "time" ) @@ -50,13 +48,11 @@ type ExamplepbABitOfEverything struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` - // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` - // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_repeated.go b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_repeated.go index 4e0b39bd9a1..e6fbb41ca28 100644 --- a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_repeated.go +++ b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_repeated.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ExamplepbABitOfEverythingRepeated struct { diff --git a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go index 0d41a76308f..1491aea9e08 100644 --- a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go +++ b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go @@ -7,9 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe - import ( "time" ) @@ -49,13 +47,11 @@ type ExamplepbABitOfEverythingServiceUpdateBody struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` - // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` - // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_examplepb_bar.go b/examples/internal/clients/abe/model_examplepb_bar.go index 40841f24c41..0318e13f255 100644 --- a/examples/internal/clients/abe/model_examplepb_bar.go +++ b/examples/internal/clients/abe/model_examplepb_bar.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ExamplepbBar struct { diff --git a/examples/internal/clients/abe/model_examplepb_body.go b/examples/internal/clients/abe/model_examplepb_body.go index 0c3d9c9b5b1..ace797a9ccf 100644 --- a/examples/internal/clients/abe/model_examplepb_body.go +++ b/examples/internal/clients/abe/model_examplepb_body.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ExamplepbBody struct { diff --git a/examples/internal/clients/abe/model_examplepb_book.go b/examples/internal/clients/abe/model_examplepb_book.go index 0246900a38c..086fd1a3f48 100644 --- a/examples/internal/clients/abe/model_examplepb_book.go +++ b/examples/internal/clients/abe/model_examplepb_book.go @@ -7,9 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe - import ( "time" ) diff --git a/examples/internal/clients/abe/model_examplepb_check_status_response.go b/examples/internal/clients/abe/model_examplepb_check_status_response.go index 602a53dc1ed..6439f51b0b6 100644 --- a/examples/internal/clients/abe/model_examplepb_check_status_response.go +++ b/examples/internal/clients/abe/model_examplepb_check_status_response.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ExamplepbCheckStatusResponse struct { diff --git a/examples/internal/clients/abe/model_examplepb_error_object.go b/examples/internal/clients/abe/model_examplepb_error_object.go index b41c68fa852..923750ec851 100644 --- a/examples/internal/clients/abe/model_examplepb_error_object.go +++ b/examples/internal/clients/abe/model_examplepb_error_object.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ExamplepbErrorObject struct { diff --git a/examples/internal/clients/abe/model_examplepb_error_response.go b/examples/internal/clients/abe/model_examplepb_error_response.go index 55e17df4a48..6abfae1f276 100644 --- a/examples/internal/clients/abe/model_examplepb_error_response.go +++ b/examples/internal/clients/abe/model_examplepb_error_response.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ExamplepbErrorResponse struct { diff --git a/examples/internal/clients/abe/model_examplepb_numeric_enum.go b/examples/internal/clients/abe/model_examplepb_numeric_enum.go index ca8dd50a639..aa92c09f9a2 100644 --- a/examples/internal/clients/abe/model_examplepb_numeric_enum.go +++ b/examples/internal/clients/abe/model_examplepb_numeric_enum.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe // ExamplepbNumericEnum : NumericEnum is one or zero. type ExamplepbNumericEnum string diff --git a/examples/internal/clients/abe/model_examplepb_required_message_type_request.go b/examples/internal/clients/abe/model_examplepb_required_message_type_request.go index 1dbd19ff092..e03cedad232 100644 --- a/examples/internal/clients/abe/model_examplepb_required_message_type_request.go +++ b/examples/internal/clients/abe/model_examplepb_required_message_type_request.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ExamplepbRequiredMessageTypeRequest struct { diff --git a/examples/internal/clients/abe/model_examplepb_snake_enum_response.go b/examples/internal/clients/abe/model_examplepb_snake_enum_response.go index eff692b9826..a6e17fbe100 100644 --- a/examples/internal/clients/abe/model_examplepb_snake_enum_response.go +++ b/examples/internal/clients/abe/model_examplepb_snake_enum_response.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ExamplepbSnakeEnumResponse struct { diff --git a/examples/internal/clients/abe/model_examplepbsnake_case_0_enum.go b/examples/internal/clients/abe/model_examplepbsnake_case_0_enum.go index 50f149d8268..5f9756a849c 100644 --- a/examples/internal/clients/abe/model_examplepbsnake_case_0_enum.go +++ b/examples/internal/clients/abe/model_examplepbsnake_case_0_enum.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe // ExamplepbsnakeCase0Enum : - value_e: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_f: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE type ExamplepbsnakeCase0Enum string diff --git a/examples/internal/clients/abe/model_examplepbsnake_case_enum.go b/examples/internal/clients/abe/model_examplepbsnake_case_enum.go index 003b2f22f26..4360a08e520 100644 --- a/examples/internal/clients/abe/model_examplepbsnake_case_enum.go +++ b/examples/internal/clients/abe/model_examplepbsnake_case_enum.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe // ExamplepbsnakeCaseEnum : - value_c: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_d: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE type ExamplepbsnakeCaseEnum string diff --git a/examples/internal/clients/abe/model_message_path_enum_nested_path_enum.go b/examples/internal/clients/abe/model_message_path_enum_nested_path_enum.go index ef64b6b71e8..f446f3bffcb 100644 --- a/examples/internal/clients/abe/model_message_path_enum_nested_path_enum.go +++ b/examples/internal/clients/abe/model_message_path_enum_nested_path_enum.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type MessagePathEnumNestedPathEnum string diff --git a/examples/internal/clients/abe/model_nested_deep_enum.go b/examples/internal/clients/abe/model_nested_deep_enum.go index da1c7e372ec..7308783288c 100644 --- a/examples/internal/clients/abe/model_nested_deep_enum.go +++ b/examples/internal/clients/abe/model_nested_deep_enum.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe // NestedDeepEnum : DeepEnum is one or zero. - FALSE: FALSE is false. - TRUE: TRUE is true. type NestedDeepEnum string diff --git a/examples/internal/clients/abe/model_oneofenum_example_enum.go b/examples/internal/clients/abe/model_oneofenum_example_enum.go index 939f0f7f192..946f30c780d 100644 --- a/examples/internal/clients/abe/model_oneofenum_example_enum.go +++ b/examples/internal/clients/abe/model_oneofenum_example_enum.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type OneofenumExampleEnum string diff --git a/examples/internal/clients/abe/model_pathenum_path_enum.go b/examples/internal/clients/abe/model_pathenum_path_enum.go index 810e1abe1a7..74f4a46590a 100644 --- a/examples/internal/clients/abe/model_pathenum_path_enum.go +++ b/examples/internal/clients/abe/model_pathenum_path_enum.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type PathenumPathEnum string diff --git a/examples/internal/clients/abe/model_pathenumsnake_case_for_import.go b/examples/internal/clients/abe/model_pathenumsnake_case_for_import.go index f6c7ec5100d..f95f891f593 100644 --- a/examples/internal/clients/abe/model_pathenumsnake_case_for_import.go +++ b/examples/internal/clients/abe/model_pathenumsnake_case_for_import.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe // PathenumsnakeCaseForImport : - value_x: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_y: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE type PathenumsnakeCaseForImport string diff --git a/examples/internal/clients/abe/model_protoexamplepb_foo.go b/examples/internal/clients/abe/model_protoexamplepb_foo.go index 343c0d93cc4..7241b58ac13 100644 --- a/examples/internal/clients/abe/model_protoexamplepb_foo.go +++ b/examples/internal/clients/abe/model_protoexamplepb_foo.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type ProtoexamplepbFoo struct { diff --git a/examples/internal/clients/abe/model_rpc_status.go b/examples/internal/clients/abe/model_rpc_status.go index 0bda0e2a94e..6754ef66612 100644 --- a/examples/internal/clients/abe/model_rpc_status.go +++ b/examples/internal/clients/abe/model_rpc_status.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe // The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). @@ -17,5 +16,5 @@ type RpcStatus struct { // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. Message string `json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of message types for APIs to use. - Details []ProtobufAny `json:"details,omitempty"` + Details []map[string]interface{} `json:"details,omitempty"` } diff --git a/examples/internal/clients/abe/model_sub_string_message.go b/examples/internal/clients/abe/model_sub_string_message.go index d4dcf4ebf16..413a781038a 100644 --- a/examples/internal/clients/abe/model_sub_string_message.go +++ b/examples/internal/clients/abe/model_sub_string_message.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe type SubStringMessage struct { diff --git a/examples/internal/clients/abe/model_v1_book_name_body.go b/examples/internal/clients/abe/model_v1_book_name_body.go new file mode 100644 index 00000000000..0eca51ce535 --- /dev/null +++ b/examples/internal/clients/abe/model_v1_book_name_body.go @@ -0,0 +1,21 @@ +/* + * A Bit of Everything + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0 + * Contact: none@example.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package abe +import ( + "time" +) + +// An example resource type from AIP-123 used to test the behavior described in the CreateBookRequest message. See: https://google.aip.dev/123 +type V1BookNameBody struct { + // Output only. The book's ID. + Id string `json:"id,omitempty"` + // Output only. Creation time of the book. + CreateTime time.Time `json:"createTime,omitempty"` +} diff --git a/examples/internal/clients/abe/model_v1_book_name_body_1.go b/examples/internal/clients/abe/model_v1_book_name_body_1.go new file mode 100644 index 00000000000..d69a8874469 --- /dev/null +++ b/examples/internal/clients/abe/model_v1_book_name_body_1.go @@ -0,0 +1,21 @@ +/* + * A Bit of Everything + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0 + * Contact: none@example.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package abe +import ( + "time" +) + +// An example resource type from AIP-123 used to test the behavior described in the CreateBookRequest message. See: https://google.aip.dev/123 +type V1BookNameBody1 struct { + // Output only. The book's ID. + Id string `json:"id,omitempty"` + // Output only. Creation time of the book. + CreateTime time.Time `json:"createTime,omitempty"` +} diff --git a/examples/internal/clients/abe/response.go b/examples/internal/clients/abe/response.go index a42d47cd7ab..4c949ea11ff 100644 --- a/examples/internal/clients/abe/response.go +++ b/examples/internal/clients/abe/response.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package abe import ( diff --git a/examples/internal/clients/echo/.swagger-codegen/VERSION b/examples/internal/clients/echo/.swagger-codegen/VERSION index 752a79ef362..b61c49d271a 100644 --- a/examples/internal/clients/echo/.swagger-codegen/VERSION +++ b/examples/internal/clients/echo/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8 \ No newline at end of file +3.0.71 \ No newline at end of file diff --git a/examples/internal/clients/echo/api/swagger.yaml b/examples/internal/clients/echo/api/swagger.yaml index a7871cf2238..73129246ad6 100644 --- a/examples/internal/clients/echo/api/swagger.yaml +++ b/examples/internal/clients/echo/api/swagger.yaml @@ -1,1145 +1,1414 @@ ---- -swagger: "2.0" +openapi: 3.0.1 info: - description: "Echo Service API consists of a single service which returns\na message." - version: "version not set" - title: "Echo Service" + title: Echo Service + description: |- + Echo Service API consists of a single service which returns + a message. + version: version not set +servers: +- url: / tags: -- name: "EchoService" -consumes: -- "application/json" -produces: -- "application/json" +- name: EchoService paths: /v1/example/echo/nested/{nId.nId}: get: tags: - - "EchoService" - summary: "Echo method receives a simple message and returns it." - description: "The message posted as the id parameter will also be\nreturned." - operationId: "EchoService_Echo7" + - EchoService + summary: Echo method receives a simple message and returns it. + description: |- + The message posted as the id parameter will also be + returned. + operationId: EchoService_Echo7 parameters: - - name: "nId.nId" - in: "path" + - name: nId.nId + in: path required: true - type: "string" - x-exportParamName: "NIdNId" - - name: "id" - in: "query" - description: "Id represents the message identifier." - required: false - type: "string" - x-exportParamName: "Id" - x-optionalDataType: "String" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: simple + explode: false + schema: + type: string + - name: id + in: query + description: Id represents the message identifier. + required: false + style: form + explode: true + schema: + type: string + - name: num + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo/resource/{resourceId}: get: tags: - - "EchoService" - summary: "Echo method receives a simple message and returns it." - description: "The message posted as the id parameter will also be\nreturned." - operationId: "EchoService_Echo6" + - EchoService + summary: Echo method receives a simple message and returns it. + description: |- + The message posted as the id parameter will also be + returned. + operationId: EchoService_Echo6 parameters: - - name: "resourceId" - in: "path" + - name: resourceId + in: path required: true - type: "string" - x-exportParamName: "ResourceId" - - name: "id" - in: "query" - description: "Id represents the message identifier." - required: false - type: "string" - x-exportParamName: "Id" - x-optionalDataType: "String" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: simple + explode: false + schema: + type: string + - name: id + in: query + description: Id represents the message identifier. + required: false + style: form + explode: true + schema: + type: string + - name: num + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo/{id}: post: tags: - - "EchoService" - summary: "Echo method receives a simple message and returns it." - description: "The message posted as the id parameter will also be\nreturned." - operationId: "EchoService_Echo" + - EchoService + summary: Echo method receives a simple message and returns it. + description: |- + The message posted as the id parameter will also be + returned. + operationId: EchoService_Echo parameters: - - name: "id" - in: "path" - description: "Id represents the message identifier." + - name: id + in: path + description: Id represents the message identifier. required: true - type: "string" - x-exportParamName: "Id" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: simple + explode: false + schema: + type: string + - name: num + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo/{id}/{num}: get: tags: - - "EchoService" - summary: "Echo method receives a simple message and returns it." - description: "The message posted as the id parameter will also be\nreturned." - operationId: "EchoService_Echo2" + - EchoService + summary: Echo method receives a simple message and returns it. + description: |- + The message posted as the id parameter will also be + returned. + operationId: EchoService_Echo2 parameters: - - name: "id" - in: "path" - description: "Id represents the message identifier." + - name: id + in: path + description: Id represents the message identifier. required: true - type: "string" - x-exportParamName: "Id" - - name: "num" - in: "path" + style: simple + explode: false + schema: + type: string + - name: num + in: path required: true - type: "string" - format: "int64" - x-exportParamName: "Num" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: simple + explode: false + schema: + type: string + format: int64 + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo/{id}/{num}/{lang}: get: tags: - - "EchoService" - summary: "Echo method receives a simple message and returns it." - description: "The message posted as the id parameter will also be\nreturned." - operationId: "EchoService_Echo3" + - EchoService + summary: Echo method receives a simple message and returns it. + description: |- + The message posted as the id parameter will also be + returned. + operationId: EchoService_Echo3 parameters: - - name: "id" - in: "path" - description: "Id represents the message identifier." + - name: id + in: path + description: Id represents the message identifier. required: true - type: "string" - x-exportParamName: "Id" - - name: "num" - in: "path" + style: simple + explode: false + schema: + type: string + - name: num + in: path required: true - type: "string" - format: "int64" - x-exportParamName: "Num" - - name: "lang" - in: "path" + style: simple + explode: false + schema: + type: string + format: int64 + - name: lang + in: path required: true - type: "string" - x-exportParamName: "Lang" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: simple + explode: false + schema: + type: string + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo1/{id}/{lineNum}/{status.note}: get: tags: - - "EchoService" - summary: "Echo method receives a simple message and returns it." - description: "The message posted as the id parameter will also be\nreturned." - operationId: "EchoService_Echo4" + - EchoService + summary: Echo method receives a simple message and returns it. + description: |- + The message posted as the id parameter will also be + returned. + operationId: EchoService_Echo4 parameters: - - name: "id" - in: "path" - description: "Id represents the message identifier." + - name: id + in: path + description: Id represents the message identifier. required: true - type: "string" - x-exportParamName: "Id" - - name: "lineNum" - in: "path" + style: simple + explode: false + schema: + type: string + - name: lineNum + in: path required: true - type: "string" - format: "int64" - x-exportParamName: "LineNum" - - name: "status.note" - in: "path" + style: simple + explode: false + schema: + type: string + format: int64 + - name: status.note + in: path required: true - type: "string" - x-exportParamName: "StatusNote" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: simple + explode: false + schema: + type: string + - name: num + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo2/{no.note}: get: tags: - - "EchoService" - summary: "Echo method receives a simple message and returns it." - description: "The message posted as the id parameter will also be\nreturned." - operationId: "EchoService_Echo5" + - EchoService + summary: Echo method receives a simple message and returns it. + description: |- + The message posted as the id parameter will also be + returned. + operationId: EchoService_Echo5 parameters: - - name: "no.note" - in: "path" + - name: no.note + in: path required: true - type: "string" - x-exportParamName: "NoNote" - - name: "id" - in: "query" - description: "Id represents the message identifier." - required: false - type: "string" - x-exportParamName: "Id" - x-optionalDataType: "String" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: simple + explode: false + schema: + type: string + - name: id + in: query + description: Id represents the message identifier. + required: false + style: form + explode: true + schema: + type: string + - name: num + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo_body: post: tags: - - "EchoService" - summary: "EchoBody method receives a simple message and returns it." - operationId: "EchoService_EchoBody" - parameters: - - in: "body" - name: "body" - description: "SimpleMessage represents a simple message sent to the Echo service." + - EchoService + summary: EchoBody method receives a simple message and returns it. + operationId: EchoService_EchoBody + requestBody: + description: SimpleMessage represents a simple message sent to the Echo service. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" required: true - schema: - $ref: "#/definitions/examplepbSimpleMessage" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /v1/example/echo_body/{id}: put: tags: - - "EchoService" - summary: "EchoBody method receives a simple message and returns it." - operationId: "EchoService_EchoBody2" + - EchoService + summary: EchoBody method receives a simple message and returns it. + operationId: EchoService_EchoBody2 parameters: - - name: "id" - in: "path" - description: "Id represents the message identifier." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "no" + - name: id + in: path + description: Id represents the message identifier. required: true + style: simple + explode: false + schema: + type: string + - name: num + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true schema: - $ref: "#/definitions/examplepbEmbedded" - x-exportParamName: "No" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbEmbedded" + required: true responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: "no" /v1/example/echo_delete: delete: tags: - - "EchoService" - summary: "EchoDelete method receives a simple message and returns it." - operationId: "EchoService_EchoDelete" + - EchoService + summary: EchoDelete method receives a simple message and returns it. + operationId: EchoService_EchoDelete parameters: - - name: "id" - in: "query" - description: "Id represents the message identifier." - required: false - type: "string" - x-exportParamName: "Id" - x-optionalDataType: "String" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + - name: id + in: query + description: Id represents the message identifier. + required: false + style: form + explode: true + schema: + type: string + - name: num + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo_patch: patch: tags: - - "EchoService" - summary: "EchoPatch method receives a NonStandardUpdateRequest and returns it." - operationId: "EchoService_EchoPatch" - parameters: - - in: "body" - name: "body" + - EchoService + summary: EchoPatch method receives a NonStandardUpdateRequest and returns it. + operationId: EchoService_EchoPatch + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbDynamicMessage" required: true - schema: - $ref: "#/definitions/examplepbDynamicMessage" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbDynamicMessageUpdate" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbDynamicMessageUpdate" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /v1/example/echo_unauthorized: get: tags: - - "EchoService" - summary: "EchoUnauthorized method receives a simple message and returns it.\ - \ It must\nalways return a google.rpc.Code of `UNAUTHENTICATED` and a HTTP\ - \ Status code\nof 401." - operationId: "EchoService_EchoUnauthorized" + - EchoService + summary: |- + EchoUnauthorized method receives a simple message and returns it. It must + always return a google.rpc.Code of `UNAUTHENTICATED` and a HTTP Status code + of 401. + operationId: EchoService_EchoUnauthorized parameters: - - name: "id" - in: "query" - description: "Id represents the message identifier." - required: false - type: "string" - x-exportParamName: "Id" - x-optionalDataType: "String" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + - name: id + in: query + description: Id represents the message identifier. + required: false + style: form + explode: true + schema: + type: string + - name: num + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" -definitions: - examplepbDynamicMessage: - type: "object" - properties: - structField: - type: "object" - properties: {} - valueField: {} - description: "DynamicMessage represents a message which can have its structure\n\ - built dynamically using Struct and Values." - example: - structField: "{}" - valueField: "" - examplepbDynamicMessageUpdate: - type: "object" - properties: - body: - $ref: "#/definitions/examplepbDynamicMessage" - updateMask: - type: "string" - example: - body: - structField: "{}" - valueField: "" - updateMask: "updateMask" - examplepbEmbedded: - type: "object" - properties: - progress: - type: "string" - format: "int64" - note: - type: "string" - description: "Embedded represents a message embedded in SimpleMessage." - example: - note: "note" - progress: "progress" - examplepbNestedMessage: - type: "object" - properties: - nId: - type: "string" - val: - type: "string" - example: - val: "val" - nId: "nId" - examplepbSimpleMessage: - type: "object" - properties: - id: - type: "string" - description: "Id represents the message identifier." - num: - type: "string" - format: "int64" - lineNum: - type: "string" - format: "int64" - lang: - type: "string" - status: - $ref: "#/definitions/examplepbEmbedded" - en: - type: "string" - format: "int64" - "no": - $ref: "#/definitions/examplepbEmbedded" - resourceId: - type: "string" - nId: - $ref: "#/definitions/examplepbNestedMessage" - description: "SimpleMessage represents a simple message sent to the Echo service." - example: - "no": - note: "note" - progress: "progress" - resourceId: "resourceId" - num: "num" - nId: - val: "val" - nId: "nId" - lineNum: "lineNum" - en: "en" - id: "id" - lang: "lang" - status: - note: "note" - progress: "progress" - protobufAny: - type: "object" - properties: - '@type': - type: "string" - description: "A URL/resource name that uniquely identifies the type of the\ - \ serialized\nprotocol buffer message. This string must contain at least\n\ - one \"/\" character. The last segment of the URL's path must represent\n\ - the fully qualified name of the type (as in\n`path/google.protobuf.Duration`).\ - \ The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\ - \nIn practice, teams usually precompile into the binary all types that they\n\ - expect it to use in the context of Any. However, for URLs which use the\n\ - scheme `http`, `https`, or no scheme, one can optionally set up a type\n\ - server that maps type URLs to message definitions as follows:\n\n* If no\ - \ scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must\ - \ yield a [google.protobuf.Type][]\n value in binary format, or produce\ - \ an error.\n* Applications are allowed to cache lookup results based on\ - \ the\n URL, or have them precompiled into a binary to avoid any\n lookup.\ - \ Therefore, binary compatibility needs to be preserved\n on changes to\ - \ types. (Use versioned type names to manage\n breaking changes.)\n\nNote:\ - \ this functionality is not currently available in the official\nprotobuf\ - \ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\ - \ As of May 2023, there are no widely used type server\nimplementations\ - \ and no plans to implement one.\n\nSchemes other than `http`, `https` (or\ - \ the empty scheme) might be\nused with implementation specific semantics." - description: "`Any` contains an arbitrary serialized protocol buffer message along\ - \ with a\nURL that describes the type of the serialized message.\n\nProtobuf\ - \ library provides support to pack/unpack Any values in the form\nof utility\ - \ functions or additional generated methods of the Any type.\n\nExample 1: Pack\ - \ and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n\ - \ ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack\ - \ and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n\ - \ ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n\ - \ }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n\ - \ foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack\ - \ and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n \ - \ any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n\ - \ ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n\ - \ any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n\ - \ ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err !=\ - \ nil {\n ...\n }\n\nThe pack methods provided by protobuf library\ - \ will by default use\n'type.googleapis.com/full.type.name' as the type URL\ - \ and the unpack\nmethods only use the fully qualified type name after the last\ - \ '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\ - name \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses\ - \ the regular\nrepresentation of the deserialized, embedded message, with an\n\ - additional field `@type` which contains the type URL. Example:\n\n package\ - \ google.profile;\n message Person {\n string first_name = 1;\n \ - \ string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\ - ,\n \"firstName\": ,\n \"lastName\": \n }\n\nIf\ - \ the embedded message type is well-known and has a custom JSON\nrepresentation,\ - \ that representation will be embedded adding a field\n`value` which holds the\ - \ custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\ - \n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n\ - \ \"value\": \"1.212s\"\n }" - additionalProperties: {} - protobufNullValue: - type: "string" - description: "`NullValue` is a singleton enumeration to represent the null value\ - \ for the\n`Value` type union.\n\nThe JSON representation for `NullValue` is\ - \ JSON `null`.\n\n - NULL_VALUE: Null value." - enum: - - "NULL_VALUE" - default: "NULL_VALUE" - rpcStatus: - type: "object" - properties: - code: - type: "integer" - format: "int32" - description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - message: - type: "string" - description: "A developer-facing error message, which should be in English.\ - \ Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details]\ - \ field, or localized by the client." - details: - type: "array" - description: "A list of messages that carry the error details. There is a\ - \ common set of\nmessage types for APIs to use." - items: - $ref: "#/definitions/protobufAny" - description: "The `Status` type defines a logical error model that is suitable\ - \ for\ndifferent programming environments, including REST APIs and RPC APIs.\ - \ It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\n\ - three pieces of data: error code, error message, and error details.\n\nYou can\ - \ find out more about this error model and how to work with it in the\n[API\ - \ Design Guide](https://cloud.google.com/apis/design/errors)." + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" +components: + schemas: + examplepbDynamicMessage: + type: object + properties: + structField: + type: object + properties: {} + example: {} + valueField: + type: object + description: |- + DynamicMessage represents a message which can have its structure + built dynamically using Struct and Values. + example: + structField: {} + valueField: {} + examplepbDynamicMessageUpdate: + type: object + properties: + body: + $ref: "#/components/schemas/examplepbDynamicMessage" + updateMask: + type: string + example: + body: + structField: {} + valueField: {} + updateMask: updateMask + examplepbEmbedded: + type: object + properties: + progress: + type: string + format: int64 + note: + type: string + description: Embedded represents a message embedded in SimpleMessage. + example: + note: note + progress: progress + examplepbNestedMessage: + type: object + properties: + nId: + type: string + val: + type: string + example: + val: val + nId: nId + examplepbSimpleMessage: + type: object + properties: + id: + type: string + description: Id represents the message identifier. + num: + type: string + format: int64 + lineNum: + type: string + format: int64 + lang: + type: string + status: + $ref: "#/components/schemas/examplepbEmbedded" + en: + type: string + format: int64 + "no": + $ref: "#/components/schemas/examplepbEmbedded" + resourceId: + type: string + nId: + $ref: "#/components/schemas/examplepbNestedMessage" + description: SimpleMessage represents a simple message sent to the Echo service. + example: + "no": null + resourceId: resourceId + num: num + nId: + val: val + nId: nId + lineNum: lineNum + en: en + id: id + lang: lang + status: + note: note + progress: progress + protobufAny: + type: object + properties: + '@type': + type: string + description: |- + A URL/resource name that uniquely identifies the type of the serialized + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a canonical form + (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that they + expect it to use in the context of Any. However, for URLs which use the + scheme `http`, `https`, or no scheme, one can optionally set up a type + server that maps type URLs to message definitions as follows: + + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. As of May 2023, there are no widely used type server + implementations and no plans to implement one. + + Schemes other than `http`, `https` (or the empty scheme) might be + used with implementation specific semantics. + additionalProperties: + type: object + description: |- + `Any` contains an arbitrary serialized protocol buffer message along with a + URL that describes the type of the serialized message. + + Protobuf library provides support to pack/unpack Any values in the form + of utility functions or additional generated methods of the Any type. + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the unpack + methods only use the fully qualified type name after the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type + name "y.z". + + JSON + ==== + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with an + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + representation, that representation will be embedded adding a field + `value` which holds the custom JSON in addition to the `@type` + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + x-schema-name: protobufAny + protobufNullValue: + type: string + description: |- + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + + - NULL_VALUE: Null value. + enum: + - NULL_VALUE + default: NULL_VALUE + rpcStatus: + type: object + properties: + code: + type: integer + description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." + format: int32 + message: + type: string + description: |- + A developer-facing error message, which should be in English. Any + user-facing error message should be localized and sent in the + [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + details: + type: array + description: |- + A list of messages that carry the error details. There is a common set of + message types for APIs to use. + items: + $ref: "#/components/schemas/protobufAny" + description: |- + The `Status` type defines a logical error model that is suitable for + different programming environments, including REST APIs and RPC APIs. It is + used by [gRPC](https://github.com/grpc). Each `Status` message contains + three pieces of data: error code, error message, and error details. + + You can find out more about this error model and how to work with it in the + [API Design Guide](https://cloud.google.com/apis/design/errors). +x-original-swagger-version: "2.0" diff --git a/examples/internal/clients/echo/api_echo_service.go b/examples/internal/clients/echo/api_echo_service.go index c5807965d34..4f3b2a46cfd 100644 --- a/examples/internal/clients/echo/api_echo_service.go +++ b/examples/internal/clients/echo/api_echo_service.go @@ -1,3 +1,4 @@ + /* * Echo Service * @@ -6,7 +7,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo import ( @@ -25,13 +25,12 @@ var ( ) type EchoServiceApiService service - -/* +/* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id Id represents the message identifier. - * @param optional nil or *EchoServiceEchoOpts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEchoOpts - Optional Parameters: * @param "Num" (optional.String) - * @param "LineNum" (optional.String) - * @param "Lang" (optional.String) - @@ -43,25 +42,24 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEchoOpts struct { - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEchoOpts struct { + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, localVarOptionals *EchoServiceEchoOpts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, localVarOptionals *EchoServiceApiEchoServiceEchoOpts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -112,7 +110,7 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -157,7 +155,6 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -168,7 +165,6 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -179,20 +175,18 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id Id represents the message identifier. * @param num - * @param optional nil or *EchoServiceEcho2Opts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEcho2Opts - Optional Parameters: * @param "LineNum" (optional.String) - * @param "Lang" (optional.String) - * @param "StatusProgress" (optional.String) - @@ -203,24 +197,23 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEcho2Opts struct { - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho2Opts struct { + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, num string, localVarOptionals *EchoServiceEcho2Opts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, num string, localVarOptionals *EchoServiceApiEchoServiceEcho2Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -269,7 +262,7 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -314,7 +307,6 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -325,7 +317,6 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -336,21 +327,19 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id Id represents the message identifier. * @param num * @param lang - * @param optional nil or *EchoServiceEcho3Opts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEcho3Opts - Optional Parameters: * @param "LineNum" (optional.String) - * @param "StatusProgress" (optional.String) - * @param "StatusNote" (optional.String) - @@ -360,23 +349,22 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEcho3Opts struct { - LineNum optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho3Opts struct { + LineNum optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, num string, lang string, localVarOptionals *EchoServiceEcho3Opts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, num string, lang string, localVarOptionals *EchoServiceApiEchoServiceEcho3Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -423,7 +411,7 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -468,7 +456,6 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -479,7 +466,6 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -490,21 +476,19 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id Id represents the message identifier. * @param lineNum * @param statusNote - * @param optional nil or *EchoServiceEcho4Opts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEcho4Opts - Optional Parameters: * @param "Num" (optional.String) - * @param "Lang" (optional.String) - * @param "StatusProgress" (optional.String) - @@ -513,22 +497,21 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEcho4Opts struct { - Num optional.String - Lang optional.String - StatusProgress optional.String - En optional.String - NoProgress optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho4Opts struct { + Num optional.String + Lang optional.String + StatusProgress optional.String + En optional.String + NoProgress optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, lineNum string, statusNote string, localVarOptionals *EchoServiceEcho4Opts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, lineNum string, statusNote string, localVarOptionals *EchoServiceApiEchoServiceEcho4Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -572,7 +555,7 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -617,7 +600,6 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -628,7 +610,6 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -639,19 +620,17 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param noNote - * @param optional nil or *EchoServiceEcho5Opts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEcho5Opts - Optional Parameters: * @param "Id" (optional.String) - Id represents the message identifier. * @param "Num" (optional.String) - * @param "LineNum" (optional.String) - @@ -662,24 +641,23 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEcho5Opts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - En optional.String - NoProgress optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho5Opts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + En optional.String + NoProgress optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote string, localVarOptionals *EchoServiceEcho5Opts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote string, localVarOptionals *EchoServiceApiEchoServiceEcho5Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -727,7 +705,7 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -772,7 +750,6 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -783,7 +760,6 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -794,19 +770,17 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param resourceId - * @param optional nil or *EchoServiceEcho6Opts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEcho6Opts - Optional Parameters: * @param "Id" (optional.String) - Id represents the message identifier. * @param "Num" (optional.String) - * @param "LineNum" (optional.String) - @@ -818,25 +792,24 @@ The message posted as the id parameter will also be returned. * @param "NoNote" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEcho6Opts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho6Opts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId string, localVarOptionals *EchoServiceEcho6Opts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId string, localVarOptionals *EchoServiceApiEchoServiceEcho6Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -887,7 +860,7 @@ func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -932,7 +905,6 @@ func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -943,7 +915,6 @@ func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -954,19 +925,17 @@ func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param nIdNId - * @param optional nil or *EchoServiceEcho7Opts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEcho7Opts - Optional Parameters: * @param "Id" (optional.String) - Id represents the message identifier. * @param "Num" (optional.String) - * @param "LineNum" (optional.String) - @@ -978,25 +947,24 @@ The message posted as the id parameter will also be returned. * @param "NoNote" (optional.String) - * @param "ResourceId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEcho7Opts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho7Opts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId string, localVarOptionals *EchoServiceEcho7Opts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId string, localVarOptionals *EchoServiceApiEchoServiceEcho7Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -1047,7 +1015,7 @@ func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId str localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1092,7 +1060,6 @@ func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId str body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1103,7 +1070,6 @@ func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1114,18 +1080,15 @@ func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService EchoBody method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body SimpleMessage represents a simple message sent to the Echo service. - @return ExamplepbSimpleMessage */ func (a *EchoServiceApiService) EchoServiceEchoBody(ctx context.Context, body ExamplepbSimpleMessage) (ExamplepbSimpleMessage, *http.Response, error) { @@ -1192,7 +1155,6 @@ func (a *EchoServiceApiService) EchoServiceEchoBody(ctx context.Context, body Ex body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1203,7 +1165,6 @@ func (a *EchoServiceApiService) EchoServiceEchoBody(ctx context.Context, body Ex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1214,19 +1175,17 @@ func (a *EchoServiceApiService) EchoServiceEchoBody(ctx context.Context, body Ex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService EchoBody method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body * @param id Id represents the message identifier. - * @param no - * @param optional nil or *EchoServiceEchoBody2Opts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEchoBody2Opts - Optional Parameters: * @param "Num" (optional.String) - * @param "LineNum" (optional.String) - * @param "Lang" (optional.String) - @@ -1235,22 +1194,21 @@ EchoServiceApiService EchoBody method receives a simple message and returns it. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEchoBody2Opts struct { - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEchoBody2Opts struct { + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, id string, no ExamplepbEmbedded, localVarOptionals *EchoServiceEchoBody2Opts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, body ExamplepbEmbedded, id string, localVarOptionals *EchoServiceApiEchoServiceEchoBody2Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -1309,7 +1267,7 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, id str localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &no + localVarPostBody = &body r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -1339,7 +1297,6 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, id str body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1350,7 +1307,6 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, id str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1361,17 +1317,15 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, id str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService EchoDelete method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *EchoServiceEchoDeleteOpts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEchoDeleteOpts - Optional Parameters: * @param "Id" (optional.String) - Id represents the message identifier. * @param "Num" (optional.String) - * @param "LineNum" (optional.String) - @@ -1384,26 +1338,25 @@ EchoServiceApiService EchoDelete method receives a simple message and returns it * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEchoDeleteOpts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEchoDeleteOpts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, localVarOptionals *EchoServiceEchoDeleteOpts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, localVarOptionals *EchoServiceApiEchoServiceEchoDeleteOpts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") localVarPostBody interface{} @@ -1456,7 +1409,7 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1501,7 +1454,6 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1512,7 +1464,6 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1523,18 +1474,15 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService EchoPatch method receives a NonStandardUpdateRequest and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body - @return ExamplepbDynamicMessageUpdate */ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body ExamplepbDynamicMessage) (ExamplepbDynamicMessageUpdate, *http.Response, error) { @@ -1601,7 +1549,6 @@ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body E body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbDynamicMessageUpdate err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1612,7 +1559,6 @@ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body E newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1623,17 +1569,15 @@ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body E newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* EchoServiceApiService EchoUnauthorized method receives a simple message and returns it. It must always return a google.rpc.Code of `UNAUTHENTICATED` and a HTTP Status code of 401. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *EchoServiceEchoUnauthorizedOpts - Optional Parameters: + * @param optional nil or *EchoServiceApiEchoServiceEchoUnauthorizedOpts - Optional Parameters: * @param "Id" (optional.String) - Id represents the message identifier. * @param "Num" (optional.String) - * @param "LineNum" (optional.String) - @@ -1646,26 +1590,25 @@ EchoServiceApiService EchoUnauthorized method receives a simple message and retu * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbSimpleMessage */ -type EchoServiceEchoUnauthorizedOpts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEchoUnauthorizedOpts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, localVarOptionals *EchoServiceEchoUnauthorizedOpts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, localVarOptionals *EchoServiceApiEchoServiceEchoUnauthorizedOpts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -1718,7 +1661,7 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1763,7 +1706,6 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1774,7 +1716,6 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1785,7 +1726,6 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/examples/internal/clients/echo/client.go b/examples/internal/clients/echo/client.go index d0e2045800c..562ee4166ff 100644 --- a/examples/internal/clients/echo/client.go +++ b/examples/internal/clients/echo/client.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo import ( @@ -181,7 +180,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -220,6 +219,16 @@ func (c *APIClient) prepareRequest( w.Close() } + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + // Setup path and query parameters url, err := url.Parse(path) if err != nil { @@ -461,4 +470,4 @@ func (e GenericSwaggerError) Body() []byte { // Model returns the unpacked model of the error func (e GenericSwaggerError) Model() interface{} { return e.model -} \ No newline at end of file +} diff --git a/examples/internal/clients/echo/configuration.go b/examples/internal/clients/echo/configuration.go index 6a44e4c9cf6..89d6931a32c 100644 --- a/examples/internal/clients/echo/configuration.go +++ b/examples/internal/clients/echo/configuration.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo import ( @@ -60,7 +59,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "https://localhost", + BasePath: "/", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/echo/model_examplepb_dynamic_message.go b/examples/internal/clients/echo/model_examplepb_dynamic_message.go index dae5858f199..3f113c64248 100644 --- a/examples/internal/clients/echo/model_examplepb_dynamic_message.go +++ b/examples/internal/clients/echo/model_examplepb_dynamic_message.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo // DynamicMessage represents a message which can have its structure built dynamically using Struct and Values. diff --git a/examples/internal/clients/echo/model_examplepb_dynamic_message_update.go b/examples/internal/clients/echo/model_examplepb_dynamic_message_update.go index 086ab7c045e..71d571ddd67 100644 --- a/examples/internal/clients/echo/model_examplepb_dynamic_message_update.go +++ b/examples/internal/clients/echo/model_examplepb_dynamic_message_update.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo type ExamplepbDynamicMessageUpdate struct { diff --git a/examples/internal/clients/echo/model_examplepb_embedded.go b/examples/internal/clients/echo/model_examplepb_embedded.go index 7f6ff8a7848..4f40a5a8dca 100644 --- a/examples/internal/clients/echo/model_examplepb_embedded.go +++ b/examples/internal/clients/echo/model_examplepb_embedded.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo // Embedded represents a message embedded in SimpleMessage. diff --git a/examples/internal/clients/echo/model_examplepb_nested_message.go b/examples/internal/clients/echo/model_examplepb_nested_message.go index fc20b232123..db91506bfeb 100644 --- a/examples/internal/clients/echo/model_examplepb_nested_message.go +++ b/examples/internal/clients/echo/model_examplepb_nested_message.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo type ExamplepbNestedMessage struct { diff --git a/examples/internal/clients/echo/model_examplepb_simple_message.go b/examples/internal/clients/echo/model_examplepb_simple_message.go index c6e66072a0a..84c99d6b5d8 100644 --- a/examples/internal/clients/echo/model_examplepb_simple_message.go +++ b/examples/internal/clients/echo/model_examplepb_simple_message.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo // SimpleMessage represents a simple message sent to the Echo service. diff --git a/examples/internal/clients/echo/model_protobuf_null_value.go b/examples/internal/clients/echo/model_protobuf_null_value.go index 1f7188c2187..309cf777c1b 100644 --- a/examples/internal/clients/echo/model_protobuf_null_value.go +++ b/examples/internal/clients/echo/model_protobuf_null_value.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo // ProtobufNullValue : `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. type ProtobufNullValue string diff --git a/examples/internal/clients/echo/model_rpc_status.go b/examples/internal/clients/echo/model_rpc_status.go index f87184fd029..07e8704ce7e 100644 --- a/examples/internal/clients/echo/model_rpc_status.go +++ b/examples/internal/clients/echo/model_rpc_status.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo // The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). @@ -16,5 +15,5 @@ type RpcStatus struct { // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. Message string `json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of message types for APIs to use. - Details []ProtobufAny `json:"details,omitempty"` + Details []map[string]interface{} `json:"details,omitempty"` } diff --git a/examples/internal/clients/echo/response.go b/examples/internal/clients/echo/response.go index a82295589de..08b1ed02a87 100644 --- a/examples/internal/clients/echo/response.go +++ b/examples/internal/clients/echo/response.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package echo import ( diff --git a/examples/internal/clients/generateunboundmethods/.swagger-codegen/VERSION b/examples/internal/clients/generateunboundmethods/.swagger-codegen/VERSION index 752a79ef362..b61c49d271a 100644 --- a/examples/internal/clients/generateunboundmethods/.swagger-codegen/VERSION +++ b/examples/internal/clients/generateunboundmethods/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8 \ No newline at end of file +3.0.71 \ No newline at end of file diff --git a/examples/internal/clients/generateunboundmethods/api/swagger.yaml b/examples/internal/clients/generateunboundmethods/api/swagger.yaml index 746556eff27..e36e8498bb2 100644 --- a/examples/internal/clients/generateunboundmethods/api/swagger.yaml +++ b/examples/internal/clients/generateunboundmethods/api/swagger.yaml @@ -1,124 +1,142 @@ ---- -swagger: "2.0" +openapi: 3.0.1 info: - description: "Generate Unannotated Methods Echo Service\nSimilar to echo_service.proto\ - \ but without annotations and without external configuration.\n\nGenerate Unannotated\ - \ Methods Echo Service API consists of a single service which returns\na message." - version: "version not set" - title: "examples/internal/proto/examplepb/generate_unbound_methods.proto" + title: examples/internal/proto/examplepb/generate_unbound_methods.proto + description: |- + Generate Unannotated Methods Echo Service + Similar to echo_service.proto but without annotations and without external configuration. + + Generate Unannotated Methods Echo Service API consists of a single service which returns + a message. + version: version not set +servers: +- url: / tags: -- name: "GenerateUnboundMethodsEchoService" -consumes: -- "application/json" -produces: -- "application/json" +- name: GenerateUnboundMethodsEchoService paths: /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/Echo: post: tags: - - "GenerateUnboundMethodsEchoService" - summary: "Echo method receives a simple message and returns it." - description: "The message posted as the id parameter will also be\nreturned." - operationId: "GenerateUnboundMethodsEchoService_Echo" - parameters: - - in: "body" - name: "body" - description: "GenerateUnboundMethodsSimpleMessage represents a simple message\ - \ sent to the unannotated GenerateUnboundMethodsEchoService service." + - GenerateUnboundMethodsEchoService + summary: Echo method receives a simple message and returns it. + description: |- + The message posted as the id parameter will also be + returned. + operationId: GenerateUnboundMethodsEchoService_Echo + requestBody: + description: GenerateUnboundMethodsSimpleMessage represents a simple message + sent to the unannotated GenerateUnboundMethodsEchoService service. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" required: true - schema: - $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/EchoBody: post: tags: - - "GenerateUnboundMethodsEchoService" - summary: "EchoBody method receives a simple message and returns it." - operationId: "GenerateUnboundMethodsEchoService_EchoBody" - parameters: - - in: "body" - name: "body" - description: "GenerateUnboundMethodsSimpleMessage represents a simple message\ - \ sent to the unannotated GenerateUnboundMethodsEchoService service." + - GenerateUnboundMethodsEchoService + summary: EchoBody method receives a simple message and returns it. + operationId: GenerateUnboundMethodsEchoService_EchoBody + requestBody: + description: GenerateUnboundMethodsSimpleMessage represents a simple message + sent to the unannotated GenerateUnboundMethodsEchoService service. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" required: true - schema: - $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/EchoDelete: post: tags: - - "GenerateUnboundMethodsEchoService" - summary: "EchoDelete method receives a simple message and returns it." - operationId: "GenerateUnboundMethodsEchoService_EchoDelete" - parameters: - - in: "body" - name: "body" - description: "GenerateUnboundMethodsSimpleMessage represents a simple message\ - \ sent to the unannotated GenerateUnboundMethodsEchoService service." + - GenerateUnboundMethodsEchoService + summary: EchoDelete method receives a simple message and returns it. + operationId: GenerateUnboundMethodsEchoService_EchoDelete + requestBody: + description: GenerateUnboundMethodsSimpleMessage represents a simple message + sent to the unannotated GenerateUnboundMethodsEchoService service. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" required: true - schema: - $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" -definitions: - examplepbGenerateUnboundMethodsSimpleMessage: - type: "object" - properties: - id: - type: "string" - description: "Id represents the message identifier." - num: - type: "string" - format: "int64" - duration: - type: "string" - description: "GenerateUnboundMethodsSimpleMessage represents a simple message\ - \ sent to the unannotated GenerateUnboundMethodsEchoService service." - example: - duration: "duration" - num: "num" - id: "id" - protobufAny: - type: "object" - properties: - '@type': - type: "string" - additionalProperties: {} - rpcStatus: - type: "object" - properties: - code: - type: "integer" - format: "int32" - message: - type: "string" - details: - type: "array" - items: - $ref: "#/definitions/protobufAny" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body +components: + schemas: + examplepbGenerateUnboundMethodsSimpleMessage: + type: object + properties: + id: + type: string + description: Id represents the message identifier. + num: + type: string + format: int64 + duration: + type: string + description: GenerateUnboundMethodsSimpleMessage represents a simple message + sent to the unannotated GenerateUnboundMethodsEchoService service. + example: + duration: duration + num: num + id: id + protobufAny: + type: object + properties: + '@type': + type: string + additionalProperties: + type: object + x-schema-name: protobufAny + rpcStatus: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + $ref: "#/components/schemas/protobufAny" +x-original-swagger-version: "2.0" diff --git a/examples/internal/clients/generateunboundmethods/api_generate_unbound_methods_echo_service.go b/examples/internal/clients/generateunboundmethods/api_generate_unbound_methods_echo_service.go index dd9c050b931..78d98a0f52b 100644 --- a/examples/internal/clients/generateunboundmethods/api_generate_unbound_methods_echo_service.go +++ b/examples/internal/clients/generateunboundmethods/api_generate_unbound_methods_echo_service.go @@ -1,3 +1,4 @@ + /* * examples/internal/proto/examplepb/generate_unbound_methods.proto * @@ -6,7 +7,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package generateunboundmethods import ( @@ -23,13 +23,11 @@ var ( ) type GenerateUnboundMethodsEchoServiceApiService service - -/* +/* GenerateUnboundMethodsEchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body GenerateUnboundMethodsSimpleMessage represents a simple message sent to the unannotated GenerateUnboundMethodsEchoService service. - @return ExamplepbGenerateUnboundMethodsSimpleMessage */ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEchoServiceEcho(ctx context.Context, body ExamplepbGenerateUnboundMethodsSimpleMessage) (ExamplepbGenerateUnboundMethodsSimpleMessage, *http.Response, error) { @@ -96,7 +94,6 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbGenerateUnboundMethodsSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -107,7 +104,6 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -118,18 +114,15 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* GenerateUnboundMethodsEchoServiceApiService EchoBody method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body GenerateUnboundMethodsSimpleMessage represents a simple message sent to the unannotated GenerateUnboundMethodsEchoService service. - @return ExamplepbGenerateUnboundMethodsSimpleMessage */ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEchoServiceEchoBody(ctx context.Context, body ExamplepbGenerateUnboundMethodsSimpleMessage) (ExamplepbGenerateUnboundMethodsSimpleMessage, *http.Response, error) { @@ -196,7 +189,6 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbGenerateUnboundMethodsSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -207,7 +199,6 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -218,18 +209,15 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* GenerateUnboundMethodsEchoServiceApiService EchoDelete method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body GenerateUnboundMethodsSimpleMessage represents a simple message sent to the unannotated GenerateUnboundMethodsEchoService service. - @return ExamplepbGenerateUnboundMethodsSimpleMessage */ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEchoServiceEchoDelete(ctx context.Context, body ExamplepbGenerateUnboundMethodsSimpleMessage) (ExamplepbGenerateUnboundMethodsSimpleMessage, *http.Response, error) { @@ -296,7 +284,6 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbGenerateUnboundMethodsSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -307,7 +294,6 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -318,7 +304,6 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/examples/internal/clients/generateunboundmethods/client.go b/examples/internal/clients/generateunboundmethods/client.go index 1c8138048ea..58fa91d1a08 100644 --- a/examples/internal/clients/generateunboundmethods/client.go +++ b/examples/internal/clients/generateunboundmethods/client.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package generateunboundmethods import ( @@ -181,7 +180,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -220,6 +219,16 @@ func (c *APIClient) prepareRequest( w.Close() } + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + // Setup path and query parameters url, err := url.Parse(path) if err != nil { @@ -461,4 +470,4 @@ func (e GenericSwaggerError) Body() []byte { // Model returns the unpacked model of the error func (e GenericSwaggerError) Model() interface{} { return e.model -} \ No newline at end of file +} diff --git a/examples/internal/clients/generateunboundmethods/configuration.go b/examples/internal/clients/generateunboundmethods/configuration.go index 1a0022dd7d8..edbdbb9919d 100644 --- a/examples/internal/clients/generateunboundmethods/configuration.go +++ b/examples/internal/clients/generateunboundmethods/configuration.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package generateunboundmethods import ( @@ -60,7 +59,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "https://localhost", + BasePath: "/", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/generateunboundmethods/docs/ExamplepbGenerateUnboundMethodsSimpleMessage.md b/examples/internal/clients/generateunboundmethods/docs/ExamplepbGenerateUnboundMethodsSimpleMessage.md index aba65365948..fdb3935b3b7 100644 --- a/examples/internal/clients/generateunboundmethods/docs/ExamplepbGenerateUnboundMethodsSimpleMessage.md +++ b/examples/internal/clients/generateunboundmethods/docs/ExamplepbGenerateUnboundMethodsSimpleMessage.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/generateunboundmethods/docs/GenerateUnboundMethodsEchoServiceApi.md b/examples/internal/clients/generateunboundmethods/docs/GenerateUnboundMethodsEchoServiceApi.md index 58446c8c6a8..98d0e93967e 100644 --- a/examples/internal/clients/generateunboundmethods/docs/GenerateUnboundMethodsEchoServiceApi.md +++ b/examples/internal/clients/generateunboundmethods/docs/GenerateUnboundMethodsEchoServiceApi.md @@ -1,6 +1,6 @@ -# \GenerateUnboundMethodsEchoServiceApi +# {{classname}} -All URIs are relative to *https://localhost* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -8,7 +8,6 @@ Method | HTTP request | Description [**GenerateUnboundMethodsEchoServiceEchoBody**](GenerateUnboundMethodsEchoServiceApi.md#GenerateUnboundMethodsEchoServiceEchoBody) | **Post** /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/EchoBody | EchoBody method receives a simple message and returns it. [**GenerateUnboundMethodsEchoServiceEchoDelete**](GenerateUnboundMethodsEchoServiceApi.md#GenerateUnboundMethodsEchoServiceEchoDelete) | **Post** /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/EchoDelete | EchoDelete method receives a simple message and returns it. - # **GenerateUnboundMethodsEchoServiceEcho** > ExamplepbGenerateUnboundMethodsSimpleMessage GenerateUnboundMethodsEchoServiceEcho(ctx, body) Echo method receives a simple message and returns it. diff --git a/examples/internal/clients/generateunboundmethods/model_examplepb_generate_unbound_methods_simple_message.go b/examples/internal/clients/generateunboundmethods/model_examplepb_generate_unbound_methods_simple_message.go index 9f884625983..b35840b9220 100644 --- a/examples/internal/clients/generateunboundmethods/model_examplepb_generate_unbound_methods_simple_message.go +++ b/examples/internal/clients/generateunboundmethods/model_examplepb_generate_unbound_methods_simple_message.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package generateunboundmethods // GenerateUnboundMethodsSimpleMessage represents a simple message sent to the unannotated GenerateUnboundMethodsEchoService service. diff --git a/examples/internal/clients/generateunboundmethods/model_rpc_status.go b/examples/internal/clients/generateunboundmethods/model_rpc_status.go index c1054032159..70351bfbf6f 100644 --- a/examples/internal/clients/generateunboundmethods/model_rpc_status.go +++ b/examples/internal/clients/generateunboundmethods/model_rpc_status.go @@ -6,11 +6,10 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package generateunboundmethods type RpcStatus struct { Code int32 `json:"code,omitempty"` Message string `json:"message,omitempty"` - Details []ProtobufAny `json:"details,omitempty"` + Details []map[string]interface{} `json:"details,omitempty"` } diff --git a/examples/internal/clients/generateunboundmethods/response.go b/examples/internal/clients/generateunboundmethods/response.go index a4a4c064884..e0729288127 100644 --- a/examples/internal/clients/generateunboundmethods/response.go +++ b/examples/internal/clients/generateunboundmethods/response.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package generateunboundmethods import ( diff --git a/examples/internal/clients/responsebody/.swagger-codegen/VERSION b/examples/internal/clients/responsebody/.swagger-codegen/VERSION index 752a79ef362..b61c49d271a 100644 --- a/examples/internal/clients/responsebody/.swagger-codegen/VERSION +++ b/examples/internal/clients/responsebody/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8 \ No newline at end of file +3.0.71 \ No newline at end of file diff --git a/examples/internal/clients/responsebody/api/swagger.yaml b/examples/internal/clients/responsebody/api/swagger.yaml index 42d16be2310..7e2d29ce20c 100644 --- a/examples/internal/clients/responsebody/api/swagger.yaml +++ b/examples/internal/clients/responsebody/api/swagger.yaml @@ -1,275 +1,375 @@ ---- -swagger: "2.0" +openapi: 3.0.1 info: - version: "version not set" - title: "examples/internal/proto/examplepb/response_body_service.proto" + title: examples/internal/proto/examplepb/response_body_service.proto + version: version not set +servers: +- url: / tags: -- name: "ResponseBodyService" -consumes: -- "application/json" -produces: -- "application/json" +- name: ResponseBodyService paths: /responsebodies/{data}: get: tags: - - "ResponseBodyService" - operationId: "ResponseBodyService_ListResponseBodies" + - ResponseBodyService + operationId: ResponseBodyService_ListResponseBodies parameters: - - name: "data" - in: "path" + - name: data + in: path required: true - type: "string" - x-exportParamName: "Data" + style: simple + explode: false + schema: + type: string responses: - 200: + "200": description: "" - schema: - type: "array" - items: - $ref: "#/definitions/examplepbRepeatedResponseBodyOutResponse" + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/examplepbRepeatedResponseBodyOutResponse" + x-content-type: application/json default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /responsebody/samename/{data}: get: tags: - - "ResponseBodyService" - operationId: "ResponseBodyService_GetResponseBodySameName" + - ResponseBodyService + operationId: ResponseBodyService_GetResponseBodySameName parameters: - - name: "data" - in: "path" + - name: data + in: path required: true - type: "string" - x-exportParamName: "Data" + style: simple + explode: false + schema: + type: string responses: - 200: + "200": description: "" - schema: - type: "string" + content: + application/json: + schema: + type: string + x-content-type: application/json default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /responsebody/stream/{data}: get: tags: - - "ResponseBodyService" - operationId: "ResponseBodyService_GetResponseBodyStream" + - ResponseBodyService + operationId: ResponseBodyService_GetResponseBodyStream parameters: - - name: "data" - in: "path" + - name: data + in: path required: true - type: "string" - x-exportParamName: "Data" + style: simple + explode: false + schema: + type: string responses: - 200: - description: "(streaming responses)" - schema: - type: "object" - properties: - result: - $ref: "#/definitions/examplepbResponseBodyOutResponse" - error: - $ref: "#/definitions/rpcStatus" - title: "Stream result of examplepbResponseBodyOut" + "200": + description: (streaming responses) + content: + application/json: + schema: + $ref: "#/components/schemas/Stream result of examplepbResponseBodyOut" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /responsebody/{data}: get: tags: - - "ResponseBodyService" - operationId: "ResponseBodyService_GetResponseBody" + - ResponseBodyService + operationId: ResponseBodyService_GetResponseBody parameters: - - name: "data" - in: "path" + - name: data + in: path required: true - type: "string" - x-exportParamName: "Data" + style: simple + explode: false + schema: + type: string responses: - 200: + "200": description: "" - schema: - $ref: "#/definitions/examplepbResponseBodyOutResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbResponseBodyOutResponse" default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" /responsestrings/{data}: get: tags: - - "ResponseBodyService" - operationId: "ResponseBodyService_ListResponseStrings" + - ResponseBodyService + operationId: ResponseBodyService_ListResponseStrings parameters: - - name: "data" - in: "path" + - name: data + in: path required: true - type: "string" - x-exportParamName: "Data" + style: simple + explode: false + schema: + type: string responses: - 200: + "200": description: "" - schema: - type: "array" - items: - type: "string" + content: + application/json: + schema: + type: array + items: + type: string + x-content-type: application/json default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" -definitions: - ResponseResponseType: - type: "string" - title: "- UNKNOWN: UNKNOWN\n - A: A is 1\n - B: B is 2" - enum: - - "UNKNOWN" - - "A" - - "B" - default: "UNKNOWN" - examplepbRepeatedResponseBodyOut: - type: "object" - properties: - response: - type: "array" - items: - $ref: "#/definitions/examplepbRepeatedResponseBodyOutResponse" - examplepbRepeatedResponseBodyOutResponse: - type: "object" - properties: - data: - type: "string" - type: - $ref: "#/definitions/ResponseResponseType" - example: - data: "data" - type: {} - examplepbRepeatedResponseStrings: - type: "object" - properties: - values: - type: "array" - items: - type: "string" - examplepbResponseBodyOut: - type: "object" - properties: - response: - $ref: "#/definitions/examplepbResponseBodyOutResponse" - examplepbResponseBodyOutResponse: - type: "object" - properties: - data: - type: "string" - example: - data: "data" - examplepbResponseBodyValue: - type: "object" - properties: - responseBodyValue: - type: "string" - protobufAny: - type: "object" - properties: - '@type': - type: "string" - description: "A URL/resource name that uniquely identifies the type of the\ - \ serialized\nprotocol buffer message. This string must contain at least\n\ - one \"/\" character. The last segment of the URL's path must represent\n\ - the fully qualified name of the type (as in\n`path/google.protobuf.Duration`).\ - \ The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\ - \nIn practice, teams usually precompile into the binary all types that they\n\ - expect it to use in the context of Any. However, for URLs which use the\n\ - scheme `http`, `https`, or no scheme, one can optionally set up a type\n\ - server that maps type URLs to message definitions as follows:\n\n* If no\ - \ scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must\ - \ yield a [google.protobuf.Type][]\n value in binary format, or produce\ - \ an error.\n* Applications are allowed to cache lookup results based on\ - \ the\n URL, or have them precompiled into a binary to avoid any\n lookup.\ - \ Therefore, binary compatibility needs to be preserved\n on changes to\ - \ types. (Use versioned type names to manage\n breaking changes.)\n\nNote:\ - \ this functionality is not currently available in the official\nprotobuf\ - \ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\ - \ As of May 2023, there are no widely used type server\nimplementations\ - \ and no plans to implement one.\n\nSchemes other than `http`, `https` (or\ - \ the empty scheme) might be\nused with implementation specific semantics." - description: "`Any` contains an arbitrary serialized protocol buffer message along\ - \ with a\nURL that describes the type of the serialized message.\n\nProtobuf\ - \ library provides support to pack/unpack Any values in the form\nof utility\ - \ functions or additional generated methods of the Any type.\n\nExample 1: Pack\ - \ and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n\ - \ ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack\ - \ and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n\ - \ ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n\ - \ }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n\ - \ foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack\ - \ and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n \ - \ any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n\ - \ ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n\ - \ any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n\ - \ ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err !=\ - \ nil {\n ...\n }\n\nThe pack methods provided by protobuf library\ - \ will by default use\n'type.googleapis.com/full.type.name' as the type URL\ - \ and the unpack\nmethods only use the fully qualified type name after the last\ - \ '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\ - name \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses\ - \ the regular\nrepresentation of the deserialized, embedded message, with an\n\ - additional field `@type` which contains the type URL. Example:\n\n package\ - \ google.profile;\n message Person {\n string first_name = 1;\n \ - \ string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\ - ,\n \"firstName\": ,\n \"lastName\": \n }\n\nIf\ - \ the embedded message type is well-known and has a custom JSON\nrepresentation,\ - \ that representation will be embedded adding a field\n`value` which holds the\ - \ custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\ - \n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n\ - \ \"value\": \"1.212s\"\n }" - example: - '@type': "@type" - additionalProperties: {} - rpcStatus: - type: "object" - properties: - code: - type: "integer" - format: "int32" - description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - message: - type: "string" - description: "A developer-facing error message, which should be in English.\ - \ Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details]\ - \ field, or localized by the client." - details: - type: "array" - description: "A list of messages that carry the error details. There is a\ - \ common set of\nmessage types for APIs to use." - items: - $ref: "#/definitions/protobufAny" - description: "The `Status` type defines a logical error model that is suitable\ - \ for\ndifferent programming environments, including REST APIs and RPC APIs.\ - \ It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\n\ - three pieces of data: error code, error message, and error details.\n\nYou can\ - \ find out more about this error model and how to work with it in the\n[API\ - \ Design Guide](https://cloud.google.com/apis/design/errors)." - example: - code: 0 - details: - - '@type': "@type" - - '@type': "@type" - message: "message" - Stream result of examplepbResponseBodyOut: - properties: - result: - $ref: "#/definitions/examplepbResponseBodyOutResponse" - error: - $ref: "#/definitions/rpcStatus" - example: - result: - data: "data" - error: + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" +components: + schemas: + ResponseResponseType: + title: |- + - UNKNOWN: UNKNOWN + - A: A is 1 + - B: B is 2 + type: string + enum: + - UNKNOWN + - A + - B + default: UNKNOWN + examplepbRepeatedResponseBodyOut: + type: object + properties: + response: + type: array + items: + $ref: "#/components/schemas/examplepbRepeatedResponseBodyOutResponse" + examplepbRepeatedResponseBodyOutResponse: + type: object + properties: + data: + type: string + type: + $ref: "#/components/schemas/ResponseResponseType" + example: + data: data + type: UNKNOWN + examplepbRepeatedResponseStrings: + type: object + properties: + values: + type: array + items: + type: string + examplepbResponseBodyOut: + type: object + properties: + response: + $ref: "#/components/schemas/examplepbResponseBodyOutResponse" + examplepbResponseBodyOutResponse: + type: object + properties: + data: + type: string + example: + data: data + examplepbResponseBodyValue: + type: object + properties: + responseBodyValue: + type: string + protobufAny: + type: object + properties: + '@type': + type: string + description: |- + A URL/resource name that uniquely identifies the type of the serialized + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a canonical form + (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that they + expect it to use in the context of Any. However, for URLs which use the + scheme `http`, `https`, or no scheme, one can optionally set up a type + server that maps type URLs to message definitions as follows: + + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. As of May 2023, there are no widely used type server + implementations and no plans to implement one. + + Schemes other than `http`, `https` (or the empty scheme) might be + used with implementation specific semantics. + additionalProperties: + type: object + description: |- + `Any` contains an arbitrary serialized protocol buffer message along with a + URL that describes the type of the serialized message. + + Protobuf library provides support to pack/unpack Any values in the form + of utility functions or additional generated methods of the Any type. + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the unpack + methods only use the fully qualified type name after the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type + name "y.z". + + JSON + ==== + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with an + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + representation, that representation will be embedded adding a field + `value` which holds the custom JSON in addition to the `@type` + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + x-schema-name: protobufAny + rpcStatus: + type: object + properties: + code: + type: integer + description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." + format: int32 + message: + type: string + description: |- + A developer-facing error message, which should be in English. Any + user-facing error message should be localized and sent in the + [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + details: + type: array + description: |- + A list of messages that carry the error details. There is a common set of + message types for APIs to use. + items: + $ref: "#/components/schemas/protobufAny" + description: |- + The `Status` type defines a logical error model that is suitable for + different programming environments, including REST APIs and RPC APIs. It is + used by [gRPC](https://github.com/grpc). Each `Status` message contains + three pieces of data: error code, error message, and error details. + + You can find out more about this error model and how to work with it in the + [API Design Guide](https://cloud.google.com/apis/design/errors). + example: code: 0 details: - - '@type': "@type" - - '@type': "@type" - message: "message" + - key: {} + - key: {} + message: message + Stream result of examplepbResponseBodyOut: + title: Stream result of examplepbResponseBodyOut + type: object + properties: + result: + $ref: "#/components/schemas/examplepbResponseBodyOutResponse" + error: + $ref: "#/components/schemas/rpcStatus" + example: + result: + data: data + error: + code: 0 + details: + - key: {} + - key: {} + message: message +x-original-swagger-version: "2.0" diff --git a/examples/internal/clients/responsebody/api_response_body_service.go b/examples/internal/clients/responsebody/api_response_body_service.go index 6119c3c6567..c6686891adf 100644 --- a/examples/internal/clients/responsebody/api_response_body_service.go +++ b/examples/internal/clients/responsebody/api_response_body_service.go @@ -1,3 +1,4 @@ + /* * examples/internal/proto/examplepb/response_body_service.proto * @@ -6,7 +7,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody import ( @@ -24,12 +24,10 @@ var ( ) type ResponseBodyServiceApiService service - -/* +/* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data - @return ExamplepbResponseBodyOutResponse */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx context.Context, data string) (ExamplepbResponseBodyOutResponse, *http.Response, error) { @@ -50,7 +48,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx c localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -95,7 +93,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx c body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbResponseBodyOutResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -106,7 +103,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -117,18 +113,15 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data - @return string */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameName(ctx context.Context, data string) (string, *http.Response, error) { @@ -149,7 +142,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameNa localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -194,7 +187,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameNa body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -205,7 +197,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameNa newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -216,18 +207,15 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameNa newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data - @return StreamResultOfExamplepbResponseBodyOut */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream(ctx context.Context, data string) (StreamResultOfExamplepbResponseBodyOut, *http.Response, error) { @@ -248,7 +236,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -293,7 +281,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v StreamResultOfExamplepbResponseBodyOut err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -304,7 +291,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -315,18 +301,15 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data - @return []ExamplepbRepeatedResponseBodyOutResponse */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ctx context.Context, data string) ([]ExamplepbRepeatedResponseBodyOutResponse, *http.Response, error) { @@ -347,7 +330,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ct localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -392,7 +375,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ct body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v []ExamplepbRepeatedResponseBodyOutResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -403,7 +385,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -414,18 +395,15 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data - @return []string */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(ctx context.Context, data string) ([]string, *http.Response, error) { @@ -446,7 +424,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(c localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -491,7 +469,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(c body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v []string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -502,7 +479,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -513,7 +489,6 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/examples/internal/clients/responsebody/client.go b/examples/internal/clients/responsebody/client.go index dfe97e57135..7f23dfac588 100644 --- a/examples/internal/clients/responsebody/client.go +++ b/examples/internal/clients/responsebody/client.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody import ( @@ -181,7 +180,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -220,6 +219,16 @@ func (c *APIClient) prepareRequest( w.Close() } + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + // Setup path and query parameters url, err := url.Parse(path) if err != nil { @@ -461,4 +470,4 @@ func (e GenericSwaggerError) Body() []byte { // Model returns the unpacked model of the error func (e GenericSwaggerError) Model() interface{} { return e.model -} \ No newline at end of file +} diff --git a/examples/internal/clients/responsebody/configuration.go b/examples/internal/clients/responsebody/configuration.go index fa7de58d731..9ffc70e913e 100644 --- a/examples/internal/clients/responsebody/configuration.go +++ b/examples/internal/clients/responsebody/configuration.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody import ( @@ -60,7 +59,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "https://localhost", + BasePath: "/", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOut.md b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOut.md index 1a78a92234c..cccbb1077f1 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOut.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOut.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOutResponse.md b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOutResponse.md index f7169959b1b..d1aac34d7e9 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOutResponse.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOutResponse.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseStrings.md b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseStrings.md index 702cfa03868..089861990ca 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseStrings.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseStrings.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOut.md b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOut.md index 5a7146581bf..40547751e01 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOut.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOut.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOutResponse.md b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOutResponse.md index aff3fe461e4..2a75dfc0954 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOutResponse.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOutResponse.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyValue.md b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyValue.md index 1d55912e981..16cff3c975a 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyValue.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyValue.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/responsebody/docs/ResponseBodyServiceApi.md b/examples/internal/clients/responsebody/docs/ResponseBodyServiceApi.md index 940417257da..af03248d517 100644 --- a/examples/internal/clients/responsebody/docs/ResponseBodyServiceApi.md +++ b/examples/internal/clients/responsebody/docs/ResponseBodyServiceApi.md @@ -1,6 +1,6 @@ -# \ResponseBodyServiceApi +# {{classname}} -All URIs are relative to *https://localhost* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -10,7 +10,6 @@ Method | HTTP request | Description [**ResponseBodyServiceListResponseBodies**](ResponseBodyServiceApi.md#ResponseBodyServiceListResponseBodies) | **Get** /responsebodies/{data} | [**ResponseBodyServiceListResponseStrings**](ResponseBodyServiceApi.md#ResponseBodyServiceListResponseStrings) | **Get** /responsestrings/{data} | - # **ResponseBodyServiceGetResponseBody** > ExamplepbResponseBodyOutResponse ResponseBodyServiceGetResponseBody(ctx, data) @@ -32,7 +31,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -58,7 +57,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -84,7 +83,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -110,7 +109,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -136,7 +135,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/examples/internal/clients/responsebody/docs/ResponseResponseType.md b/examples/internal/clients/responsebody/docs/ResponseResponseType.md index 31085130a0c..c71897eb90d 100644 --- a/examples/internal/clients/responsebody/docs/ResponseResponseType.md +++ b/examples/internal/clients/responsebody/docs/ResponseResponseType.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/responsebody/docs/RpcStatus.md b/examples/internal/clients/responsebody/docs/RpcStatus.md index 52a18490d9e..1366feb1020 100644 --- a/examples/internal/clients/responsebody/docs/RpcStatus.md +++ b/examples/internal/clients/responsebody/docs/RpcStatus.md @@ -5,8 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Code** | **int32** | The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. | [optional] [default to null] **Message** | **string** | A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. | [optional] [default to null] -**Details** | [**[]ProtobufAny**](protobufAny.md) | A list of messages that carry the error details. There is a common set of message types for APIs to use. | [optional] [default to null] +**Details** | [**[]map[string]interface{}**](map.md) | A list of messages that carry the error details. There is a common set of message types for APIs to use. | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/responsebody/docs/StreamResultOfExamplepbResponseBodyOut.md b/examples/internal/clients/responsebody/docs/StreamResultOfExamplepbResponseBodyOut.md index 608ad5047c3..6bb5b9f1518 100644 --- a/examples/internal/clients/responsebody/docs/StreamResultOfExamplepbResponseBodyOut.md +++ b/examples/internal/clients/responsebody/docs/StreamResultOfExamplepbResponseBodyOut.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out.go b/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out.go index 574246373eb..88533897eae 100644 --- a/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out.go +++ b/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody type ExamplepbRepeatedResponseBodyOut struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out_response.go b/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out_response.go index 1ea5daf3fae..ca46c13b636 100644 --- a/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out_response.go +++ b/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out_response.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody type ExamplepbRepeatedResponseBodyOutResponse struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_repeated_response_strings.go b/examples/internal/clients/responsebody/model_examplepb_repeated_response_strings.go index 47ec55c7f12..de1dc3eeb40 100644 --- a/examples/internal/clients/responsebody/model_examplepb_repeated_response_strings.go +++ b/examples/internal/clients/responsebody/model_examplepb_repeated_response_strings.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody type ExamplepbRepeatedResponseStrings struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_response_body_out.go b/examples/internal/clients/responsebody/model_examplepb_response_body_out.go index ea912e8976d..7ddb49c6121 100644 --- a/examples/internal/clients/responsebody/model_examplepb_response_body_out.go +++ b/examples/internal/clients/responsebody/model_examplepb_response_body_out.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody type ExamplepbResponseBodyOut struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_response_body_out_response.go b/examples/internal/clients/responsebody/model_examplepb_response_body_out_response.go index b78f80ec655..83f0f84feb9 100644 --- a/examples/internal/clients/responsebody/model_examplepb_response_body_out_response.go +++ b/examples/internal/clients/responsebody/model_examplepb_response_body_out_response.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody type ExamplepbResponseBodyOutResponse struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_response_body_value.go b/examples/internal/clients/responsebody/model_examplepb_response_body_value.go index 037e3bf33c6..54c4c0683b2 100644 --- a/examples/internal/clients/responsebody/model_examplepb_response_body_value.go +++ b/examples/internal/clients/responsebody/model_examplepb_response_body_value.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody type ExamplepbResponseBodyValue struct { diff --git a/examples/internal/clients/responsebody/model_response_response_type.go b/examples/internal/clients/responsebody/model_response_response_type.go index b249571ee56..210a8442438 100644 --- a/examples/internal/clients/responsebody/model_response_response_type.go +++ b/examples/internal/clients/responsebody/model_response_response_type.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody type ResponseResponseType string diff --git a/examples/internal/clients/responsebody/model_rpc_status.go b/examples/internal/clients/responsebody/model_rpc_status.go index 9ad2f03a053..b930c4bf7bc 100644 --- a/examples/internal/clients/responsebody/model_rpc_status.go +++ b/examples/internal/clients/responsebody/model_rpc_status.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody // The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). @@ -16,5 +15,5 @@ type RpcStatus struct { // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. Message string `json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of message types for APIs to use. - Details []ProtobufAny `json:"details,omitempty"` + Details []map[string]interface{} `json:"details,omitempty"` } diff --git a/examples/internal/clients/responsebody/model_stream_result_of_examplepb_response_body_out.go b/examples/internal/clients/responsebody/model_stream_result_of_examplepb_response_body_out.go index 20893eec6bd..910e1e89e20 100644 --- a/examples/internal/clients/responsebody/model_stream_result_of_examplepb_response_body_out.go +++ b/examples/internal/clients/responsebody/model_stream_result_of_examplepb_response_body_out.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody type StreamResultOfExamplepbResponseBodyOut struct { diff --git a/examples/internal/clients/responsebody/response.go b/examples/internal/clients/responsebody/response.go index 09f1698e322..c88ea641e15 100644 --- a/examples/internal/clients/responsebody/response.go +++ b/examples/internal/clients/responsebody/response.go @@ -6,7 +6,6 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package responsebody import ( diff --git a/examples/internal/clients/unannotatedecho/.swagger-codegen/VERSION b/examples/internal/clients/unannotatedecho/.swagger-codegen/VERSION index 752a79ef362..b61c49d271a 100644 --- a/examples/internal/clients/unannotatedecho/.swagger-codegen/VERSION +++ b/examples/internal/clients/unannotatedecho/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8 \ No newline at end of file +3.0.71 \ No newline at end of file diff --git a/examples/internal/clients/unannotatedecho/api/swagger.yaml b/examples/internal/clients/unannotatedecho/api/swagger.yaml index c7a2eb8a76b..8e35dfe4830 100644 --- a/examples/internal/clients/unannotatedecho/api/swagger.yaml +++ b/examples/internal/clients/unannotatedecho/api/swagger.yaml @@ -1,572 +1,754 @@ ---- -swagger: "2.0" +openapi: 3.0.1 info: - description: "Unannotated Echo Service\nSimilar to echo_service.proto but without\ - \ annotations. See\nunannotated_echo_service.yaml for the equivalent of the annotations\ - \ in\ngRPC API configuration format.\n\nEcho Service API consists of a single\ - \ service which returns\na message." - version: "1.0" - title: "Unannotated Echo" + title: Unannotated Echo + description: |- + Unannotated Echo Service + Similar to echo_service.proto but without annotations. See + unannotated_echo_service.yaml for the equivalent of the annotations in + gRPC API configuration format. + + Echo Service API consists of a single service which returns + a message. contact: - name: "gRPC-Gateway project" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - email: "none@example.com" + 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/main/LICENSE" - x-something-something: "yadda" -tags: -- name: "Echo" - description: "Echo description" -- name: "Internal" - description: "Internal description" - x-traitTag: true -- name: "UnannotatedEchoService" - description: "UnannotatedEchoService description -- which should not be used in\ - \ place of the documentation comment!" - externalDocs: - description: "Find out more about UnannotatedEchoService" - url: "https://github.com/grpc-ecosystem/grpc-gateway" -schemes: -- "http" -- "https" -- "wss" -consumes: -- "application/json" -- "application/x-foo-mime" -produces: -- "application/json" -- "application/x-foo-mime" + name: BSD 3-Clause License + url: https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE + version: "1.0" + x-something-something: yadda +externalDocs: + description: More about gRPC-Gateway + url: https://github.com/grpc-ecosystem/grpc-gateway +servers: +- url: / security: - ApiKeyAuth: [] BasicAuth: [] - ApiKeyAuth: [] OAuth2: - - "read" - - "write" + - read + - write +tags: +- name: Echo + description: Echo description +- name: Internal + description: Internal description + x-traitTag: true +- name: UnannotatedEchoService + description: UnannotatedEchoService description -- which should not be used in place + of the documentation comment! + externalDocs: + description: Find out more about UnannotatedEchoService + url: https://github.com/grpc-ecosystem/grpc-gateway paths: /v1/example/echo/{id}: post: tags: - - "UnannotatedEchoService" + - UnannotatedEchoService summary: "Summary: Echo rpc" - description: "Description Echo" - operationId: "UnannotatedEchoService_Echo" + description: Description Echo + externalDocs: + description: Find out more Echo + url: https://github.com/grpc-ecosystem/grpc-gateway + operationId: UnannotatedEchoService_Echo parameters: - - name: "id" - in: "path" - description: "Id represents the message identifier." + - name: id + in: path + description: Id represents the message identifier. required: true - type: "string" - x-exportParamName: "Id" - - name: "num" - in: "query" - description: "Int value field" + style: simple + explode: false + schema: + type: string + - name: num + in: query + description: Int value field required: true - type: "string" - default: "42" - format: "int64" - x-exportParamName: "Num" - - name: "duration" - in: "query" - required: false - type: "string" - x-exportParamName: "Duration" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: form + explode: true + schema: + type: string + format: int64 + default: "42" + - name: duration + in: query + required: false + style: form + explode: true + schema: + type: string + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - examples: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + example: + value: the input value + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: application/json: - value: "the input value" - schema: - $ref: "#/definitions/examplepbUnannotatedSimpleMessage" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "integer" - format: "integer" - 503: - description: "Returned when the resource is temporarily unavailable." - schema: {} + schema: + type: integer + format: integer + x-content-type: application/json + application/x-foo-mime: + schema: + type: integer + format: integer + "503": + description: Returned when the resource is temporarily unavailable. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object x-number: 100 default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - externalDocs: - description: "Find out more Echo" - url: "https://github.com/grpc-ecosystem/grpc-gateway" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo/{id}/{num}: get: tags: - - "UnannotatedEchoService" + - UnannotatedEchoService summary: "Summary: Echo rpc" - description: "Description Echo" - operationId: "UnannotatedEchoService_Echo2" + description: Description Echo + externalDocs: + description: Find out more Echo + url: https://github.com/grpc-ecosystem/grpc-gateway + operationId: UnannotatedEchoService_Echo2 parameters: - - name: "id" - in: "path" - description: "Id represents the message identifier." + - name: id + in: path + description: Id represents the message identifier. required: true - type: "string" - x-exportParamName: "Id" - - name: "num" - in: "path" - description: "Int value field" + style: simple + explode: false + schema: + type: string + - name: num + in: path + description: Int value field required: true - type: "string" - default: "42" - format: "int64" - x-exportParamName: "Num" - - name: "duration" - in: "query" - required: false - type: "string" - x-exportParamName: "Duration" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: simple + explode: false + schema: + type: string + format: int64 + default: "42" + - name: duration + in: query + required: false + style: form + explode: true + schema: + type: string + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - examples: + "200": + description: A successful response. + content: application/json: - value: "the input value" - schema: - $ref: "#/definitions/examplepbUnannotatedSimpleMessage" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "integer" - format: "integer" - 503: - description: "Returned when the resource is temporarily unavailable." - schema: {} + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + example: + value: the input value + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: integer + format: integer + x-content-type: application/json + application/x-foo-mime: + schema: + type: integer + format: integer + "503": + description: Returned when the resource is temporarily unavailable. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object x-number: 100 default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - externalDocs: - description: "Find out more Echo" - url: "https://github.com/grpc-ecosystem/grpc-gateway" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo_body: post: tags: - - "UnannotatedEchoService" - summary: "EchoBody method receives a simple message and returns it." - operationId: "UnannotatedEchoService_EchoBody" - parameters: - - in: "body" - name: "body" - description: "A simple message with many types" + - UnannotatedEchoService + summary: EchoBody method receives a simple message and returns it. + operationId: UnannotatedEchoService_EchoBody + requestBody: + description: A simple message with many types + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" required: true - schema: - $ref: "#/definitions/examplepbUnannotatedSimpleMessage" - x-exportParamName: "Body" responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbUnannotatedSimpleMessage" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body /v1/example/echo_delete: delete: tags: - - "UnannotatedEchoService" - summary: "EchoDelete method receives a simple message and returns it." - operationId: "UnannotatedEchoService_EchoDelete" + - UnannotatedEchoService + summary: EchoDelete method receives a simple message and returns it. + operationId: UnannotatedEchoService_EchoDelete parameters: - - name: "id" - in: "query" - description: "Id represents the message identifier." - required: false - type: "string" - x-exportParamName: "Id" - x-optionalDataType: "String" - - name: "num" - in: "query" - description: "Int value field" + - name: id + in: query + description: Id represents the message identifier. + required: false + style: form + explode: true + schema: + type: string + - name: num + in: query + description: Int value field required: true - type: "string" - default: "42" - format: "int64" - x-exportParamName: "Num" - - name: "duration" - in: "query" - required: false - type: "string" - x-exportParamName: "Duration" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - - name: "nId.nId" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdNId" - x-optionalDataType: "String" - - name: "nId.val" - in: "query" - required: false - type: "string" - x-exportParamName: "NIdVal" - x-optionalDataType: "String" + style: form + explode: true + schema: + type: string + format: int64 + default: "42" + - name: duration + in: query + required: false + style: form + explode: true + schema: + type: string + - name: lineNum + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: lang + in: query + required: false + style: form + explode: true + schema: + type: string + - name: status.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: status.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: en + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.progress + in: query + required: false + style: form + explode: true + schema: + type: string + format: int64 + - name: no.note + in: query + required: false + style: form + explode: true + schema: + type: string + - name: resourceId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.nId + in: query + required: false + style: form + explode: true + schema: + type: string + - name: nId.val + in: query + required: false + style: form + explode: true + schema: + type: string responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbUnannotatedSimpleMessage" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" + "200": + description: A successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" /v1/example/echo_nested: put: tags: - - "UnannotatedEchoService" - summary: "EchoNested method receives a simple message and returns it." - operationId: "UnannotatedEchoService_EchoNested" - parameters: - - in: "body" - name: "body" - description: "A simple message with many types" + - UnannotatedEchoService + summary: EchoNested method receives a simple message and returns it. + operationId: UnannotatedEchoService_EchoNested + requestBody: + description: A simple message with many types + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" required: true - schema: - $ref: "#/definitions/examplepbUnannotatedSimpleMessage" - x-exportParamName: "Body" responses: - 200: + "200": description: "" - schema: - $ref: "#/definitions/examplepbUnannotatedNestedMessage" - 403: - description: "Returned when the user does not have permission to access\ - \ the resource." - schema: {} - 404: - description: "Returned when the resource does not exist." - schema: - type: "string" - format: "string" + content: + application/json: + schema: + $ref: "#/components/schemas/examplepbUnannotatedNestedMessage" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/examplepbUnannotatedNestedMessage" + "403": + description: Returned when the user does not have permission to access the + resource. + content: + application/json: + schema: + type: object + x-content-type: application/json + application/x-foo-mime: + schema: + type: object + "404": + description: Returned when the resource does not exist. + content: + application/json: + schema: + type: string + format: string + x-content-type: application/json + application/x-foo-mime: + schema: + type: string + format: string default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" -securityDefinitions: - ApiKeyAuth: - type: "apiKey" - name: "X-API-Key" - in: "header" - x-amazon-apigateway-authorizer: - authorizerResultTtlInSeconds: 60 - type: "token" - x-amazon-apigateway-authtype: "oauth2" - BasicAuth: - type: "basic" -definitions: - examplepbUnannotatedEmbedded: - type: "object" - properties: - progress: - type: "string" - format: "int64" - note: - type: "string" - description: "Embedded represents a message embedded in SimpleMessage." - x-go-type: - import: - package: "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb" - type: "UnannotatedEmbedded" - examplepbUnannotatedNestedMessage: - type: "object" - properties: - nId: - type: "string" - val: - type: "string" - example: - val: "val" - nId: "nId" - x-go-type: - import: - package: "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb" - type: "UnannotatedNestedMessage" - examplepbUnannotatedSimpleMessage: - type: "object" - required: - - "id" - - "num" - properties: - id: - type: "string" - description: "Id represents the message identifier." - num: - type: "string" - format: "int64" - description: "Int value field" - default: "42" - duration: - type: "string" - lineNum: - type: "string" - format: "int64" - lang: - type: "string" - status: - $ref: "#/definitions/examplepbUnannotatedEmbedded" - en: - type: "string" - format: "int64" - "no": - $ref: "#/definitions/examplepbUnannotatedEmbedded" - resourceId: - type: "string" - nId: - $ref: "#/definitions/examplepbUnannotatedNestedMessage" - externalDocs: - description: "Find out more about UnannotatedSimpleMessage" - url: "https://github.com/grpc-ecosystem/grpc-gateway" - title: "A bit of everything" - description: "A simple message with many types" - example: - id: "myid" - protobufAny: - type: "object" - properties: - '@type': - type: "string" - additionalProperties: {} - x-go-type: - import: - package: "google.golang.org/protobuf/types/known/anypb" - type: "Any" - rpcStatus: - type: "object" - properties: - code: - type: "integer" - format: "int32" - message: - type: "string" - details: - type: "array" - items: - $ref: "#/definitions/protobufAny" - x-go-type: - import: - package: "google.golang.org/genproto/googleapis/rpc/status" - type: "Status" -externalDocs: - description: "More about gRPC-Gateway" - url: "https://github.com/grpc-ecosystem/grpc-gateway" + description: An unexpected error response. + content: + application/json: + schema: + $ref: "#/components/schemas/rpcStatus" + application/x-foo-mime: + schema: + $ref: "#/components/schemas/rpcStatus" + x-codegen-request-body-name: body +components: + schemas: + examplepbUnannotatedEmbedded: + type: object + properties: + progress: + type: string + format: int64 + note: + type: string + description: Embedded represents a message embedded in SimpleMessage. + x-go-type: + import: + package: github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb + type: UnannotatedEmbedded + examplepbUnannotatedNestedMessage: + type: object + properties: + nId: + type: string + val: + type: string + example: + val: val + nId: nId + x-go-type: + import: + package: github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb + type: UnannotatedNestedMessage + examplepbUnannotatedSimpleMessage: + title: A bit of everything + required: + - id + - num + type: object + properties: + id: + type: string + description: Id represents the message identifier. + num: + type: string + description: Int value field + format: int64 + default: "42" + duration: + type: string + lineNum: + type: string + format: int64 + lang: + type: string + status: + $ref: "#/components/schemas/examplepbUnannotatedEmbedded" + en: + type: string + format: int64 + "no": + $ref: "#/components/schemas/examplepbUnannotatedEmbedded" + resourceId: + type: string + nId: + $ref: "#/components/schemas/examplepbUnannotatedNestedMessage" + description: A simple message with many types + example: + id: myid + externalDocs: + description: Find out more about UnannotatedSimpleMessage + url: https://github.com/grpc-ecosystem/grpc-gateway + protobufAny: + type: object + properties: + '@type': + type: string + additionalProperties: + type: object + x-go-type: + import: + package: google.golang.org/protobuf/types/known/anypb + type: Any + x-schema-name: protobufAny + rpcStatus: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + $ref: "#/components/schemas/protobufAny" + x-go-type: + import: + package: google.golang.org/genproto/googleapis/rpc/status + type: Status + securitySchemes: + ApiKeyAuth: + type: apiKey + name: X-API-Key + in: header + x-amazon-apigateway-authorizer: + authorizerResultTtlInSeconds: 60 + type: token + x-amazon-apigateway-authtype: oauth2 + BasicAuth: + type: http + scheme: basic x-grpc-gateway-baz-list: -- "one" +- one - true -x-grpc-gateway-foo: "bar" +x-grpc-gateway-foo: bar +x-original-swagger-version: "2.0" diff --git a/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go b/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go index 17fb7804367..4609309ad55 100644 --- a/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go +++ b/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go @@ -1,3 +1,4 @@ + /* * Unannotated Echo * @@ -7,7 +8,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package unannotatedecho import ( @@ -26,14 +26,13 @@ var ( ) type UnannotatedEchoServiceApiService service - -/* +/* UnannotatedEchoServiceApiService Summary: Echo rpc Description Echo * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id Id represents the message identifier. * @param num Int value field - * @param optional nil or *UnannotatedEchoServiceEchoOpts - Optional Parameters: + * @param optional nil or *UnannotatedEchoServiceApiUnannotatedEchoServiceEchoOpts - Optional Parameters: * @param "Duration" (optional.String) - * @param "LineNum" (optional.String) - * @param "Lang" (optional.String) - @@ -45,25 +44,24 @@ Description Echo * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbUnannotatedSimpleMessage */ -type UnannotatedEchoServiceEchoOpts struct { - Duration optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type UnannotatedEchoServiceApiUnannotatedEchoServiceEchoOpts struct { + Duration optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx context.Context, id string, num string, localVarOptionals *UnannotatedEchoServiceEchoOpts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { +func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx context.Context, id string, num string, localVarOptionals *UnannotatedEchoServiceApiUnannotatedEchoServiceEchoOpts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -115,7 +113,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -173,7 +171,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -184,7 +181,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -195,7 +191,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -206,7 +201,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -217,7 +211,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -228,20 +221,18 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* UnannotatedEchoServiceApiService Summary: Echo rpc Description Echo * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id Id represents the message identifier. * @param num Int value field - * @param optional nil or *UnannotatedEchoServiceEcho2Opts - Optional Parameters: + * @param optional nil or *UnannotatedEchoServiceApiUnannotatedEchoServiceEcho2Opts - Optional Parameters: * @param "Duration" (optional.String) - * @param "LineNum" (optional.String) - * @param "Lang" (optional.String) - @@ -253,25 +244,24 @@ Description Echo * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbUnannotatedSimpleMessage */ -type UnannotatedEchoServiceEcho2Opts struct { - Duration optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type UnannotatedEchoServiceApiUnannotatedEchoServiceEcho2Opts struct { + Duration optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx context.Context, id string, num string, localVarOptionals *UnannotatedEchoServiceEcho2Opts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { +func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx context.Context, id string, num string, localVarOptionals *UnannotatedEchoServiceApiUnannotatedEchoServiceEcho2Opts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -323,7 +313,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -381,7 +371,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -392,7 +381,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -403,7 +391,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -414,7 +401,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -425,7 +411,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -436,18 +421,15 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* UnannotatedEchoServiceApiService EchoBody method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body A simple message with many types - @return ExamplepbUnannotatedSimpleMessage */ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx context.Context, body ExamplepbUnannotatedSimpleMessage) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { @@ -527,7 +509,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -538,7 +519,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -549,7 +529,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -560,7 +539,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -571,18 +549,16 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* UnannotatedEchoServiceApiService EchoDelete method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param num Int value field - * @param optional nil or *UnannotatedEchoServiceEchoDeleteOpts - Optional Parameters: + * @param optional nil or *UnannotatedEchoServiceApiUnannotatedEchoServiceEchoDeleteOpts - Optional Parameters: * @param "Id" (optional.String) - Id represents the message identifier. * @param "Duration" (optional.String) - * @param "LineNum" (optional.String) - @@ -595,26 +571,25 @@ UnannotatedEchoServiceApiService EchoDelete method receives a simple message and * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - - @return ExamplepbUnannotatedSimpleMessage */ -type UnannotatedEchoServiceEchoDeleteOpts struct { - Id optional.String - Duration optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type UnannotatedEchoServiceApiUnannotatedEchoServiceEchoDeleteOpts struct { + Id optional.String + Duration optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx context.Context, num string, localVarOptionals *UnannotatedEchoServiceEchoDeleteOpts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { +func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx context.Context, num string, localVarOptionals *UnannotatedEchoServiceApiUnannotatedEchoServiceEchoDeleteOpts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") localVarPostBody interface{} @@ -668,7 +643,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -726,7 +701,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -737,7 +711,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -748,7 +721,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -759,7 +731,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -770,18 +741,15 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } - -/* +/* UnannotatedEchoServiceApiService EchoNested method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body A simple message with many types - @return ExamplepbUnannotatedNestedMessage */ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx context.Context, body ExamplepbUnannotatedSimpleMessage) (ExamplepbUnannotatedNestedMessage, *http.Response, error) { @@ -861,7 +829,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx body: localVarBody, error: localVarHttpResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedNestedMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -872,7 +839,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -883,7 +849,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -894,7 +859,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -905,7 +869,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr } diff --git a/examples/internal/clients/unannotatedecho/client.go b/examples/internal/clients/unannotatedecho/client.go index 80ae2022984..73793d9aca6 100644 --- a/examples/internal/clients/unannotatedecho/client.go +++ b/examples/internal/clients/unannotatedecho/client.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package unannotatedecho import ( @@ -182,7 +181,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -221,6 +220,16 @@ func (c *APIClient) prepareRequest( w.Close() } + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + // Setup path and query parameters url, err := url.Parse(path) if err != nil { @@ -462,4 +471,4 @@ func (e GenericSwaggerError) Body() []byte { // Model returns the unpacked model of the error func (e GenericSwaggerError) Model() interface{} { return e.model -} \ No newline at end of file +} diff --git a/examples/internal/clients/unannotatedecho/configuration.go b/examples/internal/clients/unannotatedecho/configuration.go index a471d97120f..428325378e3 100644 --- a/examples/internal/clients/unannotatedecho/configuration.go +++ b/examples/internal/clients/unannotatedecho/configuration.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package unannotatedecho import ( @@ -61,7 +60,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "http://localhost", + BasePath: "/", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_embedded.go b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_embedded.go index e91de2d8a02..c016143a772 100644 --- a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_embedded.go +++ b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_embedded.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package unannotatedecho // Embedded represents a message embedded in SimpleMessage. diff --git a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_nested_message.go b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_nested_message.go index 8f212000c8b..f5907a81b79 100644 --- a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_nested_message.go +++ b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_nested_message.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package unannotatedecho type ExamplepbUnannotatedNestedMessage struct { diff --git a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go index 99099038bf6..26ec808716c 100644 --- a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go +++ b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package unannotatedecho // A simple message with many types diff --git a/examples/internal/clients/unannotatedecho/model_rpc_status.go b/examples/internal/clients/unannotatedecho/model_rpc_status.go index d97aeea06d4..350acb375ac 100644 --- a/examples/internal/clients/unannotatedecho/model_rpc_status.go +++ b/examples/internal/clients/unannotatedecho/model_rpc_status.go @@ -7,11 +7,10 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package unannotatedecho type RpcStatus struct { Code int32 `json:"code,omitempty"` Message string `json:"message,omitempty"` - Details []ProtobufAny `json:"details,omitempty"` + Details []map[string]interface{} `json:"details,omitempty"` } diff --git a/examples/internal/clients/unannotatedecho/response.go b/examples/internal/clients/unannotatedecho/response.go index 16ded8dab1d..16e85b90cc3 100644 --- a/examples/internal/clients/unannotatedecho/response.go +++ b/examples/internal/clients/unannotatedecho/response.go @@ -7,7 +7,6 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ - package unannotatedecho import ( diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json b/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json index d6a1cc5ead8..675b8a795c7 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json +++ b/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json @@ -5070,8 +5070,7 @@ "readOnly": true } }, - "description": "The book's `name` field is used to identify the book to be updated.\nFormat: publishers/{publisher}/books/{book}", - "title": "The book to update.", + "description": "An example resource type from AIP-123 used to test the behavior described in\nthe CreateBookRequest message.\n\nSee: https://google.aip.dev/123", "required": [ "book" ] From dc0d5e17df9fecb0c2c8bb116475746d58a967d1 Mon Sep 17 00:00:00 2001 From: iamrajiv Date: Wed, 23 Jul 2025 18:45:42 +0530 Subject: [PATCH 2/8] add desc --- protoc-gen-openapiv2/internal/genopenapi/template.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/protoc-gen-openapiv2/internal/genopenapi/template.go b/protoc-gen-openapiv2/internal/genopenapi/template.go index 84831c28d59..58dfb76a67b 100644 --- a/protoc-gen-openapiv2/internal/genopenapi/template.go +++ b/protoc-gen-openapiv2/internal/genopenapi/template.go @@ -667,11 +667,8 @@ func renderFieldAsDefinition(f *descriptor.Field, reg *descriptor.Registry, refs return openapiSchemaObject{}, err } comments := fieldProtoComments(reg, f.Message, f) - if len(comments) > 0 { - // Use title and description from field instead of nested message if present. - paragraphs := strings.Split(comments, paragraphDeliminator) - schema.Title = strings.TrimSpace(paragraphs[0]) - schema.Description = strings.TrimSpace(strings.Join(paragraphs[1:], paragraphDeliminator)) + if err := updateOpenAPIDataFromComments(reg, &schema, f, comments, false); err != nil { + return openapiSchemaObject{}, err } // to handle case where path param is present inside the field of descriptorpb.FieldDescriptorProto_TYPE_MESSAGE type From a23c190c5ab0c76c533d3ebc9cfcb5ea8f4df5bf Mon Sep 17 00:00:00 2001 From: iamrajiv Date: Wed, 23 Jul 2025 18:52:19 +0530 Subject: [PATCH 3/8] fix lint --- examples/internal/integration/client_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/internal/integration/client_test.go b/examples/internal/integration/client_test.go index e35be923ae0..cb88b202af1 100644 --- a/examples/internal/integration/client_test.go +++ b/examples/internal/integration/client_test.go @@ -63,7 +63,7 @@ func TestEchoBody2Client(t *testing.T) { cl := echo.NewAPIClient(cfg) req := echo.ExamplepbEmbedded{Note: "note"} - resp, _, err := cl.EchoServiceApi.EchoServiceEchoBody2(context.Background(), "foo", req, nil) + resp, _, err := cl.EchoServiceApi.EchoServiceEchoBody2(context.Background(), req, "foo", nil) if err != nil { t.Errorf("cl.EchoBody(%#v) failed with %v; want success", req, err) } From 69911fdf67233743b9cb78cb24dee0113c477563 Mon Sep 17 00:00:00 2001 From: iamrajiv Date: Wed, 23 Jul 2025 19:11:04 +0530 Subject: [PATCH 4/8] Add new generated model files to BUILD.bazel - Add model_v1_book_name_body.go and model_v1_book_name_body_1.go - These files were generated as part of the comment processing changes - Required to pass Bazel gazelle consistency check --- examples/internal/clients/abe/BUILD.bazel | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/internal/clients/abe/BUILD.bazel b/examples/internal/clients/abe/BUILD.bazel index 806b3cef3dc..993f5f0e066 100644 --- a/examples/internal/clients/abe/BUILD.bazel +++ b/examples/internal/clients/abe/BUILD.bazel @@ -57,6 +57,8 @@ go_library( "model_the_book_to_update_the_books_name_field_is_used_to_identify_the_book_to_be_updated_format_publisherspublisherbooksbook.go", "model_update_v2_request_request_for_update_includes_the_message_and_the_update_mask.go", "model_update_v2_request_request_for_update_includes_the_message_and_the_update_mask_1.go", + "model_v1_book_name_body.go", + "model_v1_book_name_body_1.go", "model_v1exampledeep_pathsingle_nested_name_single_nested.go", "response.go", ], From de3cb79bb3e7838d534711924c9154e54b1f8a3f Mon Sep 17 00:00:00 2001 From: iamrajiv Date: Wed, 23 Jul 2025 22:28:35 +0530 Subject: [PATCH 5/8] fix swagger --- .../clients/abe/.swagger-codegen/VERSION | 2 +- .../internal/clients/abe/api/swagger.yaml | 15263 +++++++--------- .../clients/abe/api_a_bit_of_everything.go | 1301 +- .../abe/api_camel_case_service_name.go | 17 +- examples/internal/clients/abe/api_echo_rpc.go | 58 +- .../clients/abe/api_snake_enum_service.go | 17 +- examples/internal/clients/abe/client.go | 5 +- .../internal/clients/abe/configuration.go | 3 +- .../clients/abe/model_a_bit_of_everything.go | 6 +- .../abe/model_a_bit_of_everything_1.go | 6 +- .../abe/model_a_bit_of_everything_2.go | 22 +- .../abe/model_a_bit_of_everything_nested.go | 2 + ..._everything_service_deep_path_echo_body.go | 6 +- ...rvice_deep_path_echo_body_single_nested.go | 2 + ...thing_service_post_with_empty_body_body.go | 1 + ...it_of_everything_service_update_v2_body.go | 3 +- .../model_examplepb_a_bit_of_everything.go | 6 +- ..._examplepb_a_bit_of_everything_repeated.go | 1 + ...a_bit_of_everything_service_update_body.go | 6 +- .../clients/abe/model_examplepb_bar.go | 1 + .../clients/abe/model_examplepb_body.go | 1 + .../clients/abe/model_examplepb_book.go | 2 + .../model_examplepb_check_status_response.go | 1 + .../abe/model_examplepb_error_object.go | 1 + .../abe/model_examplepb_error_response.go | 1 + .../abe/model_examplepb_numeric_enum.go | 1 + ...examplepb_required_message_type_request.go | 1 + .../model_examplepb_snake_enum_response.go | 1 + .../abe/model_examplepbsnake_case_0_enum.go | 1 + .../abe/model_examplepbsnake_case_enum.go | 1 + ...odel_message_path_enum_nested_path_enum.go | 1 + .../clients/abe/model_nested_deep_enum.go | 1 + .../abe/model_oneofenum_example_enum.go | 1 + .../clients/abe/model_pathenum_path_enum.go | 1 + .../model_pathenumsnake_case_for_import.go | 1 + .../clients/abe/model_protoexamplepb_foo.go | 1 + .../internal/clients/abe/model_rpc_status.go | 3 +- .../clients/abe/model_sub_string_message.go | 1 + examples/internal/clients/abe/response.go | 1 + .../clients/echo/.swagger-codegen/VERSION | 2 +- .../internal/clients/echo/api/swagger.yaml | 2357 ++- .../internal/clients/echo/api_echo_service.go | 358 +- examples/internal/clients/echo/client.go | 5 +- .../internal/clients/echo/configuration.go | 3 +- .../echo/model_examplepb_dynamic_message.go | 5 +- .../model_examplepb_dynamic_message_update.go | 1 + .../clients/echo/model_examplepb_embedded.go | 1 + .../echo/model_examplepb_nested_message.go | 1 + .../echo/model_examplepb_simple_message.go | 1 + .../clients/echo/model_protobuf_null_value.go | 1 + .../internal/clients/echo/model_rpc_status.go | 3 +- examples/internal/clients/echo/response.go | 1 + .../.swagger-codegen/VERSION | 2 +- .../generateunboundmethods/api/swagger.yaml | 218 +- ...i_generate_unbound_methods_echo_service.go | 29 +- .../clients/generateunboundmethods/client.go | 5 +- .../generateunboundmethods/configuration.go | 3 +- ...lepbGenerateUnboundMethodsSimpleMessage.md | 1 + .../GenerateUnboundMethodsEchoServiceApi.md | 5 +- ...generate_unbound_methods_simple_message.go | 1 + .../model_rpc_status.go | 3 +- .../generateunboundmethods/response.go | 1 + .../responsebody/.swagger-codegen/VERSION | 2 +- .../clients/responsebody/api/swagger.yaml | 547 +- .../responsebody/api_response_body_service.go | 57 +- .../internal/clients/responsebody/client.go | 5 +- .../clients/responsebody/configuration.go | 3 +- .../docs/ExamplepbRepeatedResponseBodyOut.md | 1 + ...xamplepbRepeatedResponseBodyOutResponse.md | 1 + .../docs/ExamplepbRepeatedResponseStrings.md | 1 + .../docs/ExamplepbResponseBodyOut.md | 1 + .../docs/ExamplepbResponseBodyOutResponse.md | 1 + .../docs/ExamplepbResponseBodyValue.md | 1 + .../docs/ResponseBodyServiceApi.md | 15 +- .../responsebody/docs/ResponseResponseType.md | 1 + .../clients/responsebody/docs/RpcStatus.md | 3 +- .../StreamResultOfExamplepbResponseBodyOut.md | 1 + ...el_examplepb_repeated_response_body_out.go | 1 + ...epb_repeated_response_body_out_response.go | 1 + ...del_examplepb_repeated_response_strings.go | 1 + .../model_examplepb_response_body_out.go | 1 + ...el_examplepb_response_body_out_response.go | 1 + .../model_examplepb_response_body_value.go | 1 + .../model_response_response_type.go | 1 + .../clients/responsebody/model_rpc_status.go | 3 +- ...m_result_of_examplepb_response_body_out.go | 1 + .../internal/clients/responsebody/response.go | 1 + .../unannotatedecho/.swagger-codegen/VERSION | 2 +- .../clients/unannotatedecho/api/swagger.yaml | 1186 +- .../api_unannotated_echo_service.go | 139 +- .../clients/unannotatedecho/client.go | 5 +- .../clients/unannotatedecho/configuration.go | 3 +- .../model_examplepb_unannotated_embedded.go | 1 + ...el_examplepb_unannotated_nested_message.go | 1 + ...el_examplepb_unannotated_simple_message.go | 1 + .../unannotatedecho/model_rpc_status.go | 3 +- .../clients/unannotatedecho/response.go | 1 + 97 files changed, 9462 insertions(+), 12289 deletions(-) diff --git a/examples/internal/clients/abe/.swagger-codegen/VERSION b/examples/internal/clients/abe/.swagger-codegen/VERSION index b61c49d271a..a932b445646 100644 --- a/examples/internal/clients/abe/.swagger-codegen/VERSION +++ b/examples/internal/clients/abe/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.71 \ No newline at end of file +2.4.47-SNAPSHOT \ No newline at end of file diff --git a/examples/internal/clients/abe/api/swagger.yaml b/examples/internal/clients/abe/api/swagger.yaml index 091ccbe223f..636ded31105 100644 --- a/examples/internal/clients/abe/api/swagger.yaml +++ b/examples/internal/clients/abe/api/swagger.yaml @@ -1,9390 +1,6687 @@ -openapi: 3.0.1 +--- +swagger: "2.0" info: - title: A Bit of Everything + version: "1.0" + title: "A Bit of Everything" contact: - name: gRPC-Gateway project - url: https://github.com/grpc-ecosystem/grpc-gateway - email: none@example.com + 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/main/LICENSE - version: "1.0" - x-something-something: yadda -externalDocs: - description: More about gRPC-Gateway - url: https://github.com/grpc-ecosystem/grpc-gateway -servers: -- url: / + name: "BSD 3-Clause License" + url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE" + x-something-something: "yadda" +tags: +- name: "echo rpc" + description: "Echo Rpc description" + x-traitTag: true +- name: "ABitOfEverything" + description: "ABitOfEverythingService description -- which should not be used in\ + \ place of the documentation comment!" + externalDocs: + description: "Find out more about EchoService" + url: "https://github.com/grpc-ecosystem/grpc-gateway" +- name: "camelCaseServiceName" +- name: "AnotherServiceWithNoBindings" +- name: "SnakeEnumService" +schemes: +- "http" +- "https" +- "wss" +consumes: +- "application/json" +- "application/x-foo-mime" +produces: +- "application/json" +- "application/x-foo-mime" security: - ApiKeyAuth: [] BasicAuth: [] - ApiKeyAuth: [] OAuth2: - - read - - write -tags: -- name: echo rpc - description: Echo Rpc description - x-traitTag: true -- name: ABitOfEverything - description: ABitOfEverythingService description -- which should not be used in - place of the documentation comment! - externalDocs: - description: Find out more about EchoService - url: https://github.com/grpc-ecosystem/grpc-gateway -- name: camelCaseServiceName -- name: AnotherServiceWithNoBindings -- name: SnakeEnumService + - "read" + - "write" paths: /v1/example/a_bit_of_everything: post: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_CreateBody - requestBody: - description: Intentionally complicated message type to cover many features - of Protobuf. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" + - "ABitOfEverything" + operationId: "ABitOfEverythingService_CreateBody" + parameters: + - in: "body" + name: "body" + description: "Intentionally complicated message type to cover many features\ + \ of Protobuf." required: true + schema: + $ref: "#/definitions/examplepbABitOfEverything" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverything" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/a_bit_of_everything/echo/{value}: get: tags: - - echo rpc + - "echo rpc" summary: "Summary: Echo rpc" - description: Description Echo - externalDocs: - description: Find out more Echo - url: https://github.com/grpc-ecosystem/grpc-gateway - operationId: ABitOfEverythingService_Echo + description: "Description Echo" + operationId: "ABitOfEverythingService_Echo" parameters: - - name: value - in: path + - name: "value" + in: "path" required: true - style: simple - explode: false - schema: - type: string + type: "string" + x-exportParamName: "Value" + externalDocs: + description: "Find out more Echo" + url: "https://github.com/grpc-ecosystem/grpc-gateway" responses: "200": - description: A successful response. - content: + description: "A successful response." + examples: application/json: - schema: - $ref: "#/components/schemas/subStringMessage" - example: - value: the input value - application/x-foo-mime: - schema: - $ref: "#/components/schemas/subStringMessage" + value: "the input value" + schema: + $ref: "#/definitions/subStringMessage" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: integer - format: integer - x-content-type: application/json - application/x-foo-mime: - schema: - type: integer - format: integer + description: "Returned when the resource does not exist." + schema: + type: "integer" + format: "integer" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" "503": - description: Returned when the resource is temporarily unavailable. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the resource is temporarily unavailable." + schema: {} x-number: 100 default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}: get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_CheckNestedEnumGetQueryParams + - "ABitOfEverything" + operationId: "ABitOfEverythingService_CheckNestedEnumGetQueryParams" parameters: - - name: singleNested.ok - in: path - description: DeepEnum description. - required: true - style: simple - explode: false - schema: - type: string - enum: - - "FALSE" - - "TRUE" - - name: singleNested.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: singleNested.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: uuid - in: query - required: true - style: form - explode: true - schema: - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - type: string - format: uuid - x-internal: true + - name: "singleNested.ok" + in: "path" + description: "DeepEnum description." + required: true + type: "string" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "SingleNestedOk" + - name: "singleNested.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "SingleNestedName" + x-optionalDataType: "String" + - name: "singleNested.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "SingleNestedAmount" + x-optionalDataType: "Int64" + - name: "uuid" + in: "query" + required: true + type: "string" + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + format: "uuid" x-internal: true - - name: floatValue - in: query - description: Float value field - required: true - style: form - explode: true - schema: - type: number - format: float - default: 0.2 - - name: doubleValue - in: query - required: true - style: form - explode: true - schema: - type: number - format: double - - name: int64Value - in: query - required: true - style: form - explode: true - schema: - type: string - format: int64 - - name: uint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: int32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: fixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: fixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: boolValue - in: query - required: false - style: form - explode: true - schema: - type: boolean - - name: stringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: bytesValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: byte - - name: uint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: enumValue - in: query - description: |2- - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string + x-exportParamName: "Uuid" + - name: "floatValue" + in: "query" + description: "Float value field" + required: true + type: "number" + default: 0.2 + format: "float" + x-exportParamName: "FloatValue" + - name: "doubleValue" + in: "query" + required: true + type: "number" + format: "double" + x-exportParamName: "DoubleValue" + - name: "int64Value" + in: "query" + required: true + type: "string" + format: "int64" + x-exportParamName: "Int64Value" + - name: "uint64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Uint64Value" + x-optionalDataType: "String" + - name: "int32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Int32Value" + x-optionalDataType: "Int32" + - name: "fixed64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Fixed64Value" + x-optionalDataType: "String" + - name: "fixed32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Fixed32Value" + x-optionalDataType: "Int64" + - name: "boolValue" + in: "query" + required: false + type: "boolean" + x-exportParamName: "BoolValue" + x-optionalDataType: "Bool" + - name: "stringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "StringValue" + x-optionalDataType: "String" + - name: "bytesValue" + in: "query" + required: false + type: "string" + format: "byte" + x-exportParamName: "BytesValue" + x-optionalDataType: "String" + - name: "uint32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Uint32Value" + x-optionalDataType: "Int64" + - name: "enumValue" + in: "query" + description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValue" + x-optionalDataType: "String" + - name: "pathEnumValue" + in: "query" + required: false + type: "string" + default: "ABC" + enum: + - "ABC" + - "DEF" + x-exportParamName: "PathEnumValue" + x-optionalDataType: "String" + - name: "nestedPathEnumValue" + in: "query" + required: false + type: "string" + default: "GHI" + enum: + - "GHI" + - "JKL" + x-exportParamName: "NestedPathEnumValue" + x-optionalDataType: "String" + - name: "sfixed32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sfixed32Value" + x-optionalDataType: "Int32" + - name: "sfixed64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sfixed64Value" + x-optionalDataType: "String" + - name: "sint32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sint32Value" + x-optionalDataType: "Int32" + - name: "sint64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sint64Value" + x-optionalDataType: "String" + - name: "repeatedStringValue" + in: "query" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringValue" + - name: "oneofEmpty" + in: "query" + required: false + type: "object" + x-exportParamName: "OneofEmpty" + - name: "oneofString" + in: "query" + required: false + type: "string" + x-exportParamName: "OneofString" + x-optionalDataType: "String" + - name: "mapValue" + in: "query" + description: "map of numeric enum" + required: false + x-exportParamName: "MapValue" + - name: "mappedStringValue" + in: "query" + description: "Map of string title\n\nMap of string description." + required: false + type: "string" + x-exportParamName: "MappedStringValue" + x-optionalDataType: "String" + - name: "mappedNestedValue" + in: "query" + required: false + x-exportParamName: "MappedNestedValue" + - name: "nonConventionalNameValue" + in: "query" + required: false + type: "string" + x-exportParamName: "NonConventionalNameValue" + x-optionalDataType: "String" + - name: "timestampValue" + in: "query" + required: false + type: "string" + format: "date-time" + x-exportParamName: "TimestampValue" + x-optionalDataType: "Time" + - name: "repeatedEnumValue" + in: "query" + description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - ZERO - - ONE - default: ZERO - - name: pathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumValue" + - name: "repeatedEnumAnnotation" + in: "query" + description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ + \n - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - ABC - - DEF - default: ABC - - name: nestedPathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumAnnotation" + - name: "enumValueAnnotation" + in: "query" + description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValueAnnotation" + x-optionalDataType: "String" + - name: "repeatedStringAnnotation" + in: "query" + description: "Repeated string title\n\nRepeated string description." + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringAnnotation" + - name: "nestedAnnotation.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "NestedAnnotationName" + x-optionalDataType: "String" + - name: "nestedAnnotation.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "NestedAnnotationAmount" + x-optionalDataType: "Int64" + - name: "int64OverrideType" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Int64OverrideType" + x-optionalDataType: "Int64" + - name: "requiredStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as required in Open API definition" + required: true + type: "string" + x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" + - name: "outputOnlyStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as readonly in Open API definition" + required: false + type: "string" + x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" + x-optionalDataType: "String" + - name: "optionalStringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "OptionalStringValue" + x-optionalDataType: "String" + - name: "productId" + in: "query" + description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ + \ are allowed." + required: false + type: "array" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + collectionFormat: "multi" + x-exportParamName: "ProductId" + - name: "optionalStringField" + in: "query" + description: "Test openapiv2 generation of required fields with annotation\ + \ and jsonschema to reproduce" + required: false + type: "string" + x-exportParamName: "OptionalStringField" + x-optionalDataType: "String" + - name: "requiredStringField1" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField1" + - name: "requiredStringField2" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField2" + - name: "required_field_behavior_json_name_custom" + in: "query" + description: "Test openapiv2 handling of required json_name fields" + required: true + type: "string" + x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" + - name: "required_field_schema_json_name_custom" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredFieldSchemaJsonNameCustom" + - name: "trailingOnly" + in: "query" + description: "Trailing only" + required: false + type: "string" + x-exportParamName: "TrailingOnly" + x-optionalDataType: "String" + - name: "trailingOnlyDot" + in: "query" + description: "Trailing only dot." + required: false + type: "string" + x-exportParamName: "TrailingOnlyDot" + x-optionalDataType: "String" + - name: "trailingBoth" + in: "query" + description: "Leading both\n\nTrailing both." + required: false + type: "string" + x-exportParamName: "TrailingBoth" + x-optionalDataType: "String" + - name: "trailingMultiline" + in: "query" + description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ + \nTrailing multiline." + required: false + type: "string" + x-exportParamName: "TrailingMultiline" + x-optionalDataType: "String" + - name: "uuids" + in: "query" + description: "Specify a custom format of repeated field items" + required: false + type: "array" + items: + type: "string" + format: "uuid" + collectionFormat: "multi" + x-exportParamName: "Uuids" + responses: + "200": + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverything" + "403": + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} + "404": + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" + "418": + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" + "500": + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" + default: + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" + /v1/example/a_bit_of_everything/params/get/{singleNested.name}: + get: + tags: + - "ABitOfEverything" + operationId: "ABitOfEverythingService_CheckGetQueryParams" + parameters: + - name: "singleNested.name" + in: "path" + description: "name is nested field." + required: true + type: "string" + x-exportParamName: "SingleNestedName" + - name: "singleNested.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "SingleNestedAmount" + x-optionalDataType: "Int64" + - name: "singleNested.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "SingleNestedOk" + x-optionalDataType: "String" + - name: "uuid" + in: "query" + required: true + type: "string" + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + format: "uuid" + x-internal: true + x-exportParamName: "Uuid" + - name: "floatValue" + in: "query" + description: "Float value field" + required: true + type: "number" + default: 0.2 + format: "float" + x-exportParamName: "FloatValue" + - name: "doubleValue" + in: "query" + required: true + type: "number" + format: "double" + x-exportParamName: "DoubleValue" + - name: "int64Value" + in: "query" + required: true + type: "string" + format: "int64" + x-exportParamName: "Int64Value" + - name: "uint64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Uint64Value" + x-optionalDataType: "String" + - name: "int32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Int32Value" + x-optionalDataType: "Int32" + - name: "fixed64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Fixed64Value" + x-optionalDataType: "String" + - name: "fixed32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Fixed32Value" + x-optionalDataType: "Int64" + - name: "boolValue" + in: "query" + required: false + type: "boolean" + x-exportParamName: "BoolValue" + x-optionalDataType: "Bool" + - name: "stringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "StringValue" + x-optionalDataType: "String" + - name: "bytesValue" + in: "query" + required: false + type: "string" + format: "byte" + x-exportParamName: "BytesValue" + x-optionalDataType: "String" + - name: "uint32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Uint32Value" + x-optionalDataType: "Int64" + - name: "enumValue" + in: "query" + description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValue" + x-optionalDataType: "String" + - name: "pathEnumValue" + in: "query" + required: false + type: "string" + default: "ABC" + enum: + - "ABC" + - "DEF" + x-exportParamName: "PathEnumValue" + x-optionalDataType: "String" + - name: "nestedPathEnumValue" + in: "query" + required: false + type: "string" + default: "GHI" + enum: + - "GHI" + - "JKL" + x-exportParamName: "NestedPathEnumValue" + x-optionalDataType: "String" + - name: "sfixed32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sfixed32Value" + x-optionalDataType: "Int32" + - name: "sfixed64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sfixed64Value" + x-optionalDataType: "String" + - name: "sint32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sint32Value" + x-optionalDataType: "Int32" + - name: "sint64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sint64Value" + x-optionalDataType: "String" + - name: "repeatedStringValue" + in: "query" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringValue" + - name: "oneofEmpty" + in: "query" + required: false + type: "object" + x-exportParamName: "OneofEmpty" + - name: "oneofString" + in: "query" + required: false + type: "string" + x-exportParamName: "OneofString" + x-optionalDataType: "String" + - name: "mapValue" + in: "query" + description: "map of numeric enum" + required: false + x-exportParamName: "MapValue" + - name: "mappedStringValue" + in: "query" + description: "Map of string title\n\nMap of string description." + required: false + type: "string" + x-exportParamName: "MappedStringValue" + x-optionalDataType: "String" + - name: "mappedNestedValue" + in: "query" + required: false + x-exportParamName: "MappedNestedValue" + - name: "nonConventionalNameValue" + in: "query" + required: false + type: "string" + x-exportParamName: "NonConventionalNameValue" + x-optionalDataType: "String" + - name: "timestampValue" + in: "query" + required: false + type: "string" + format: "date-time" + x-exportParamName: "TimestampValue" + x-optionalDataType: "Time" + - name: "repeatedEnumValue" + in: "query" + description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - GHI - - JKL - default: GHI - - name: sfixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sfixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: sint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: repeatedStringValue - in: query - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: oneofEmpty - in: query - required: false - style: form - explode: true - schema: - type: object - - name: oneofString - in: query - required: false - style: form - explode: true - schema: - type: string - - name: mapValue - in: query - description: map of numeric enum - required: false - style: form - explode: true - schema: {} - - name: mappedStringValue - in: query - description: |- - Map of string title - - Map of string description. - required: false - style: form - explode: true - schema: - type: string - - name: mappedNestedValue - in: query - required: false - style: form - explode: true - schema: {} - - name: nonConventionalNameValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: timestampValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: date-time - - name: repeatedEnumValue - in: query - description: |- - repeated enum value. it is comma-separated in query - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedEnumAnnotation - in: query - description: |- - Repeated numeric enum title - - Repeated numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: enumValueAnnotation - in: query - description: |- - Numeric enum title - - Numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumValue" + - name: "repeatedEnumAnnotation" + in: "query" + description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ + \n - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - ZERO - - ONE - default: ZERO - - name: repeatedStringAnnotation - in: query - description: |- - Repeated string title - - Repeated string description. - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: nestedAnnotation.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: nestedAnnotation.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: int64OverrideType - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: requiredStringViaFieldBehaviorAnnotation - in: query - description: mark a field as required in Open API definition - required: true - style: form - explode: true - schema: - type: string - - name: outputOnlyStringViaFieldBehaviorAnnotation - in: query - description: mark a field as readonly in Open API definition - required: false - style: form - explode: true - schema: - type: string - - name: optionalStringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: productId - in: query - description: |- - Test openapiv2 generation of repeated fields - - Only digits are allowed. - required: false - style: form - explode: true - schema: - type: array - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - - name: optionalStringField - in: query - description: Test openapiv2 generation of required fields with annotation - and jsonschema to reproduce - required: false - style: form - explode: true - schema: - type: string - - name: requiredStringField1 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: requiredStringField2 - in: query + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumAnnotation" + - name: "enumValueAnnotation" + in: "query" + description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValueAnnotation" + x-optionalDataType: "String" + - name: "repeatedStringAnnotation" + in: "query" + description: "Repeated string title\n\nRepeated string description." + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringAnnotation" + - name: "nestedAnnotation.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "NestedAnnotationAmount" + x-optionalDataType: "Int64" + - name: "nestedAnnotation.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "NestedAnnotationOk" + x-optionalDataType: "String" + - name: "int64OverrideType" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Int64OverrideType" + x-optionalDataType: "Int64" + - name: "requiredStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as required in Open API definition" + required: true + type: "string" + x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" + - name: "outputOnlyStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as readonly in Open API definition" + required: false + type: "string" + x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" + x-optionalDataType: "String" + - name: "optionalStringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "OptionalStringValue" + x-optionalDataType: "String" + - name: "productId" + in: "query" + description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ + \ are allowed." + required: false + type: "array" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + collectionFormat: "multi" + x-exportParamName: "ProductId" + - name: "optionalStringField" + in: "query" + description: "Test openapiv2 generation of required fields with annotation\ + \ and jsonschema to reproduce" + required: false + type: "string" + x-exportParamName: "OptionalStringField" + x-optionalDataType: "String" + - name: "requiredStringField1" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField1" + - name: "requiredStringField2" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField2" + - name: "required_field_behavior_json_name_custom" + in: "query" + description: "Test openapiv2 handling of required json_name fields" + required: true + type: "string" + x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" + - name: "required_field_schema_json_name_custom" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredFieldSchemaJsonNameCustom" + - name: "trailingOnly" + in: "query" + description: "Trailing only" + required: false + type: "string" + x-exportParamName: "TrailingOnly" + x-optionalDataType: "String" + - name: "trailingOnlyDot" + in: "query" + description: "Trailing only dot." + required: false + type: "string" + x-exportParamName: "TrailingOnlyDot" + x-optionalDataType: "String" + - name: "trailingBoth" + in: "query" + description: "Leading both\n\nTrailing both." + required: false + type: "string" + x-exportParamName: "TrailingBoth" + x-optionalDataType: "String" + - name: "trailingMultiline" + in: "query" + description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ + \nTrailing multiline." + required: false + type: "string" + x-exportParamName: "TrailingMultiline" + x-optionalDataType: "String" + - name: "uuids" + in: "query" + description: "Specify a custom format of repeated field items" + required: false + type: "array" + items: + type: "string" + format: "uuid" + collectionFormat: "multi" + x-exportParamName: "Uuids" + responses: + "200": + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverything" + "403": + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} + "404": + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" + "418": + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" + "500": + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" + default: + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" + /v1/example/a_bit_of_everything/params/post/{stringValue}: + post: + tags: + - "ABitOfEverything" + operationId: "ABitOfEverythingService_CheckPostQueryParams" + parameters: + - name: "stringValue" + in: "path" required: true - style: form - explode: true - schema: - type: string - - name: required_field_behavior_json_name_custom - in: query - description: Test openapiv2 handling of required json_name fields + type: "string" + x-exportParamName: "StringValue" + - in: "body" + name: "singleNested" required: true - style: form - explode: true schema: - type: string - - name: required_field_schema_json_name_custom - in: query + $ref: "#/definitions/ABitOfEverythingNested" + x-exportParamName: "SingleNested" + - name: "uuid" + in: "query" required: true - style: form - explode: true - schema: - type: string - - name: trailingOnly - in: query - description: Trailing only - required: false - style: form - explode: true - schema: - type: string - - name: trailingOnlyDot - in: query - description: Trailing only dot. - required: false - style: form - explode: true - schema: - type: string - - name: trailingBoth - in: query - description: |- - Leading both - - Trailing both. - required: false - style: form - explode: true - schema: - type: string - - name: trailingMultiline - in: query - description: |- - Leading multiline - - This is an example of a multi-line comment. - - Trailing multiline. - required: false - style: form - explode: true - schema: - type: string - - name: uuids - in: query - description: Specify a custom format of repeated field items - required: false - style: form - explode: true - schema: - type: array - items: - type: string - format: uuid + type: "string" + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + format: "uuid" + x-internal: true + x-exportParamName: "Uuid" + - name: "floatValue" + in: "query" + description: "Float value field" + required: true + type: "number" + default: 0.2 + format: "float" + x-exportParamName: "FloatValue" + - name: "doubleValue" + in: "query" + required: true + type: "number" + format: "double" + x-exportParamName: "DoubleValue" + - name: "int64Value" + in: "query" + required: true + type: "string" + format: "int64" + x-exportParamName: "Int64Value" + - name: "uint64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Uint64Value" + x-optionalDataType: "String" + - name: "int32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Int32Value" + x-optionalDataType: "Int32" + - name: "fixed64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Fixed64Value" + x-optionalDataType: "String" + - name: "fixed32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Fixed32Value" + x-optionalDataType: "Int64" + - name: "boolValue" + in: "query" + required: false + type: "boolean" + x-exportParamName: "BoolValue" + x-optionalDataType: "Bool" + - name: "bytesValue" + in: "query" + required: false + type: "string" + format: "byte" + x-exportParamName: "BytesValue" + x-optionalDataType: "String" + - name: "uint32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Uint32Value" + x-optionalDataType: "Int64" + - name: "enumValue" + in: "query" + description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValue" + x-optionalDataType: "String" + - name: "pathEnumValue" + in: "query" + required: false + type: "string" + default: "ABC" + enum: + - "ABC" + - "DEF" + x-exportParamName: "PathEnumValue" + x-optionalDataType: "String" + - name: "nestedPathEnumValue" + in: "query" + required: false + type: "string" + default: "GHI" + enum: + - "GHI" + - "JKL" + x-exportParamName: "NestedPathEnumValue" + x-optionalDataType: "String" + - name: "sfixed32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sfixed32Value" + x-optionalDataType: "Int32" + - name: "sfixed64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sfixed64Value" + x-optionalDataType: "String" + - name: "sint32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sint32Value" + x-optionalDataType: "Int32" + - name: "sint64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sint64Value" + x-optionalDataType: "String" + - name: "repeatedStringValue" + in: "query" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringValue" + - name: "oneofEmpty" + in: "query" + required: false + type: "object" + x-exportParamName: "OneofEmpty" + - name: "oneofString" + in: "query" + required: false + type: "string" + x-exportParamName: "OneofString" + x-optionalDataType: "String" + - name: "mapValue" + in: "query" + description: "map of numeric enum" + required: false + x-exportParamName: "MapValue" + - name: "mappedStringValue" + in: "query" + description: "Map of string title\n\nMap of string description." + required: false + type: "string" + x-exportParamName: "MappedStringValue" + x-optionalDataType: "String" + - name: "mappedNestedValue" + in: "query" + required: false + x-exportParamName: "MappedNestedValue" + - name: "nonConventionalNameValue" + in: "query" + required: false + type: "string" + x-exportParamName: "NonConventionalNameValue" + x-optionalDataType: "String" + - name: "timestampValue" + in: "query" + required: false + type: "string" + format: "date-time" + x-exportParamName: "TimestampValue" + x-optionalDataType: "Time" + - name: "repeatedEnumValue" + in: "query" + description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" + enum: + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumValue" + - name: "repeatedEnumAnnotation" + in: "query" + description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ + \n - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" + enum: + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumAnnotation" + - name: "enumValueAnnotation" + in: "query" + description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValueAnnotation" + x-optionalDataType: "String" + - name: "repeatedStringAnnotation" + in: "query" + description: "Repeated string title\n\nRepeated string description." + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringAnnotation" + - name: "nestedAnnotation.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "NestedAnnotationName" + x-optionalDataType: "String" + - name: "nestedAnnotation.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "NestedAnnotationAmount" + x-optionalDataType: "Int64" + - name: "nestedAnnotation.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "NestedAnnotationOk" + x-optionalDataType: "String" + - name: "int64OverrideType" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Int64OverrideType" + x-optionalDataType: "Int64" + - name: "requiredStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as required in Open API definition" + required: true + type: "string" + x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" + - name: "outputOnlyStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as readonly in Open API definition" + required: false + type: "string" + x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" + x-optionalDataType: "String" + - name: "optionalStringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "OptionalStringValue" + x-optionalDataType: "String" + - name: "productId" + in: "query" + description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ + \ are allowed." + required: false + type: "array" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + collectionFormat: "multi" + x-exportParamName: "ProductId" + - name: "optionalStringField" + in: "query" + description: "Test openapiv2 generation of required fields with annotation\ + \ and jsonschema to reproduce" + required: false + type: "string" + x-exportParamName: "OptionalStringField" + x-optionalDataType: "String" + - name: "requiredStringField1" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField1" + - name: "requiredStringField2" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField2" + - name: "required_field_behavior_json_name_custom" + in: "query" + description: "Test openapiv2 handling of required json_name fields" + required: true + type: "string" + x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" + - name: "required_field_schema_json_name_custom" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredFieldSchemaJsonNameCustom" + - name: "trailingOnly" + in: "query" + description: "Trailing only" + required: false + type: "string" + x-exportParamName: "TrailingOnly" + x-optionalDataType: "String" + - name: "trailingOnlyDot" + in: "query" + description: "Trailing only dot." + required: false + type: "string" + x-exportParamName: "TrailingOnlyDot" + x-optionalDataType: "String" + - name: "trailingBoth" + in: "query" + description: "Leading both\n\nTrailing both." + required: false + type: "string" + x-exportParamName: "TrailingBoth" + x-optionalDataType: "String" + - name: "trailingMultiline" + in: "query" + description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ + \nTrailing multiline." + required: false + type: "string" + x-exportParamName: "TrailingMultiline" + x-optionalDataType: "String" + - name: "uuids" + in: "query" + description: "Specify a custom format of repeated field items" + required: false + type: "array" + items: + type: "string" + format: "uuid" + collectionFormat: "multi" + x-exportParamName: "Uuids" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverything" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - /v1/example/a_bit_of_everything/params/get/{singleNested.name}: + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" + /v1/example/a_bit_of_everything/query/{uuidName}: get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_CheckGetQueryParams + - "ABitOfEverything" + operationId: "ABitOfEverythingService_GetQuery" parameters: - - name: singleNested.name - in: path - description: name is nested field. + - name: "uuidName" + in: "path" required: true - style: simple - explode: false - schema: - type: string - - name: singleNested.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: singleNested.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: uuid - in: query - required: true - style: form - explode: true - schema: - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - type: string - format: uuid - x-internal: true + type: "string" + format: "uuid" x-internal: true - - name: floatValue - in: query - description: Float value field - required: true - style: form - explode: true - schema: - type: number - format: float - default: 0.2 - - name: doubleValue - in: query - required: true - style: form - explode: true - schema: - type: number - format: double - - name: int64Value - in: query - required: true - style: form - explode: true - schema: - type: string - format: int64 - - name: uint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: int32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: fixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: fixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: boolValue - in: query - required: false - style: form - explode: true - schema: - type: boolean - - name: stringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: bytesValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: byte - - name: uint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: enumValue - in: query - description: |2- - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: pathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string + x-exportParamName: "UuidName" + - name: "singleNested.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "SingleNestedName" + x-optionalDataType: "String" + - name: "singleNested.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "SingleNestedAmount" + x-optionalDataType: "Int64" + - name: "singleNested.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "SingleNestedOk" + x-optionalDataType: "String" + - name: "floatValue" + in: "query" + description: "Float value field" + required: true + type: "number" + default: 0.2 + format: "float" + x-exportParamName: "FloatValue" + - name: "doubleValue" + in: "query" + required: true + type: "number" + format: "double" + x-exportParamName: "DoubleValue" + - name: "int64Value" + in: "query" + required: true + type: "string" + format: "int64" + x-exportParamName: "Int64Value" + - name: "uint64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Uint64Value" + x-optionalDataType: "String" + - name: "int32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Int32Value" + x-optionalDataType: "Int32" + - name: "fixed64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Fixed64Value" + x-optionalDataType: "String" + - name: "fixed32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Fixed32Value" + x-optionalDataType: "Int64" + - name: "boolValue" + in: "query" + required: false + type: "boolean" + x-exportParamName: "BoolValue" + x-optionalDataType: "Bool" + - name: "stringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "StringValue" + x-optionalDataType: "String" + - name: "bytesValue" + in: "query" + required: false + type: "string" + format: "byte" + x-exportParamName: "BytesValue" + x-optionalDataType: "String" + - name: "uint32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Uint32Value" + x-optionalDataType: "Int64" + - name: "enumValue" + in: "query" + description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValue" + x-optionalDataType: "String" + - name: "pathEnumValue" + in: "query" + required: false + type: "string" + default: "ABC" + enum: + - "ABC" + - "DEF" + x-exportParamName: "PathEnumValue" + x-optionalDataType: "String" + - name: "nestedPathEnumValue" + in: "query" + required: false + type: "string" + default: "GHI" + enum: + - "GHI" + - "JKL" + x-exportParamName: "NestedPathEnumValue" + x-optionalDataType: "String" + - name: "sfixed32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sfixed32Value" + x-optionalDataType: "Int32" + - name: "sfixed64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sfixed64Value" + x-optionalDataType: "String" + - name: "sint32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sint32Value" + x-optionalDataType: "Int32" + - name: "sint64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sint64Value" + x-optionalDataType: "String" + - name: "repeatedStringValue" + in: "query" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringValue" + - name: "oneofEmpty" + in: "query" + required: false + type: "object" + x-exportParamName: "OneofEmpty" + - name: "oneofString" + in: "query" + required: false + type: "string" + x-exportParamName: "OneofString" + x-optionalDataType: "String" + - name: "mapValue" + in: "query" + description: "map of numeric enum" + required: false + x-exportParamName: "MapValue" + - name: "mappedStringValue" + in: "query" + description: "Map of string title\n\nMap of string description." + required: false + type: "string" + x-exportParamName: "MappedStringValue" + x-optionalDataType: "String" + - name: "mappedNestedValue" + in: "query" + required: false + x-exportParamName: "MappedNestedValue" + - name: "nonConventionalNameValue" + in: "query" + required: false + type: "string" + x-exportParamName: "NonConventionalNameValue" + x-optionalDataType: "String" + - name: "timestampValue" + in: "query" + required: false + type: "string" + format: "date-time" + x-exportParamName: "TimestampValue" + x-optionalDataType: "Time" + - name: "repeatedEnumValue" + in: "query" + description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - ABC - - DEF - default: ABC - - name: nestedPathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumValue" + - name: "repeatedEnumAnnotation" + in: "query" + description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ + \n - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - GHI - - JKL - default: GHI - - name: sfixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sfixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: sint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: repeatedStringValue - in: query - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: oneofEmpty - in: query - required: false - style: form - explode: true - schema: - type: object - - name: oneofString - in: query - required: false - style: form - explode: true - schema: - type: string - - name: mapValue - in: query - description: map of numeric enum - required: false - style: form - explode: true - schema: {} - - name: mappedStringValue - in: query - description: |- - Map of string title - - Map of string description. - required: false - style: form - explode: true - schema: - type: string - - name: mappedNestedValue - in: query - required: false - style: form - explode: true - schema: {} - - name: nonConventionalNameValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: timestampValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: date-time - - name: repeatedEnumValue - in: query - description: |- - repeated enum value. it is comma-separated in query - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedEnumAnnotation - in: query - description: |- - Repeated numeric enum title - - Repeated numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: enumValueAnnotation - in: query - description: |- - Numeric enum title - - Numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumAnnotation" + - name: "enumValueAnnotation" + in: "query" + description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValueAnnotation" + x-optionalDataType: "String" + - name: "repeatedStringAnnotation" + in: "query" + description: "Repeated string title\n\nRepeated string description." + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringAnnotation" + - name: "nestedAnnotation.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "NestedAnnotationName" + x-optionalDataType: "String" + - name: "nestedAnnotation.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "NestedAnnotationAmount" + x-optionalDataType: "Int64" + - name: "nestedAnnotation.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "NestedAnnotationOk" + x-optionalDataType: "String" + - name: "int64OverrideType" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Int64OverrideType" + x-optionalDataType: "Int64" + - name: "requiredStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as required in Open API definition" + required: true + type: "string" + x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" + - name: "outputOnlyStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as readonly in Open API definition" + required: false + type: "string" + x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" + x-optionalDataType: "String" + - name: "optionalStringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "OptionalStringValue" + x-optionalDataType: "String" + - name: "productId" + in: "query" + description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ + \ are allowed." + required: false + type: "array" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + collectionFormat: "multi" + x-exportParamName: "ProductId" + - name: "optionalStringField" + in: "query" + description: "Test openapiv2 generation of required fields with annotation\ + \ and jsonschema to reproduce" + required: false + type: "string" + x-exportParamName: "OptionalStringField" + x-optionalDataType: "String" + - name: "requiredStringField1" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField1" + - name: "requiredStringField2" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField2" + - name: "required_field_behavior_json_name_custom" + in: "query" + description: "Test openapiv2 handling of required json_name fields" + required: true + type: "string" + x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" + - name: "required_field_schema_json_name_custom" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredFieldSchemaJsonNameCustom" + - name: "trailingOnly" + in: "query" + description: "Trailing only" + required: false + type: "string" + x-exportParamName: "TrailingOnly" + x-optionalDataType: "String" + - name: "trailingOnlyDot" + in: "query" + description: "Trailing only dot." + required: false + type: "string" + x-exportParamName: "TrailingOnlyDot" + x-optionalDataType: "String" + - name: "trailingBoth" + in: "query" + description: "Leading both\n\nTrailing both." + required: false + type: "string" + x-exportParamName: "TrailingBoth" + x-optionalDataType: "String" + - name: "trailingMultiline" + in: "query" + description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ + \nTrailing multiline." + required: false + type: "string" + x-exportParamName: "TrailingMultiline" + x-optionalDataType: "String" + - name: "uuids" + in: "query" + description: "Specify a custom format of repeated field items" + required: false + type: "array" + items: + type: "string" + format: "uuid" + collectionFormat: "multi" + x-exportParamName: "Uuids" + security: [] + externalDocs: + description: "Find out more about GetQuery" + url: "https://github.com/grpc-ecosystem/grpc-gateway" + deprecated: true + responses: + "200": + description: "A successful response." + schema: + type: "object" + "403": + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} + "404": + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" + "418": + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" + "500": + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" + default: + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" + ? /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation} + : post: + tags: + - "ABitOfEverything" + summary: "Create a new ABitOfEverything" + description: "This API creates a new ABitOfEverything" + operationId: "ABitOfEverythingService_Create" + parameters: + - name: "floatValue" + in: "path" + description: "Float value field" + required: true + type: "number" + default: 0.2 + format: "float" + x-exportParamName: "FloatValue" + - name: "doubleValue" + in: "path" + required: true + type: "number" + format: "double" + x-exportParamName: "DoubleValue" + - name: "int64Value" + in: "path" + required: true + type: "string" + format: "int64" + x-exportParamName: "Int64Value" + - name: "uint64Value" + in: "path" + required: true + type: "string" + format: "uint64" + x-exportParamName: "Uint64Value" + - name: "int32Value" + in: "path" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Int32Value" + - name: "fixed64Value" + in: "path" + required: true + type: "string" + format: "uint64" + x-exportParamName: "Fixed64Value" + - name: "fixed32Value" + in: "path" + required: true + type: "integer" + format: "int64" + x-exportParamName: "Fixed32Value" + - name: "boolValue" + in: "path" + required: true + type: "boolean" + x-exportParamName: "BoolValue" + - name: "stringValue" + in: "path" + required: true + type: "string" + pattern: "strprefix/[^/]+" + x-exportParamName: "StringValue" + - name: "uint32Value" + in: "path" + required: true + type: "integer" + format: "int64" + x-exportParamName: "Uint32Value" + - name: "sfixed32Value" + in: "path" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Sfixed32Value" + - name: "sfixed64Value" + in: "path" + required: true + type: "string" + format: "int64" + x-exportParamName: "Sfixed64Value" + - name: "sint32Value" + in: "path" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Sint32Value" + - name: "sint64Value" + in: "path" + required: true + type: "string" + format: "int64" + x-exportParamName: "Sint64Value" + - name: "nonConventionalNameValue" + in: "path" + required: true + type: "string" + x-exportParamName: "NonConventionalNameValue" + - name: "enumValue" + in: "path" + required: true + type: "string" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValue" + - name: "pathEnumValue" + in: "path" + required: true + type: "string" + enum: + - "ABC" + - "DEF" + x-exportParamName: "PathEnumValue" + - name: "nestedPathEnumValue" + in: "path" + required: true + type: "string" + enum: + - "GHI" + - "JKL" + x-exportParamName: "NestedPathEnumValue" + - name: "enumValueAnnotation" + in: "path" + description: "Numeric enum description." + required: true + type: "string" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValueAnnotation" + - name: "singleNested.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "SingleNestedName" + x-optionalDataType: "String" + - name: "singleNested.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "SingleNestedAmount" + x-optionalDataType: "Int64" + - name: "singleNested.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "SingleNestedOk" + x-optionalDataType: "String" + - name: "uuid" + in: "query" + required: true + type: "string" + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + format: "uuid" + x-internal: true + x-exportParamName: "Uuid" + - name: "bytesValue" + in: "query" + required: false + type: "string" + format: "byte" + x-exportParamName: "BytesValue" + x-optionalDataType: "String" + - name: "repeatedStringValue" + in: "query" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringValue" + - name: "oneofEmpty" + in: "query" + required: false + type: "object" + x-exportParamName: "OneofEmpty" + - name: "oneofString" + in: "query" + required: false + type: "string" + x-exportParamName: "OneofString" + x-optionalDataType: "String" + - name: "mapValue" + in: "query" + description: "map of numeric enum" + required: false + x-exportParamName: "MapValue" + - name: "mappedStringValue" + in: "query" + description: "Map of string title\n\nMap of string description." + required: false + type: "string" + x-exportParamName: "MappedStringValue" + x-optionalDataType: "String" + - name: "mappedNestedValue" + in: "query" + required: false + x-exportParamName: "MappedNestedValue" + - name: "timestampValue" + in: "query" + required: false + type: "string" + format: "date-time" + x-exportParamName: "TimestampValue" + x-optionalDataType: "Time" + - name: "repeatedEnumValue" + in: "query" + description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - ZERO - - ONE - default: ZERO - - name: repeatedStringAnnotation - in: query - description: |- - Repeated string title - - Repeated string description. - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: nestedAnnotation.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: nestedAnnotation.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumValue" + - name: "repeatedEnumAnnotation" + in: "query" + description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ + \n - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: int64OverrideType - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: requiredStringViaFieldBehaviorAnnotation - in: query - description: mark a field as required in Open API definition - required: true - style: form - explode: true - schema: - type: string - - name: outputOnlyStringViaFieldBehaviorAnnotation - in: query - description: mark a field as readonly in Open API definition - required: false - style: form - explode: true - schema: - type: string - - name: optionalStringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: productId - in: query - description: |- - Test openapiv2 generation of repeated fields - - Only digits are allowed. - required: false - style: form - explode: true - schema: - type: array - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - - name: optionalStringField - in: query - description: Test openapiv2 generation of required fields with annotation - and jsonschema to reproduce - required: false - style: form - explode: true - schema: - type: string - - name: requiredStringField1 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: requiredStringField2 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: required_field_behavior_json_name_custom - in: query - description: Test openapiv2 handling of required json_name fields - required: true - style: form - explode: true - schema: - type: string - - name: required_field_schema_json_name_custom - in: query - required: true - style: form - explode: true - schema: - type: string - - name: trailingOnly - in: query - description: Trailing only - required: false - style: form - explode: true - schema: - type: string - - name: trailingOnlyDot - in: query - description: Trailing only dot. - required: false - style: form - explode: true - schema: - type: string - - name: trailingBoth - in: query - description: |- - Leading both - - Trailing both. - required: false - style: form - explode: true - schema: - type: string - - name: trailingMultiline - in: query - description: |- - Leading multiline - - This is an example of a multi-line comment. - - Trailing multiline. - required: false - style: form - explode: true - schema: - type: string - - name: uuids - in: query - description: Specify a custom format of repeated field items - required: false - style: form - explode: true - schema: - type: array - items: - type: string - format: uuid + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumAnnotation" + - name: "repeatedStringAnnotation" + in: "query" + description: "Repeated string title\n\nRepeated string description." + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringAnnotation" + - name: "nestedAnnotation.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "NestedAnnotationName" + x-optionalDataType: "String" + - name: "nestedAnnotation.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "NestedAnnotationAmount" + x-optionalDataType: "Int64" + - name: "nestedAnnotation.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "NestedAnnotationOk" + x-optionalDataType: "String" + - name: "int64OverrideType" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Int64OverrideType" + x-optionalDataType: "Int64" + - name: "requiredStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as required in Open API definition" + required: true + type: "string" + x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" + - name: "outputOnlyStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as readonly in Open API definition" + required: false + type: "string" + x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" + x-optionalDataType: "String" + - name: "optionalStringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "OptionalStringValue" + x-optionalDataType: "String" + - name: "productId" + in: "query" + description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ + \ are allowed." + required: false + type: "array" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + collectionFormat: "multi" + x-exportParamName: "ProductId" + - name: "optionalStringField" + in: "query" + description: "Test openapiv2 generation of required fields with annotation\ + \ and jsonschema to reproduce" + required: false + type: "string" + x-exportParamName: "OptionalStringField" + x-optionalDataType: "String" + - name: "requiredStringField1" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField1" + - name: "requiredStringField2" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField2" + - name: "required_field_behavior_json_name_custom" + in: "query" + description: "Test openapiv2 handling of required json_name fields" + required: true + type: "string" + x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" + - name: "required_field_schema_json_name_custom" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredFieldSchemaJsonNameCustom" + - name: "trailingOnly" + in: "query" + description: "Trailing only" + required: false + type: "string" + x-exportParamName: "TrailingOnly" + x-optionalDataType: "String" + - name: "trailingOnlyDot" + in: "query" + description: "Trailing only dot." + required: false + type: "string" + x-exportParamName: "TrailingOnlyDot" + x-optionalDataType: "String" + - name: "trailingBoth" + in: "query" + description: "Leading both\n\nTrailing both." + required: false + type: "string" + x-exportParamName: "TrailingBoth" + x-optionalDataType: "String" + - name: "trailingMultiline" + in: "query" + description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ + \nTrailing multiline." + required: false + type: "string" + x-exportParamName: "TrailingMultiline" + x-optionalDataType: "String" + - name: "uuids" + in: "query" + description: "Specify a custom format of repeated field items" + required: false + type: "array" + items: + type: "string" + format: "uuid" + collectionFormat: "multi" + x-exportParamName: "Uuids" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverything" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - /v1/example/a_bit_of_everything/params/post/{stringValue}: - post: + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" + /v1/example/a_bit_of_everything/{uuidName}: + head: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_CheckPostQueryParams + - "ABitOfEverything" + operationId: "ABitOfEverythingService_Exists" parameters: - - name: stringValue - in: path + - name: "uuidName" + in: "path" required: true - style: simple - explode: false - schema: - type: string - - name: uuid - in: query + type: "string" + format: "uuid" + x-internal: true + x-exportParamName: "UuidName" + - name: "singleNested.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "SingleNestedName" + x-optionalDataType: "String" + - name: "singleNested.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "SingleNestedAmount" + x-optionalDataType: "Int64" + - name: "singleNested.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "SingleNestedOk" + x-optionalDataType: "String" + - name: "floatValue" + in: "query" + description: "Float value field" + required: true + type: "number" + default: 0.2 + format: "float" + x-exportParamName: "FloatValue" + - name: "doubleValue" + in: "query" + required: true + type: "number" + format: "double" + x-exportParamName: "DoubleValue" + - name: "int64Value" + in: "query" + required: true + type: "string" + format: "int64" + x-exportParamName: "Int64Value" + - name: "uint64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Uint64Value" + x-optionalDataType: "String" + - name: "int32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Int32Value" + x-optionalDataType: "Int32" + - name: "fixed64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Fixed64Value" + x-optionalDataType: "String" + - name: "fixed32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Fixed32Value" + x-optionalDataType: "Int64" + - name: "boolValue" + in: "query" + required: false + type: "boolean" + x-exportParamName: "BoolValue" + x-optionalDataType: "Bool" + - name: "stringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "StringValue" + x-optionalDataType: "String" + - name: "bytesValue" + in: "query" + required: false + type: "string" + format: "byte" + x-exportParamName: "BytesValue" + x-optionalDataType: "String" + - name: "uint32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Uint32Value" + x-optionalDataType: "Int64" + - name: "enumValue" + in: "query" + description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValue" + x-optionalDataType: "String" + - name: "pathEnumValue" + in: "query" + required: false + type: "string" + default: "ABC" + enum: + - "ABC" + - "DEF" + x-exportParamName: "PathEnumValue" + x-optionalDataType: "String" + - name: "nestedPathEnumValue" + in: "query" + required: false + type: "string" + default: "GHI" + enum: + - "GHI" + - "JKL" + x-exportParamName: "NestedPathEnumValue" + x-optionalDataType: "String" + - name: "sfixed32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sfixed32Value" + x-optionalDataType: "Int32" + - name: "sfixed64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sfixed64Value" + x-optionalDataType: "String" + - name: "sint32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sint32Value" + x-optionalDataType: "Int32" + - name: "sint64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sint64Value" + x-optionalDataType: "String" + - name: "repeatedStringValue" + in: "query" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringValue" + - name: "oneofEmpty" + in: "query" + required: false + type: "object" + x-exportParamName: "OneofEmpty" + - name: "oneofString" + in: "query" + required: false + type: "string" + x-exportParamName: "OneofString" + x-optionalDataType: "String" + - name: "mapValue" + in: "query" + description: "map of numeric enum" + required: false + x-exportParamName: "MapValue" + - name: "mappedStringValue" + in: "query" + description: "Map of string title\n\nMap of string description." + required: false + type: "string" + x-exportParamName: "MappedStringValue" + x-optionalDataType: "String" + - name: "mappedNestedValue" + in: "query" + required: false + x-exportParamName: "MappedNestedValue" + - name: "nonConventionalNameValue" + in: "query" + required: false + type: "string" + x-exportParamName: "NonConventionalNameValue" + x-optionalDataType: "String" + - name: "timestampValue" + in: "query" + required: false + type: "string" + format: "date-time" + x-exportParamName: "TimestampValue" + x-optionalDataType: "Time" + - name: "repeatedEnumValue" + in: "query" + description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" + enum: + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumValue" + - name: "repeatedEnumAnnotation" + in: "query" + description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ + \n - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" + enum: + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumAnnotation" + - name: "enumValueAnnotation" + in: "query" + description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValueAnnotation" + x-optionalDataType: "String" + - name: "repeatedStringAnnotation" + in: "query" + description: "Repeated string title\n\nRepeated string description." + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringAnnotation" + - name: "nestedAnnotation.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "NestedAnnotationName" + x-optionalDataType: "String" + - name: "nestedAnnotation.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "NestedAnnotationAmount" + x-optionalDataType: "Int64" + - name: "nestedAnnotation.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "NestedAnnotationOk" + x-optionalDataType: "String" + - name: "int64OverrideType" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Int64OverrideType" + x-optionalDataType: "Int64" + - name: "requiredStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as required in Open API definition" + required: true + type: "string" + x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" + - name: "outputOnlyStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as readonly in Open API definition" + required: false + type: "string" + x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" + x-optionalDataType: "String" + - name: "optionalStringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "OptionalStringValue" + x-optionalDataType: "String" + - name: "productId" + in: "query" + description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ + \ are allowed." + required: false + type: "array" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + collectionFormat: "multi" + x-exportParamName: "ProductId" + - name: "optionalStringField" + in: "query" + description: "Test openapiv2 generation of required fields with annotation\ + \ and jsonschema to reproduce" + required: false + type: "string" + x-exportParamName: "OptionalStringField" + x-optionalDataType: "String" + - name: "requiredStringField1" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField1" + - name: "requiredStringField2" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField2" + - name: "required_field_behavior_json_name_custom" + in: "query" + description: "Test openapiv2 handling of required json_name fields" + required: true + type: "string" + x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" + - name: "required_field_schema_json_name_custom" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredFieldSchemaJsonNameCustom" + - name: "trailingOnly" + in: "query" + description: "Trailing only" + required: false + type: "string" + x-exportParamName: "TrailingOnly" + x-optionalDataType: "String" + - name: "trailingOnlyDot" + in: "query" + description: "Trailing only dot." + required: false + type: "string" + x-exportParamName: "TrailingOnlyDot" + x-optionalDataType: "String" + - name: "trailingBoth" + in: "query" + description: "Leading both\n\nTrailing both." + required: false + type: "string" + x-exportParamName: "TrailingBoth" + x-optionalDataType: "String" + - name: "trailingMultiline" + in: "query" + description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ + \nTrailing multiline." + required: false + type: "string" + x-exportParamName: "TrailingMultiline" + x-optionalDataType: "String" + - name: "uuids" + in: "query" + description: "Specify a custom format of repeated field items" + required: false + type: "array" + items: + type: "string" + format: "uuid" + collectionFormat: "multi" + x-exportParamName: "Uuids" + responses: + "200": + description: "A successful response." + schema: + type: "object" + default: + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" + put: + tags: + - "ABitOfEverything" + operationId: "ABitOfEverythingService_Update" + parameters: + - name: "uuidName" + in: "path" required: true - style: form - explode: true - schema: - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - type: string - format: uuid - x-internal: true + type: "string" + format: "uuid" x-internal: true - - name: floatValue - in: query - description: Float value field + x-exportParamName: "UuidName" + - in: "body" + name: "body" required: true - style: form - explode: true - schema: - type: number - format: float - default: 0.2 - - name: doubleValue - in: query - required: true - style: form - explode: true schema: - type: number - format: double - - name: int64Value - in: query - required: true - style: form - explode: true - schema: - type: string - format: int64 - - name: uint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: int32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: fixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: fixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: boolValue - in: query - required: false - style: form - explode: true - schema: - type: boolean - - name: bytesValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: byte - - name: uint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: enumValue - in: query - description: |2- - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: pathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - ABC - - DEF - default: ABC - - name: nestedPathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - GHI - - JKL - default: GHI - - name: sfixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sfixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: sint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: repeatedStringValue - in: query - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: oneofEmpty - in: query - required: false - style: form - explode: true - schema: - type: object - - name: oneofString - in: query - required: false - style: form - explode: true - schema: - type: string - - name: mapValue - in: query - description: map of numeric enum - required: false - style: form - explode: true - schema: {} - - name: mappedStringValue - in: query - description: |- - Map of string title - - Map of string description. - required: false - style: form - explode: true - schema: - type: string - - name: mappedNestedValue - in: query - required: false - style: form - explode: true - schema: {} - - name: nonConventionalNameValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: timestampValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: date-time - - name: repeatedEnumValue - in: query - description: |- - repeated enum value. it is comma-separated in query - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedEnumAnnotation - in: query - description: |- - Repeated numeric enum title - - Repeated numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: enumValueAnnotation - in: query - description: |- - Numeric enum title - - Numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: repeatedStringAnnotation - in: query - description: |- - Repeated string title - - Repeated string description. - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: nestedAnnotation.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: nestedAnnotation.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: nestedAnnotation.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: int64OverrideType - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: requiredStringViaFieldBehaviorAnnotation - in: query - description: mark a field as required in Open API definition - required: true - style: form - explode: true - schema: - type: string - - name: outputOnlyStringViaFieldBehaviorAnnotation - in: query - description: mark a field as readonly in Open API definition - required: false - style: form - explode: true - schema: - type: string - - name: optionalStringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: productId - in: query - description: |- - Test openapiv2 generation of repeated fields - - Only digits are allowed. - required: false - style: form - explode: true - schema: - type: array - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - - name: optionalStringField - in: query - description: Test openapiv2 generation of required fields with annotation - and jsonschema to reproduce - required: false - style: form - explode: true - schema: - type: string - - name: requiredStringField1 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: requiredStringField2 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: required_field_behavior_json_name_custom - in: query - description: Test openapiv2 handling of required json_name fields - required: true - style: form - explode: true - schema: - type: string - - name: required_field_schema_json_name_custom - in: query - required: true - style: form - explode: true - schema: - type: string - - name: trailingOnly - in: query - description: Trailing only - required: false - style: form - explode: true - schema: - type: string - - name: trailingOnlyDot - in: query - description: Trailing only dot. - required: false - style: form - explode: true - schema: - type: string - - name: trailingBoth - in: query - description: |- - Leading both - - Trailing both. - required: false - style: form - explode: true - schema: - type: string - - name: trailingMultiline - in: query - description: |- - Leading multiline - - This is an example of a multi-line comment. - - Trailing multiline. - required: false - style: form - explode: true - schema: - type: string - - name: uuids - in: query - description: Specify a custom format of repeated field items - required: false - style: form - explode: true - schema: - type: array - items: - type: string - format: uuid - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ABitOfEverythingNested" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/ABitOfEverythingNested" - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object - "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string - "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: singleNested - /v1/example/a_bit_of_everything/query/{uuidName}: - get: - tags: - - ABitOfEverything - externalDocs: - description: Find out more about GetQuery - url: https://github.com/grpc-ecosystem/grpc-gateway - operationId: ABitOfEverythingService_GetQuery - parameters: - - name: uuidName - in: path - required: true - style: simple - explode: false - schema: - type: string - format: uuid - x-internal: true - x-internal: true - - name: singleNested.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: singleNested.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: singleNested.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: floatValue - in: query - description: Float value field - required: true - style: form - explode: true - schema: - type: number - format: float - default: 0.2 - - name: doubleValue - in: query - required: true - style: form - explode: true - schema: - type: number - format: double - - name: int64Value - in: query - required: true - style: form - explode: true - schema: - type: string - format: int64 - - name: uint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: int32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: fixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: fixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: boolValue - in: query - required: false - style: form - explode: true - schema: - type: boolean - - name: stringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: bytesValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: byte - - name: uint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: enumValue - in: query - description: |2- - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: pathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - ABC - - DEF - default: ABC - - name: nestedPathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - GHI - - JKL - default: GHI - - name: sfixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sfixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: sint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: repeatedStringValue - in: query - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: oneofEmpty - in: query - required: false - style: form - explode: true - schema: - type: object - - name: oneofString - in: query - required: false - style: form - explode: true - schema: - type: string - - name: mapValue - in: query - description: map of numeric enum - required: false - style: form - explode: true - schema: {} - - name: mappedStringValue - in: query - description: |- - Map of string title - - Map of string description. - required: false - style: form - explode: true - schema: - type: string - - name: mappedNestedValue - in: query - required: false - style: form - explode: true - schema: {} - - name: nonConventionalNameValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: timestampValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: date-time - - name: repeatedEnumValue - in: query - description: |- - repeated enum value. it is comma-separated in query - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedEnumAnnotation - in: query - description: |- - Repeated numeric enum title - - Repeated numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: enumValueAnnotation - in: query - description: |- - Numeric enum title - - Numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: repeatedStringAnnotation - in: query - description: |- - Repeated string title - - Repeated string description. - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: nestedAnnotation.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: nestedAnnotation.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: nestedAnnotation.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: int64OverrideType - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: requiredStringViaFieldBehaviorAnnotation - in: query - description: mark a field as required in Open API definition - required: true - style: form - explode: true - schema: - type: string - - name: outputOnlyStringViaFieldBehaviorAnnotation - in: query - description: mark a field as readonly in Open API definition - required: false - style: form - explode: true - schema: - type: string - - name: optionalStringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: productId - in: query - description: |- - Test openapiv2 generation of repeated fields - - Only digits are allowed. - required: false - style: form - explode: true - schema: - type: array - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - - name: optionalStringField - in: query - description: Test openapiv2 generation of required fields with annotation - and jsonschema to reproduce - required: false - style: form - explode: true - schema: - type: string - - name: requiredStringField1 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: requiredStringField2 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: required_field_behavior_json_name_custom - in: query - description: Test openapiv2 handling of required json_name fields - required: true - style: form - explode: true - schema: - type: string - - name: required_field_schema_json_name_custom - in: query - required: true - style: form - explode: true - schema: - type: string - - name: trailingOnly - in: query - description: Trailing only - required: false - style: form - explode: true - schema: - type: string - - name: trailingOnlyDot - in: query - description: Trailing only dot. - required: false - style: form - explode: true - schema: - type: string - - name: trailingBoth - in: query - description: |- - Leading both - - Trailing both. - required: false - style: form - explode: true - schema: - type: string - - name: trailingMultiline - in: query - description: |- - Leading multiline - - This is an example of a multi-line comment. - - Trailing multiline. - required: false - style: form - explode: true - schema: - type: string - - name: uuids - in: query - description: Specify a custom format of repeated field items - required: false - style: form - explode: true - schema: - type: array - items: - type: string - format: uuid - responses: - "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object - "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object - "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string - "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - deprecated: true - security: [] - ? /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation} - : post: - tags: - - ABitOfEverything - summary: Create a new ABitOfEverything - description: This API creates a new ABitOfEverything - operationId: ABitOfEverythingService_Create - parameters: - - name: floatValue - in: path - description: Float value field - required: true - style: simple - explode: false - schema: - type: number - format: float - default: 0.2 - - name: doubleValue - in: path - required: true - style: simple - explode: false - schema: - type: number - format: double - - name: int64Value - in: path - required: true - style: simple - explode: false - schema: - type: string - format: int64 - - name: uint64Value - in: path - required: true - style: simple - explode: false - schema: - type: string - format: uint64 - - name: int32Value - in: path - required: true - style: simple - explode: false - schema: - type: integer - format: int32 - - name: fixed64Value - in: path - required: true - style: simple - explode: false - schema: - type: string - format: uint64 - - name: fixed32Value - in: path - required: true - style: simple - explode: false - schema: - type: integer - format: int64 - - name: boolValue - in: path - required: true - style: simple - explode: false - schema: - type: boolean - - name: stringValue - in: path - required: true - style: simple - explode: false - schema: - pattern: "strprefix/[^/]+" - type: string - - name: uint32Value - in: path - required: true - style: simple - explode: false - schema: - type: integer - format: int64 - - name: sfixed32Value - in: path - required: true - style: simple - explode: false - schema: - type: integer - format: int32 - - name: sfixed64Value - in: path - required: true - style: simple - explode: false - schema: - type: string - format: int64 - - name: sint32Value - in: path - required: true - style: simple - explode: false - schema: - type: integer - format: int32 - - name: sint64Value - in: path - required: true - style: simple - explode: false - schema: - type: string - format: int64 - - name: nonConventionalNameValue - in: path - required: true - style: simple - explode: false - schema: - type: string - - name: enumValue - in: path - required: true - style: simple - explode: false - schema: - type: string - enum: - - ZERO - - ONE - - name: pathEnumValue - in: path - required: true - style: simple - explode: false - schema: - type: string - enum: - - ABC - - DEF - - name: nestedPathEnumValue - in: path - required: true - style: simple - explode: false - schema: - type: string - enum: - - GHI - - JKL - - name: enumValueAnnotation - in: path - description: Numeric enum description. - required: true - style: simple - explode: false - schema: - type: string - enum: - - ZERO - - ONE - - name: singleNested.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: singleNested.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: singleNested.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: uuid - in: query - required: true - style: form - explode: true - schema: - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - type: string - format: uuid - x-internal: true - x-internal: true - - name: bytesValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: byte - - name: repeatedStringValue - in: query - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: oneofEmpty - in: query - required: false - style: form - explode: true - schema: - type: object - - name: oneofString - in: query - required: false - style: form - explode: true - schema: - type: string - - name: mapValue - in: query - description: map of numeric enum - required: false - style: form - explode: true - schema: {} - - name: mappedStringValue - in: query - description: |- - Map of string title - - Map of string description. - required: false - style: form - explode: true - schema: - type: string - - name: mappedNestedValue - in: query - required: false - style: form - explode: true - schema: {} - - name: timestampValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: date-time - - name: repeatedEnumValue - in: query - description: |- - repeated enum value. it is comma-separated in query - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedEnumAnnotation - in: query - description: |- - Repeated numeric enum title - - Repeated numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedStringAnnotation - in: query - description: |- - Repeated string title - - Repeated string description. - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: nestedAnnotation.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: nestedAnnotation.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: nestedAnnotation.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: int64OverrideType - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: requiredStringViaFieldBehaviorAnnotation - in: query - description: mark a field as required in Open API definition - required: true - style: form - explode: true - schema: - type: string - - name: outputOnlyStringViaFieldBehaviorAnnotation - in: query - description: mark a field as readonly in Open API definition - required: false - style: form - explode: true - schema: - type: string - - name: optionalStringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: productId - in: query - description: |- - Test openapiv2 generation of repeated fields - - Only digits are allowed. - required: false - style: form - explode: true - schema: - type: array - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - - name: optionalStringField - in: query - description: Test openapiv2 generation of required fields with annotation - and jsonschema to reproduce - required: false - style: form - explode: true - schema: - type: string - - name: requiredStringField1 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: requiredStringField2 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: required_field_behavior_json_name_custom - in: query - description: Test openapiv2 handling of required json_name fields - required: true - style: form - explode: true - schema: - type: string - - name: required_field_schema_json_name_custom - in: query - required: true - style: form - explode: true - schema: - type: string - - name: trailingOnly - in: query - description: Trailing only - required: false - style: form - explode: true - schema: - type: string - - name: trailingOnlyDot - in: query - description: Trailing only dot. - required: false - style: form - explode: true - schema: - type: string - - name: trailingBoth - in: query - description: |- - Leading both - - Trailing both. - required: false - style: form - explode: true - schema: - type: string - - name: trailingMultiline - in: query - description: |- - Leading multiline - - This is an example of a multi-line comment. - - Trailing multiline. - required: false - style: form - explode: true - schema: - type: string - - name: uuids - in: query - description: Specify a custom format of repeated field items - required: false - style: form - explode: true - schema: - type: array - items: - type: string - format: uuid - responses: - "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object - "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string - "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - /v1/example/a_bit_of_everything/{uuidName}: - put: - tags: - - ABitOfEverything - operationId: ABitOfEverythingService_Update - parameters: - - name: uuidName - in: path - required: true - style: simple - explode: false - schema: - type: string - format: uuid - x-internal: true - x-internal: true - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverythingServiceUpdateBody" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverythingServiceUpdateBody" - required: true - responses: - "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object - "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object - "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string - "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body - options: - tags: - - ABitOfEverything - operationId: ABitOfEverythingService_CustomOptionsRequest - parameters: - - name: uuidName - in: path - required: true - style: simple - explode: false - schema: - type: string - format: uuid - x-internal: true - x-internal: true - - name: singleNested.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: singleNested.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: singleNested.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: floatValue - in: query - description: Float value field - required: true - style: form - explode: true - schema: - type: number - format: float - default: 0.2 - - name: doubleValue - in: query - required: true - style: form - explode: true - schema: - type: number - format: double - - name: int64Value - in: query - required: true - style: form - explode: true - schema: - type: string - format: int64 - - name: uint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: int32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: fixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: fixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: boolValue - in: query - required: false - style: form - explode: true - schema: - type: boolean - - name: stringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: bytesValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: byte - - name: uint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: enumValue - in: query - description: |2- - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: pathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - ABC - - DEF - default: ABC - - name: nestedPathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - GHI - - JKL - default: GHI - - name: sfixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sfixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: sint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: repeatedStringValue - in: query - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: oneofEmpty - in: query - required: false - style: form - explode: true - schema: - type: object - - name: oneofString - in: query - required: false - style: form - explode: true - schema: - type: string - - name: mapValue - in: query - description: map of numeric enum - required: false - style: form - explode: true - schema: {} - - name: mappedStringValue - in: query - description: |- - Map of string title - - Map of string description. - required: false - style: form - explode: true - schema: - type: string - - name: mappedNestedValue - in: query - required: false - style: form - explode: true - schema: {} - - name: nonConventionalNameValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: timestampValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: date-time - - name: repeatedEnumValue - in: query - description: |- - repeated enum value. it is comma-separated in query - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedEnumAnnotation - in: query - description: |- - Repeated numeric enum title - - Repeated numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: enumValueAnnotation - in: query - description: |- - Numeric enum title - - Numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: repeatedStringAnnotation - in: query - description: |- - Repeated string title - - Repeated string description. - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: nestedAnnotation.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: nestedAnnotation.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: nestedAnnotation.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: int64OverrideType - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: requiredStringViaFieldBehaviorAnnotation - in: query - description: mark a field as required in Open API definition - required: true - style: form - explode: true - schema: - type: string - - name: outputOnlyStringViaFieldBehaviorAnnotation - in: query - description: mark a field as readonly in Open API definition - required: false - style: form - explode: true - schema: - type: string - - name: optionalStringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: productId - in: query - description: |- - Test openapiv2 generation of repeated fields - - Only digits are allowed. - required: false - style: form - explode: true - schema: - type: array - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - - name: optionalStringField - in: query - description: Test openapiv2 generation of required fields with annotation - and jsonschema to reproduce - required: false - style: form - explode: true - schema: - type: string - - name: requiredStringField1 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: requiredStringField2 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: required_field_behavior_json_name_custom - in: query - description: Test openapiv2 handling of required json_name fields - required: true - style: form - explode: true - schema: - type: string - - name: required_field_schema_json_name_custom - in: query - required: true - style: form - explode: true - schema: - type: string - - name: trailingOnly - in: query - description: Trailing only - required: false - style: form - explode: true - schema: - type: string - - name: trailingOnlyDot - in: query - description: Trailing only dot. - required: false - style: form - explode: true - schema: - type: string - - name: trailingBoth - in: query - description: |- - Leading both - - Trailing both. - required: false - style: form - explode: true - schema: - type: string - - name: trailingMultiline - in: query - description: |- - Leading multiline - - This is an example of a multi-line comment. - - Trailing multiline. - required: false - style: form - explode: true - schema: - type: string - - name: uuids - in: query - description: Specify a custom format of repeated field items - required: false - style: form - explode: true - schema: - type: array - items: - type: string - format: uuid + $ref: "#/definitions/examplepbABitOfEverythingServiceUpdateBody" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" + "403": + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} + "404": + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" + "418": + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" + "500": + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - head: + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" + options: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_Exists + - "ABitOfEverything" + operationId: "ABitOfEverythingService_CustomOptionsRequest" parameters: - - name: uuidName - in: path + - name: "uuidName" + in: "path" required: true - style: simple - explode: false - schema: - type: string - format: uuid - x-internal: true + type: "string" + format: "uuid" x-internal: true - - name: singleNested.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: singleNested.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: singleNested.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: floatValue - in: query - description: Float value field - required: true - style: form - explode: true - schema: - type: number - format: float - default: 0.2 - - name: doubleValue - in: query - required: true - style: form - explode: true - schema: - type: number - format: double - - name: int64Value - in: query - required: true - style: form - explode: true - schema: - type: string - format: int64 - - name: uint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: int32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: fixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: fixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: boolValue - in: query - required: false - style: form - explode: true - schema: - type: boolean - - name: stringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: bytesValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: byte - - name: uint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: enumValue - in: query - description: |2- - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: pathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - ABC - - DEF - default: ABC - - name: nestedPathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - GHI - - JKL - default: GHI - - name: sfixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sfixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: sint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: repeatedStringValue - in: query - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: oneofEmpty - in: query - required: false - style: form - explode: true - schema: - type: object - - name: oneofString - in: query - required: false - style: form - explode: true - schema: - type: string - - name: mapValue - in: query - description: map of numeric enum - required: false - style: form - explode: true - schema: {} - - name: mappedStringValue - in: query - description: |- - Map of string title - - Map of string description. - required: false - style: form - explode: true - schema: - type: string - - name: mappedNestedValue - in: query - required: false - style: form - explode: true - schema: {} - - name: nonConventionalNameValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: timestampValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: date-time - - name: repeatedEnumValue - in: query - description: |- - repeated enum value. it is comma-separated in query - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedEnumAnnotation - in: query - description: |- - Repeated numeric enum title - - Repeated numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: enumValueAnnotation - in: query - description: |- - Numeric enum title - - Numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string + x-exportParamName: "UuidName" + - name: "singleNested.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "SingleNestedName" + x-optionalDataType: "String" + - name: "singleNested.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "SingleNestedAmount" + x-optionalDataType: "Int64" + - name: "singleNested.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "SingleNestedOk" + x-optionalDataType: "String" + - name: "floatValue" + in: "query" + description: "Float value field" + required: true + type: "number" + default: 0.2 + format: "float" + x-exportParamName: "FloatValue" + - name: "doubleValue" + in: "query" + required: true + type: "number" + format: "double" + x-exportParamName: "DoubleValue" + - name: "int64Value" + in: "query" + required: true + type: "string" + format: "int64" + x-exportParamName: "Int64Value" + - name: "uint64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Uint64Value" + x-optionalDataType: "String" + - name: "int32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Int32Value" + x-optionalDataType: "Int32" + - name: "fixed64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Fixed64Value" + x-optionalDataType: "String" + - name: "fixed32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Fixed32Value" + x-optionalDataType: "Int64" + - name: "boolValue" + in: "query" + required: false + type: "boolean" + x-exportParamName: "BoolValue" + x-optionalDataType: "Bool" + - name: "stringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "StringValue" + x-optionalDataType: "String" + - name: "bytesValue" + in: "query" + required: false + type: "string" + format: "byte" + x-exportParamName: "BytesValue" + x-optionalDataType: "String" + - name: "uint32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Uint32Value" + x-optionalDataType: "Int64" + - name: "enumValue" + in: "query" + description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValue" + x-optionalDataType: "String" + - name: "pathEnumValue" + in: "query" + required: false + type: "string" + default: "ABC" + enum: + - "ABC" + - "DEF" + x-exportParamName: "PathEnumValue" + x-optionalDataType: "String" + - name: "nestedPathEnumValue" + in: "query" + required: false + type: "string" + default: "GHI" + enum: + - "GHI" + - "JKL" + x-exportParamName: "NestedPathEnumValue" + x-optionalDataType: "String" + - name: "sfixed32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sfixed32Value" + x-optionalDataType: "Int32" + - name: "sfixed64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sfixed64Value" + x-optionalDataType: "String" + - name: "sint32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sint32Value" + x-optionalDataType: "Int32" + - name: "sint64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sint64Value" + x-optionalDataType: "String" + - name: "repeatedStringValue" + in: "query" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringValue" + - name: "oneofEmpty" + in: "query" + required: false + type: "object" + x-exportParamName: "OneofEmpty" + - name: "oneofString" + in: "query" + required: false + type: "string" + x-exportParamName: "OneofString" + x-optionalDataType: "String" + - name: "mapValue" + in: "query" + description: "map of numeric enum" + required: false + x-exportParamName: "MapValue" + - name: "mappedStringValue" + in: "query" + description: "Map of string title\n\nMap of string description." + required: false + type: "string" + x-exportParamName: "MappedStringValue" + x-optionalDataType: "String" + - name: "mappedNestedValue" + in: "query" + required: false + x-exportParamName: "MappedNestedValue" + - name: "nonConventionalNameValue" + in: "query" + required: false + type: "string" + x-exportParamName: "NonConventionalNameValue" + x-optionalDataType: "String" + - name: "timestampValue" + in: "query" + required: false + type: "string" + format: "date-time" + x-exportParamName: "TimestampValue" + x-optionalDataType: "Time" + - name: "repeatedEnumValue" + in: "query" + description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - ZERO - - ONE - default: ZERO - - name: repeatedStringAnnotation - in: query - description: |- - Repeated string title - - Repeated string description. - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: nestedAnnotation.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: nestedAnnotation.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: nestedAnnotation.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumValue" + - name: "repeatedEnumAnnotation" + in: "query" + description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ + \n - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: int64OverrideType - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: requiredStringViaFieldBehaviorAnnotation - in: query - description: mark a field as required in Open API definition - required: true - style: form - explode: true - schema: - type: string - - name: outputOnlyStringViaFieldBehaviorAnnotation - in: query - description: mark a field as readonly in Open API definition - required: false - style: form - explode: true - schema: - type: string - - name: optionalStringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: productId - in: query - description: |- - Test openapiv2 generation of repeated fields - - Only digits are allowed. - required: false - style: form - explode: true - schema: - type: array - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - - name: optionalStringField - in: query - description: Test openapiv2 generation of required fields with annotation - and jsonschema to reproduce - required: false - style: form - explode: true - schema: - type: string - - name: requiredStringField1 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: requiredStringField2 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: required_field_behavior_json_name_custom - in: query - description: Test openapiv2 handling of required json_name fields - required: true - style: form - explode: true - schema: - type: string - - name: required_field_schema_json_name_custom - in: query - required: true - style: form - explode: true - schema: - type: string - - name: trailingOnly - in: query - description: Trailing only - required: false - style: form - explode: true - schema: - type: string - - name: trailingOnlyDot - in: query - description: Trailing only dot. - required: false - style: form - explode: true - schema: - type: string - - name: trailingBoth - in: query - description: |- - Leading both - - Trailing both. - required: false - style: form - explode: true - schema: - type: string - - name: trailingMultiline - in: query - description: |- - Leading multiline - - This is an example of a multi-line comment. - - Trailing multiline. - required: false - style: form - explode: true - schema: - type: string - - name: uuids - in: query - description: Specify a custom format of repeated field items - required: false - style: form - explode: true - schema: - type: array - items: - type: string - format: uuid + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumAnnotation" + - name: "enumValueAnnotation" + in: "query" + description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValueAnnotation" + x-optionalDataType: "String" + - name: "repeatedStringAnnotation" + in: "query" + description: "Repeated string title\n\nRepeated string description." + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringAnnotation" + - name: "nestedAnnotation.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "NestedAnnotationName" + x-optionalDataType: "String" + - name: "nestedAnnotation.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "NestedAnnotationAmount" + x-optionalDataType: "Int64" + - name: "nestedAnnotation.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "NestedAnnotationOk" + x-optionalDataType: "String" + - name: "int64OverrideType" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Int64OverrideType" + x-optionalDataType: "Int64" + - name: "requiredStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as required in Open API definition" + required: true + type: "string" + x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" + - name: "outputOnlyStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as readonly in Open API definition" + required: false + type: "string" + x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" + x-optionalDataType: "String" + - name: "optionalStringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "OptionalStringValue" + x-optionalDataType: "String" + - name: "productId" + in: "query" + description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ + \ are allowed." + required: false + type: "array" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + collectionFormat: "multi" + x-exportParamName: "ProductId" + - name: "optionalStringField" + in: "query" + description: "Test openapiv2 generation of required fields with annotation\ + \ and jsonschema to reproduce" + required: false + type: "string" + x-exportParamName: "OptionalStringField" + x-optionalDataType: "String" + - name: "requiredStringField1" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField1" + - name: "requiredStringField2" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField2" + - name: "required_field_behavior_json_name_custom" + in: "query" + description: "Test openapiv2 handling of required json_name fields" + required: true + type: "string" + x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" + - name: "required_field_schema_json_name_custom" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredFieldSchemaJsonNameCustom" + - name: "trailingOnly" + in: "query" + description: "Trailing only" + required: false + type: "string" + x-exportParamName: "TrailingOnly" + x-optionalDataType: "String" + - name: "trailingOnlyDot" + in: "query" + description: "Trailing only dot." + required: false + type: "string" + x-exportParamName: "TrailingOnlyDot" + x-optionalDataType: "String" + - name: "trailingBoth" + in: "query" + description: "Leading both\n\nTrailing both." + required: false + type: "string" + x-exportParamName: "TrailingBoth" + x-optionalDataType: "String" + - name: "trailingMultiline" + in: "query" + description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ + \nTrailing multiline." + required: false + type: "string" + x-exportParamName: "TrailingMultiline" + x-optionalDataType: "String" + - name: "uuids" + in: "query" + description: "Specify a custom format of repeated field items" + required: false + type: "array" + items: + type: "string" + format: "uuid" + collectionFormat: "multi" + x-exportParamName: "Uuids" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/a_bit_of_everything/{uuidName}:custom: post: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_Custom + - "ABitOfEverything" + operationId: "ABitOfEverythingService_Custom" parameters: - - name: uuidName - in: path + - name: "uuidName" + in: "path" required: true - style: simple - explode: false - schema: - type: string - format: uuid - x-internal: true + type: "string" + format: "uuid" x-internal: true - - name: singleNested.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: singleNested.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: singleNested.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: floatValue - in: query - description: Float value field - required: true - style: form - explode: true - schema: - type: number - format: float - default: 0.2 - - name: doubleValue - in: query - required: true - style: form - explode: true - schema: - type: number - format: double - - name: int64Value - in: query - required: true - style: form - explode: true - schema: - type: string - format: int64 - - name: uint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: int32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: fixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: fixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: boolValue - in: query - required: false - style: form - explode: true - schema: - type: boolean - - name: stringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: bytesValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: byte - - name: uint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: enumValue - in: query - description: |2- - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: pathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - ABC - - DEF - default: ABC - - name: nestedPathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - GHI - - JKL - default: GHI - - name: sfixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sfixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: sint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: repeatedStringValue - in: query - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: oneofEmpty - in: query - required: false - style: form - explode: true - schema: - type: object - - name: oneofString - in: query - required: false - style: form - explode: true - schema: - type: string - - name: mapValue - in: query - description: map of numeric enum - required: false - style: form - explode: true - schema: {} - - name: mappedStringValue - in: query - description: |- - Map of string title - - Map of string description. - required: false - style: form - explode: true - schema: - type: string - - name: mappedNestedValue - in: query - required: false - style: form - explode: true - schema: {} - - name: nonConventionalNameValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: timestampValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: date-time - - name: repeatedEnumValue - in: query - description: |- - repeated enum value. it is comma-separated in query - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedEnumAnnotation - in: query - description: |- - Repeated numeric enum title - - Repeated numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: enumValueAnnotation - in: query - description: |- - Numeric enum title - - Numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string + x-exportParamName: "UuidName" + - name: "singleNested.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "SingleNestedName" + x-optionalDataType: "String" + - name: "singleNested.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "SingleNestedAmount" + x-optionalDataType: "Int64" + - name: "singleNested.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "SingleNestedOk" + x-optionalDataType: "String" + - name: "floatValue" + in: "query" + description: "Float value field" + required: true + type: "number" + default: 0.2 + format: "float" + x-exportParamName: "FloatValue" + - name: "doubleValue" + in: "query" + required: true + type: "number" + format: "double" + x-exportParamName: "DoubleValue" + - name: "int64Value" + in: "query" + required: true + type: "string" + format: "int64" + x-exportParamName: "Int64Value" + - name: "uint64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Uint64Value" + x-optionalDataType: "String" + - name: "int32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Int32Value" + x-optionalDataType: "Int32" + - name: "fixed64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Fixed64Value" + x-optionalDataType: "String" + - name: "fixed32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Fixed32Value" + x-optionalDataType: "Int64" + - name: "boolValue" + in: "query" + required: false + type: "boolean" + x-exportParamName: "BoolValue" + x-optionalDataType: "Bool" + - name: "stringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "StringValue" + x-optionalDataType: "String" + - name: "bytesValue" + in: "query" + required: false + type: "string" + format: "byte" + x-exportParamName: "BytesValue" + x-optionalDataType: "String" + - name: "uint32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Uint32Value" + x-optionalDataType: "Int64" + - name: "enumValue" + in: "query" + description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValue" + x-optionalDataType: "String" + - name: "pathEnumValue" + in: "query" + required: false + type: "string" + default: "ABC" + enum: + - "ABC" + - "DEF" + x-exportParamName: "PathEnumValue" + x-optionalDataType: "String" + - name: "nestedPathEnumValue" + in: "query" + required: false + type: "string" + default: "GHI" + enum: + - "GHI" + - "JKL" + x-exportParamName: "NestedPathEnumValue" + x-optionalDataType: "String" + - name: "sfixed32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sfixed32Value" + x-optionalDataType: "Int32" + - name: "sfixed64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sfixed64Value" + x-optionalDataType: "String" + - name: "sint32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sint32Value" + x-optionalDataType: "Int32" + - name: "sint64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sint64Value" + x-optionalDataType: "String" + - name: "repeatedStringValue" + in: "query" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringValue" + - name: "oneofEmpty" + in: "query" + required: false + type: "object" + x-exportParamName: "OneofEmpty" + - name: "oneofString" + in: "query" + required: false + type: "string" + x-exportParamName: "OneofString" + x-optionalDataType: "String" + - name: "mapValue" + in: "query" + description: "map of numeric enum" + required: false + x-exportParamName: "MapValue" + - name: "mappedStringValue" + in: "query" + description: "Map of string title\n\nMap of string description." + required: false + type: "string" + x-exportParamName: "MappedStringValue" + x-optionalDataType: "String" + - name: "mappedNestedValue" + in: "query" + required: false + x-exportParamName: "MappedNestedValue" + - name: "nonConventionalNameValue" + in: "query" + required: false + type: "string" + x-exportParamName: "NonConventionalNameValue" + x-optionalDataType: "String" + - name: "timestampValue" + in: "query" + required: false + type: "string" + format: "date-time" + x-exportParamName: "TimestampValue" + x-optionalDataType: "Time" + - name: "repeatedEnumValue" + in: "query" + description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - ZERO - - ONE - default: ZERO - - name: repeatedStringAnnotation - in: query - description: |- - Repeated string title - - Repeated string description. - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: nestedAnnotation.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: nestedAnnotation.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: nestedAnnotation.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumValue" + - name: "repeatedEnumAnnotation" + in: "query" + description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ + \n - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: int64OverrideType - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: requiredStringViaFieldBehaviorAnnotation - in: query - description: mark a field as required in Open API definition - required: true - style: form - explode: true - schema: - type: string - - name: outputOnlyStringViaFieldBehaviorAnnotation - in: query - description: mark a field as readonly in Open API definition - required: false - style: form - explode: true - schema: - type: string - - name: optionalStringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: productId - in: query - description: |- - Test openapiv2 generation of repeated fields - - Only digits are allowed. - required: false - style: form - explode: true - schema: - type: array - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - - name: optionalStringField - in: query - description: Test openapiv2 generation of required fields with annotation - and jsonschema to reproduce - required: false - style: form - explode: true - schema: - type: string - - name: requiredStringField1 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: requiredStringField2 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: required_field_behavior_json_name_custom - in: query - description: Test openapiv2 handling of required json_name fields - required: true - style: form - explode: true - schema: - type: string - - name: required_field_schema_json_name_custom - in: query - required: true - style: form - explode: true - schema: - type: string - - name: trailingOnly - in: query - description: Trailing only - required: false - style: form - explode: true - schema: - type: string - - name: trailingOnlyDot - in: query - description: Trailing only dot. - required: false - style: form - explode: true - schema: - type: string - - name: trailingBoth - in: query - description: |- - Leading both - - Trailing both. - required: false - style: form - explode: true - schema: - type: string - - name: trailingMultiline - in: query - description: |- - Leading multiline - - This is an example of a multi-line comment. - - Trailing multiline. - required: false - style: form - explode: true - schema: - type: string - - name: uuids - in: query - description: Specify a custom format of repeated field items - required: false - style: form - explode: true - schema: - type: array - items: - type: string - format: uuid + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumAnnotation" + - name: "enumValueAnnotation" + in: "query" + description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValueAnnotation" + x-optionalDataType: "String" + - name: "repeatedStringAnnotation" + in: "query" + description: "Repeated string title\n\nRepeated string description." + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringAnnotation" + - name: "nestedAnnotation.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "NestedAnnotationName" + x-optionalDataType: "String" + - name: "nestedAnnotation.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "NestedAnnotationAmount" + x-optionalDataType: "Int64" + - name: "nestedAnnotation.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "NestedAnnotationOk" + x-optionalDataType: "String" + - name: "int64OverrideType" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Int64OverrideType" + x-optionalDataType: "Int64" + - name: "requiredStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as required in Open API definition" + required: true + type: "string" + x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" + - name: "outputOnlyStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as readonly in Open API definition" + required: false + type: "string" + x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" + x-optionalDataType: "String" + - name: "optionalStringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "OptionalStringValue" + x-optionalDataType: "String" + - name: "productId" + in: "query" + description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ + \ are allowed." + required: false + type: "array" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + collectionFormat: "multi" + x-exportParamName: "ProductId" + - name: "optionalStringField" + in: "query" + description: "Test openapiv2 generation of required fields with annotation\ + \ and jsonschema to reproduce" + required: false + type: "string" + x-exportParamName: "OptionalStringField" + x-optionalDataType: "String" + - name: "requiredStringField1" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField1" + - name: "requiredStringField2" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField2" + - name: "required_field_behavior_json_name_custom" + in: "query" + description: "Test openapiv2 handling of required json_name fields" + required: true + type: "string" + x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" + - name: "required_field_schema_json_name_custom" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredFieldSchemaJsonNameCustom" + - name: "trailingOnly" + in: "query" + description: "Trailing only" + required: false + type: "string" + x-exportParamName: "TrailingOnly" + x-optionalDataType: "String" + - name: "trailingOnlyDot" + in: "query" + description: "Trailing only dot." + required: false + type: "string" + x-exportParamName: "TrailingOnlyDot" + x-optionalDataType: "String" + - name: "trailingBoth" + in: "query" + description: "Leading both\n\nTrailing both." + required: false + type: "string" + x-exportParamName: "TrailingBoth" + x-optionalDataType: "String" + - name: "trailingMultiline" + in: "query" + description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ + \nTrailing multiline." + required: false + type: "string" + x-exportParamName: "TrailingMultiline" + x-optionalDataType: "String" + - name: "uuids" + in: "query" + description: "Specify a custom format of repeated field items" + required: false + type: "array" + items: + type: "string" + format: "uuid" + collectionFormat: "multi" + x-exportParamName: "Uuids" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverything" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/a_bit_of_everything/{uuidName}:custom:custom: post: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_DoubleColon + - "ABitOfEverything" + operationId: "ABitOfEverythingService_DoubleColon" parameters: - - name: uuidName - in: path - required: true - style: simple - explode: false - schema: - type: string - format: uuid - x-internal: true - x-internal: true - - name: singleNested.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: singleNested.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: singleNested.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: floatValue - in: query - description: Float value field - required: true - style: form - explode: true - schema: - type: number - format: float - default: 0.2 - - name: doubleValue - in: query - required: true - style: form - explode: true - schema: - type: number - format: double - - name: int64Value - in: query - required: true - style: form - explode: true - schema: - type: string - format: int64 - - name: uint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: int32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: fixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: uint64 - - name: fixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: boolValue - in: query - required: false - style: form - explode: true - schema: - type: boolean - - name: stringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: bytesValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: byte - - name: uint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: enumValue - in: query - description: |2- - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: pathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - ABC - - DEF - default: ABC - - name: nestedPathEnumValue - in: query - required: false - style: form - explode: true - schema: - type: string - enum: - - GHI - - JKL - default: GHI - - name: sfixed32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sfixed64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: sint32Value - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int32 - - name: sint64Value - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: repeatedStringValue - in: query - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: oneofEmpty - in: query - required: false - style: form - explode: true - schema: - type: object - - name: oneofString - in: query - required: false - style: form - explode: true - schema: - type: string - - name: mapValue - in: query - description: map of numeric enum - required: false - style: form - explode: true - schema: {} - - name: mappedStringValue - in: query - description: |- - Map of string title - - Map of string description. - required: false - style: form - explode: true - schema: - type: string - - name: mappedNestedValue - in: query - required: false - style: form - explode: true - schema: {} - - name: nonConventionalNameValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: timestampValue - in: query - required: false - style: form - explode: true - schema: - type: string - format: date-time - - name: repeatedEnumValue - in: query - description: |- - repeated enum value. it is comma-separated in query - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: repeatedEnumAnnotation - in: query - description: |- - Repeated numeric enum title - - Repeated numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: enumValueAnnotation - in: query - description: |- - Numeric enum title - - Numeric enum description. - - - ZERO: ZERO means 0 - - ONE: ONE means 1 - required: false - style: form - explode: true - schema: - type: string - enum: - - ZERO - - ONE - default: ZERO - - name: repeatedStringAnnotation - in: query - description: |- - Repeated string title - - Repeated string description. - required: false - style: form - explode: true - schema: - type: array - items: - type: string - - name: nestedAnnotation.name - in: query - description: name is nested field. - required: false - style: form - explode: true - schema: - type: string - - name: nestedAnnotation.amount - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: nestedAnnotation.ok - in: query - description: |- - DeepEnum description. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - required: false - style: form - explode: true - schema: - type: string - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - - name: int64OverrideType - in: query - required: false - style: form - explode: true - schema: - type: integer - format: int64 - - name: requiredStringViaFieldBehaviorAnnotation - in: query - description: mark a field as required in Open API definition - required: true - style: form - explode: true - schema: - type: string - - name: outputOnlyStringViaFieldBehaviorAnnotation - in: query - description: mark a field as readonly in Open API definition - required: false - style: form - explode: true - schema: - type: string - - name: optionalStringValue - in: query - required: false - style: form - explode: true - schema: - type: string - - name: productId - in: query - description: |- - Test openapiv2 generation of repeated fields - - Only digits are allowed. - required: false - style: form - explode: true - schema: - type: array - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - - name: optionalStringField - in: query - description: Test openapiv2 generation of required fields with annotation - and jsonschema to reproduce - required: false - style: form - explode: true - schema: - type: string - - name: requiredStringField1 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: requiredStringField2 - in: query - required: true - style: form - explode: true - schema: - type: string - - name: required_field_behavior_json_name_custom - in: query - description: Test openapiv2 handling of required json_name fields - required: true - style: form - explode: true - schema: - type: string - - name: required_field_schema_json_name_custom - in: query + - name: "uuidName" + in: "path" required: true - style: form - explode: true - schema: - type: string - - name: trailingOnly - in: query - description: Trailing only - required: false - style: form - explode: true - schema: - type: string - - name: trailingOnlyDot - in: query - description: Trailing only dot. - required: false - style: form - explode: true - schema: - type: string - - name: trailingBoth - in: query - description: |- - Leading both - - Trailing both. - required: false - style: form - explode: true - schema: - type: string - - name: trailingMultiline - in: query - description: |- - Leading multiline - - This is an example of a multi-line comment. - - Trailing multiline. - required: false - style: form - explode: true - schema: - type: string - - name: uuids - in: query - description: Specify a custom format of repeated field items - required: false - style: form - explode: true - schema: - type: array - items: - type: string - format: uuid + type: "string" + format: "uuid" + x-internal: true + x-exportParamName: "UuidName" + - name: "singleNested.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "SingleNestedName" + x-optionalDataType: "String" + - name: "singleNested.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "SingleNestedAmount" + x-optionalDataType: "Int64" + - name: "singleNested.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "SingleNestedOk" + x-optionalDataType: "String" + - name: "floatValue" + in: "query" + description: "Float value field" + required: true + type: "number" + default: 0.2 + format: "float" + x-exportParamName: "FloatValue" + - name: "doubleValue" + in: "query" + required: true + type: "number" + format: "double" + x-exportParamName: "DoubleValue" + - name: "int64Value" + in: "query" + required: true + type: "string" + format: "int64" + x-exportParamName: "Int64Value" + - name: "uint64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Uint64Value" + x-optionalDataType: "String" + - name: "int32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Int32Value" + x-optionalDataType: "Int32" + - name: "fixed64Value" + in: "query" + required: false + type: "string" + format: "uint64" + x-exportParamName: "Fixed64Value" + x-optionalDataType: "String" + - name: "fixed32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Fixed32Value" + x-optionalDataType: "Int64" + - name: "boolValue" + in: "query" + required: false + type: "boolean" + x-exportParamName: "BoolValue" + x-optionalDataType: "Bool" + - name: "stringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "StringValue" + x-optionalDataType: "String" + - name: "bytesValue" + in: "query" + required: false + type: "string" + format: "byte" + x-exportParamName: "BytesValue" + x-optionalDataType: "String" + - name: "uint32Value" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Uint32Value" + x-optionalDataType: "Int64" + - name: "enumValue" + in: "query" + description: " - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValue" + x-optionalDataType: "String" + - name: "pathEnumValue" + in: "query" + required: false + type: "string" + default: "ABC" + enum: + - "ABC" + - "DEF" + x-exportParamName: "PathEnumValue" + x-optionalDataType: "String" + - name: "nestedPathEnumValue" + in: "query" + required: false + type: "string" + default: "GHI" + enum: + - "GHI" + - "JKL" + x-exportParamName: "NestedPathEnumValue" + x-optionalDataType: "String" + - name: "sfixed32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sfixed32Value" + x-optionalDataType: "Int32" + - name: "sfixed64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sfixed64Value" + x-optionalDataType: "String" + - name: "sint32Value" + in: "query" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Sint32Value" + x-optionalDataType: "Int32" + - name: "sint64Value" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Sint64Value" + x-optionalDataType: "String" + - name: "repeatedStringValue" + in: "query" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringValue" + - name: "oneofEmpty" + in: "query" + required: false + type: "object" + x-exportParamName: "OneofEmpty" + - name: "oneofString" + in: "query" + required: false + type: "string" + x-exportParamName: "OneofString" + x-optionalDataType: "String" + - name: "mapValue" + in: "query" + description: "map of numeric enum" + required: false + x-exportParamName: "MapValue" + - name: "mappedStringValue" + in: "query" + description: "Map of string title\n\nMap of string description." + required: false + type: "string" + x-exportParamName: "MappedStringValue" + x-optionalDataType: "String" + - name: "mappedNestedValue" + in: "query" + required: false + x-exportParamName: "MappedNestedValue" + - name: "nonConventionalNameValue" + in: "query" + required: false + type: "string" + x-exportParamName: "NonConventionalNameValue" + x-optionalDataType: "String" + - name: "timestampValue" + in: "query" + required: false + type: "string" + format: "date-time" + x-exportParamName: "TimestampValue" + x-optionalDataType: "Time" + - name: "repeatedEnumValue" + in: "query" + description: "repeated enum value. it is comma-separated in query\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" + enum: + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumValue" + - name: "repeatedEnumAnnotation" + in: "query" + description: "Repeated numeric enum title\n\nRepeated numeric enum description.\n\ + \n - ZERO: ZERO means 0\n - ONE: ONE means 1" + required: false + type: "array" + items: + type: "string" + enum: + - "ZERO" + - "ONE" + collectionFormat: "multi" + x-exportParamName: "RepeatedEnumAnnotation" + - name: "enumValueAnnotation" + in: "query" + description: "Numeric enum title\n\nNumeric enum description.\n\n - ZERO:\ + \ ZERO means 0\n - ONE: ONE means 1" + required: false + type: "string" + default: "ZERO" + enum: + - "ZERO" + - "ONE" + x-exportParamName: "EnumValueAnnotation" + x-optionalDataType: "String" + - name: "repeatedStringAnnotation" + in: "query" + description: "Repeated string title\n\nRepeated string description." + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "RepeatedStringAnnotation" + - name: "nestedAnnotation.name" + in: "query" + description: "name is nested field." + required: false + type: "string" + x-exportParamName: "NestedAnnotationName" + x-optionalDataType: "String" + - name: "nestedAnnotation.amount" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "NestedAnnotationAmount" + x-optionalDataType: "Int64" + - name: "nestedAnnotation.ok" + in: "query" + description: "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + required: false + type: "string" + default: "FALSE" + enum: + - "FALSE" + - "TRUE" + x-exportParamName: "NestedAnnotationOk" + x-optionalDataType: "String" + - name: "int64OverrideType" + in: "query" + required: false + type: "integer" + format: "int64" + x-exportParamName: "Int64OverrideType" + x-optionalDataType: "Int64" + - name: "requiredStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as required in Open API definition" + required: true + type: "string" + x-exportParamName: "RequiredStringViaFieldBehaviorAnnotation" + - name: "outputOnlyStringViaFieldBehaviorAnnotation" + in: "query" + description: "mark a field as readonly in Open API definition" + required: false + type: "string" + x-exportParamName: "OutputOnlyStringViaFieldBehaviorAnnotation" + x-optionalDataType: "String" + - name: "optionalStringValue" + in: "query" + required: false + type: "string" + x-exportParamName: "OptionalStringValue" + x-optionalDataType: "String" + - name: "productId" + in: "query" + description: "Test openapiv2 generation of repeated fields\n\nOnly digits\ + \ are allowed." + required: false + type: "array" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + collectionFormat: "multi" + x-exportParamName: "ProductId" + - name: "optionalStringField" + in: "query" + description: "Test openapiv2 generation of required fields with annotation\ + \ and jsonschema to reproduce" + required: false + type: "string" + x-exportParamName: "OptionalStringField" + x-optionalDataType: "String" + - name: "requiredStringField1" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField1" + - name: "requiredStringField2" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredStringField2" + - name: "required_field_behavior_json_name_custom" + in: "query" + description: "Test openapiv2 handling of required json_name fields" + required: true + type: "string" + x-exportParamName: "RequiredFieldBehaviorJsonNameCustom" + - name: "required_field_schema_json_name_custom" + in: "query" + required: true + type: "string" + x-exportParamName: "RequiredFieldSchemaJsonNameCustom" + - name: "trailingOnly" + in: "query" + description: "Trailing only" + required: false + type: "string" + x-exportParamName: "TrailingOnly" + x-optionalDataType: "String" + - name: "trailingOnlyDot" + in: "query" + description: "Trailing only dot." + required: false + type: "string" + x-exportParamName: "TrailingOnlyDot" + x-optionalDataType: "String" + - name: "trailingBoth" + in: "query" + description: "Leading both\n\nTrailing both." + required: false + type: "string" + x-exportParamName: "TrailingBoth" + x-optionalDataType: "String" + - name: "trailingMultiline" + in: "query" + description: "Leading multiline\n\nThis is an example of a multi-line comment.\n\ + \nTrailing multiline." + required: false + type: "string" + x-exportParamName: "TrailingMultiline" + x-optionalDataType: "String" + - name: "uuids" + in: "query" + description: "Specify a custom format of repeated field items" + required: false + type: "array" + items: + type: "string" + format: "uuid" + collectionFormat: "multi" + x-exportParamName: "Uuids" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverything" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/a_bit_of_everything/{uuid}: get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_Lookup + - "ABitOfEverything" + operationId: "ABitOfEverythingService_Lookup" parameters: - - name: uuid - in: path + - name: "uuid" + in: "path" required: true - style: simple - explode: false - schema: - type: string + type: "string" + x-exportParamName: "Uuid" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverything" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" delete: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_Delete + - "ABitOfEverything" + operationId: "ABitOfEverythingService_Delete" parameters: - - name: uuid - in: path + - name: "uuid" + in: "path" required: true - style: simple - explode: false - schema: - type: string + type: "string" + x-exportParamName: "Uuid" + security: + - ApiKeyAuth: [] + OAuth2: + - "read" + - "write" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - security: - - ApiKeyAuth: [] - OAuth2: - - read - - write + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" x-irreversible: true ? /v1/example/a_bit_of_everything_repeated/{pathRepeatedFloatValue}/{pathRepeatedDoubleValue}/{pathRepeatedInt64Value}/{pathRepeatedUint64Value}/{pathRepeatedInt32Value}/{pathRepeatedFixed64Value}/{pathRepeatedFixed32Value}/{pathRepeatedBoolValue}/{pathRepeatedStringValue}/{pathRepeatedBytesValue}/{pathRepeatedUint32Value}/{pathRepeatedEnumValue}/{pathRepeatedSfixed32Value}/{pathRepeatedSfixed64Value}/{pathRepeatedSint32Value}/{pathRepeatedSint64Value} : get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_GetRepeatedQuery + - "ABitOfEverything" + operationId: "ABitOfEverythingService_GetRepeatedQuery" parameters: - - name: pathRepeatedFloatValue - in: path - description: repeated values. they are comma-separated in path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: number - format: float - - name: pathRepeatedDoubleValue - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: number - format: double - - name: pathRepeatedInt64Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: string - format: int64 - - name: pathRepeatedUint64Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: string - format: uint64 - - name: pathRepeatedInt32Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: integer - format: int32 - - name: pathRepeatedFixed64Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: string - format: uint64 - - name: pathRepeatedFixed32Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: integer - format: int64 - - name: pathRepeatedBoolValue - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: boolean - - name: pathRepeatedStringValue - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: string - - name: pathRepeatedBytesValue - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - - name: pathRepeatedUint32Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: integer - format: int64 - - name: pathRepeatedEnumValue - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: string - enum: - - ZERO - - ONE - - name: pathRepeatedSfixed32Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: integer - format: int32 - - name: pathRepeatedSfixed64Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: string - format: int64 - - name: pathRepeatedSint32Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: integer - format: int32 - - name: pathRepeatedSint64Value - in: path - required: true - style: simple - explode: false - schema: - minItems: 1 - type: array - items: - type: string - format: int64 + - name: "pathRepeatedFloatValue" + in: "path" + description: "repeated values. they are comma-separated in path" + required: true + type: "array" + items: + type: "number" + format: "float" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedFloatValue" + - name: "pathRepeatedDoubleValue" + in: "path" + required: true + type: "array" + items: + type: "number" + format: "double" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedDoubleValue" + - name: "pathRepeatedInt64Value" + in: "path" + required: true + type: "array" + items: + type: "string" + format: "int64" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedInt64Value" + - name: "pathRepeatedUint64Value" + in: "path" + required: true + type: "array" + items: + type: "string" + format: "uint64" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedUint64Value" + - name: "pathRepeatedInt32Value" + in: "path" + required: true + type: "array" + items: + type: "integer" + format: "int32" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedInt32Value" + - name: "pathRepeatedFixed64Value" + in: "path" + required: true + type: "array" + items: + type: "string" + format: "uint64" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedFixed64Value" + - name: "pathRepeatedFixed32Value" + in: "path" + required: true + type: "array" + items: + type: "integer" + format: "int64" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedFixed32Value" + - name: "pathRepeatedBoolValue" + in: "path" + required: true + type: "array" + items: + type: "boolean" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedBoolValue" + - name: "pathRepeatedStringValue" + in: "path" + required: true + type: "array" + items: + type: "string" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedStringValue" + - name: "pathRepeatedBytesValue" + in: "path" + required: true + type: "array" + items: + type: "string" + format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedBytesValue" + - name: "pathRepeatedUint32Value" + in: "path" + required: true + type: "array" + items: + type: "integer" + format: "int64" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedUint32Value" + - name: "pathRepeatedEnumValue" + in: "path" + required: true + type: "array" + items: + type: "string" + enum: + - "ZERO" + - "ONE" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedEnumValue" + - name: "pathRepeatedSfixed32Value" + in: "path" + required: true + type: "array" + items: + type: "integer" + format: "int32" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedSfixed32Value" + - name: "pathRepeatedSfixed64Value" + in: "path" + required: true + type: "array" + items: + type: "string" + format: "int64" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedSfixed64Value" + - name: "pathRepeatedSint32Value" + in: "path" + required: true + type: "array" + items: + type: "integer" + format: "int32" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedSint32Value" + - name: "pathRepeatedSint64Value" + in: "path" + required: true + type: "array" + items: + type: "string" + format: "int64" + collectionFormat: "csv" + minItems: 1 + x-exportParamName: "PathRepeatedSint64Value" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverythingRepeated" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverythingRepeated" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverythingRepeated" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/checkStatus: get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_CheckStatus + - "ABitOfEverything" + operationId: "ABitOfEverythingService_CheckStatus" + parameters: [] responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbCheckStatusResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbCheckStatusResponse" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbCheckStatusResponse" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/deep_path/{singleNested.name}: post: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_DeepPathEcho + - "ABitOfEverything" + operationId: "ABitOfEverythingService_DeepPathEcho" parameters: - - name: singleNested.name - in: path - description: name is nested field. + - name: "singleNested.name" + in: "path" + description: "name is nested field." required: true - style: simple - explode: false - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ABitOfEverythingServiceDeepPathEchoBody" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/ABitOfEverythingServiceDeepPathEchoBody" + type: "string" + x-exportParamName: "SingleNestedName" + - in: "body" + name: "body" required: true + schema: + $ref: "#/definitions/ABitOfEverythingServiceDeepPathEchoBody" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbABitOfEverything" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbABitOfEverything" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/oneofenum: post: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_PostOneofEnum - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/oneofenumExampleEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/oneofenumExampleEnum" + - "ABitOfEverything" + operationId: "ABitOfEverythingService_PostOneofEnum" + parameters: + - in: "body" + name: "exampleEnum" required: true + schema: + $ref: "#/definitions/oneofenumExampleEnum" + x-exportParamName: "ExampleEnum" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: exampleEnum + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/requiredmessagetype: post: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_PostRequiredMessageType - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbRequiredMessageTypeRequest" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbRequiredMessageTypeRequest" + - "ABitOfEverything" + operationId: "ABitOfEverythingService_PostRequiredMessageType" + parameters: + - in: "body" + name: "body" required: true + schema: + $ref: "#/definitions/examplepbRequiredMessageTypeRequest" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/snake/{who}/{what}/{where}: get: tags: - - SnakeEnumService - operationId: SnakeEnumService_SnakeEnum + - "SnakeEnumService" + operationId: "SnakeEnumService_SnakeEnum" parameters: - - name: who - in: path - required: true - style: simple - explode: false - schema: - type: string - enum: - - value_e - - value_f - - name: what - in: path - required: true - style: simple - explode: false - schema: - type: string - enum: - - value_c - - value_d - - name: where - in: path - required: true - style: simple - explode: false - schema: - type: string - enum: - - value_x - - value_y + - name: "who" + in: "path" + required: true + type: "string" + enum: + - "value_e" + - "value_f" + x-exportParamName: "Who" + - name: "what" + in: "path" + required: true + type: "string" + enum: + - "value_c" + - "value_d" + x-exportParamName: "What" + - name: "where" + in: "path" + required: true + type: "string" + enum: + - "value_x" + - "value_y" + x-exportParamName: "Where" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSnakeEnumResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbSnakeEnumResponse" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSnakeEnumResponse" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/{book.name}: patch: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_UpdateBook + - "ABitOfEverything" + operationId: "ABitOfEverythingService_UpdateBook" parameters: - - name: book.name - in: path - description: |- - The resource name of the book. - - Format: `publishers/{publisher}/books/{book}` - - Example: `publishers/1257894000000000000/books/my-book` - required: true - style: simple - explode: false - schema: - pattern: "publishers/[^/]+/books/[^/]+" - type: string - - name: allowMissing - in: query - description: |- - If set to true, and the book is not found, a new book will be created. - In this situation, `update_mask` is ignored. - required: false - style: form - explode: true - schema: - type: boolean - requestBody: - description: |- - The book to update. - - The book's `name` field is used to identify the book to be updated. - Format: publishers/{publisher}/books/{book} - content: - application/json: - schema: - $ref: "#/components/schemas/v1_book_name_body" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/v1_book_name_body_1" - required: true + - name: "book.name" + in: "path" + description: "The resource name of the book.\n\nFormat: `publishers/{publisher}/books/{book}`\n\ + \nExample: `publishers/1257894000000000000/books/my-book`" + required: true + type: "string" + pattern: "publishers/[^/]+/books/[^/]+" + x-exportParamName: "BookName" + - in: "body" + name: "book" + description: "The book to update.\n\nThe book's `name` field is used to identify\ + \ the book to be updated.\nFormat: publishers/{publisher}/books/{book}" + required: true + schema: + $ref: "#/definitions/book" + x-exportParamName: "Book" + - name: "allowMissing" + in: "query" + description: "If set to true, and the book is not found, a new book will be\ + \ created.\nIn this situation, `update_mask` is ignored." + required: false + type: "boolean" + x-exportParamName: "AllowMissing" + x-optionalDataType: "Bool" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbBook" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbBook" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbBook" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: book + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/{parent}/books: post: tags: - - ABitOfEverything - summary: Create a book. - operationId: ABitOfEverythingService_CreateBook + - "ABitOfEverything" + summary: "Create a book." + operationId: "ABitOfEverythingService_CreateBook" parameters: - - name: parent - in: path - description: |- - The publisher in which to create the book. - - Format: `publishers/{publisher}` - - Example: `publishers/1257894000000000000` - required: true - style: simple - explode: false - schema: - pattern: "publishers/[^/]+" - type: string - - name: bookId - in: query - description: |- - The ID to use for the book. - - This must start with an alphanumeric character. - required: false - style: form - explode: true - schema: - type: string - requestBody: - description: The book to create. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbBook" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbBook" - required: true + - name: "parent" + in: "path" + description: "The publisher in which to create the book.\n\nFormat: `publishers/{publisher}`\n\ + \nExample: `publishers/1257894000000000000`" + required: true + type: "string" + pattern: "publishers/[^/]+" + x-exportParamName: "Parent" + - in: "body" + name: "book" + description: "The book to create." + required: true + schema: + $ref: "#/definitions/examplepbBook" + x-exportParamName: "Book" + - name: "bookId" + in: "query" + description: "The ID to use for the book.\n\nThis must start with an alphanumeric\ + \ character." + required: false + type: "string" + x-exportParamName: "BookId" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbBook" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbBook" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbBook" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: book + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/example/a_bit_of_everything/{uuidName}: put: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_UpdateV2 + - "ABitOfEverything" + operationId: "ABitOfEverythingService_UpdateV2" parameters: - - name: uuidName - in: path + - name: "uuidName" + in: "path" required: true - style: simple - explode: false - schema: - type: string - format: uuid - x-internal: true + type: "string" + format: "uuid" x-internal: true - - name: updateMask - in: query - description: The paths to update. - required: false - style: form - explode: true - schema: - type: string - requestBody: - description: |- - A bit of everything - - Intentionally complicated message type to cover many features of Protobuf. - content: - application/json: - schema: - $ref: "#/components/schemas/A bit of everything" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/A bit of everything_1" - required: true + x-exportParamName: "UuidName" + - in: "body" + name: "abe" + description: "A bit of everything\n\nIntentionally complicated message type\ + \ to cover many features of Protobuf." + required: true + schema: + $ref: "#/definitions/A bit of everything" + x-exportParamName: "Abe" + - name: "updateMask" + in: "query" + description: "The paths to update." + required: false + type: "string" + x-exportParamName: "UpdateMask" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: abe + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" patch: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_UpdateV22 + - "ABitOfEverything" + operationId: "ABitOfEverythingService_UpdateV22" parameters: - - name: uuidName - in: path + - name: "uuidName" + in: "path" required: true - style: simple - explode: false - schema: - type: string - format: uuid - x-internal: true + type: "string" + format: "uuid" x-internal: true - requestBody: - description: |- - A bit of everything - - Intentionally complicated message type to cover many features of Protobuf. - content: - application/json: - schema: - $ref: "#/components/schemas/A bit of everything_2" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/A bit of everything_3" + x-exportParamName: "UuidName" + - in: "body" + name: "abe" + description: "A bit of everything\n\nIntentionally complicated message type\ + \ to cover many features of Protobuf." required: true + schema: + $ref: "#/definitions/A bit of everything_1" + x-exportParamName: "Abe" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: abe + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/example/echo: get: tags: - - echo rpc + - "echo rpc" summary: "Summary: Echo rpc" - description: Description Echo - externalDocs: - description: Find out more Echo - url: https://github.com/grpc-ecosystem/grpc-gateway - operationId: ABitOfEverythingService_Echo3 + description: "Description Echo" + operationId: "ABitOfEverythingService_Echo3" parameters: - - name: value - in: query + - name: "value" + in: "query" required: false - style: form - explode: true - schema: - type: string + type: "string" + x-exportParamName: "Value" + x-optionalDataType: "String" + externalDocs: + description: "Find out more Echo" + url: "https://github.com/grpc-ecosystem/grpc-gateway" responses: "200": - description: A successful response. - content: + description: "A successful response." + examples: application/json: - schema: - $ref: "#/components/schemas/subStringMessage" - example: - value: the input value - application/x-foo-mime: - schema: - $ref: "#/components/schemas/subStringMessage" + value: "the input value" + schema: + $ref: "#/definitions/subStringMessage" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: integer - format: integer - x-content-type: application/json - application/x-foo-mime: - schema: - type: integer - format: integer + description: "Returned when the resource does not exist." + schema: + type: "integer" + format: "integer" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" "503": - description: Returned when the resource is temporarily unavailable. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the resource is temporarily unavailable." + schema: {} x-number: 100 default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" post: tags: - - echo rpc + - "echo rpc" summary: "Summary: Echo rpc" - description: Description Echo - externalDocs: - description: Find out more Echo - url: https://github.com/grpc-ecosystem/grpc-gateway - operationId: ABitOfEverythingService_Echo2 - requestBody: - content: - application/json: - schema: - type: string - application/x-foo-mime: - schema: - type: string + description: "Description Echo" + operationId: "ABitOfEverythingService_Echo2" + parameters: + - in: "body" + name: "value" required: true + schema: + type: "string" + x-exportParamName: "Value" + externalDocs: + description: "Find out more Echo" + url: "https://github.com/grpc-ecosystem/grpc-gateway" responses: "200": - description: A successful response. - content: + description: "A successful response." + examples: application/json: - schema: - $ref: "#/components/schemas/subStringMessage" - example: - value: the input value - application/x-foo-mime: - schema: - $ref: "#/components/schemas/subStringMessage" + value: "the input value" + schema: + $ref: "#/definitions/subStringMessage" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: integer - format: integer - x-content-type: application/json - application/x-foo-mime: - schema: - type: integer - format: integer + description: "Returned when the resource does not exist." + schema: + type: "integer" + format: "integer" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" "503": - description: Returned when the resource is temporarily unavailable. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the resource is temporarily unavailable." + schema: {} x-number: 100 default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: value + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/example/empty: get: tags: - - camelCaseServiceName - operationId: camelCaseServiceName_Empty + - "camelCaseServiceName" + operationId: "camelCaseServiceName_Empty" + parameters: [] responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/example/errorwithdetails: get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_ErrorWithDetails + - "ABitOfEverything" + operationId: "ABitOfEverythingService_ErrorWithDetails" + parameters: [] responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/example/overwriterequestcontenttype: post: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_OverwriteRequestContentType - requestBody: - content: - application/x-bar-mime: - schema: - $ref: "#/components/schemas/examplepbBody" + - "ABitOfEverything" + operationId: "ABitOfEverythingService_OverwriteRequestContentType" + consumes: + - "application/x-bar-mime" + parameters: + - in: "body" + name: "body" required: true + schema: + $ref: "#/definitions/examplepbBody" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/example/overwriteresponsecontenttype: get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_OverwriteResponseContentType + - "ABitOfEverything" + operationId: "ABitOfEverythingService_OverwriteResponseContentType" + produces: + - "application/text" + parameters: [] responses: "200": - description: A successful response. - content: - application/text: - schema: - type: string - x-content-type: application/text + description: "A successful response." + schema: + type: "string" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/text: - schema: - type: object - x-content-type: application/text + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/text: - schema: - type: string - format: string - x-content-type: application/text + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/text: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/text: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/text: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/example/postwithemptybody/{name}: post: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_PostWithEmptyBody + - "ABitOfEverything" + operationId: "ABitOfEverythingService_PostWithEmptyBody" parameters: - - name: name - in: path + - name: "name" + in: "path" required: true - style: simple - explode: false - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ABitOfEverythingServicePostWithEmptyBodyBody" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/ABitOfEverythingServicePostWithEmptyBodyBody" + type: "string" + x-exportParamName: "Name" + - in: "body" + name: "body" required: true + schema: + $ref: "#/definitions/ABitOfEverythingServicePostWithEmptyBodyBody" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/example/timeout: get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_Timeout + - "ABitOfEverything" + operationId: "ABitOfEverythingService_Timeout" + parameters: [] responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/example/withbody/{id}: post: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_GetMessageWithBody + - "ABitOfEverything" + operationId: "ABitOfEverythingService_GetMessageWithBody" parameters: - - name: id - in: path + - name: "id" + in: "path" required: true - style: simple - explode: false - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbBody" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbBody" + type: "string" + x-exportParamName: "Id" + - in: "body" + name: "data" required: true + schema: + $ref: "#/definitions/examplepbBody" + x-exportParamName: "Data" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: data + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2/{value}:check: get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_CheckExternalPathEnum + - "ABitOfEverything" + operationId: "ABitOfEverythingService_CheckExternalPathEnum" parameters: - - name: value - in: path - required: true - style: simple - explode: false - schema: - type: string - enum: - - ABC - - DEF + - name: "value" + in: "path" + required: true + type: "string" + enum: + - "ABC" + - "DEF" + x-exportParamName: "Value" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v2a/example/a_bit_of_everything/{uuidName}: patch: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_UpdateV23 + - "ABitOfEverything" + operationId: "ABitOfEverythingService_UpdateV23" parameters: - - name: uuidName - in: path + - name: "uuidName" + in: "path" required: true - style: simple - explode: false - schema: - type: string - format: uuid - x-internal: true + type: "string" + format: "uuid" x-internal: true - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ABitOfEverythingServiceUpdateV2Body" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/ABitOfEverythingServiceUpdateV2Body" + x-exportParamName: "UuidName" + - in: "body" + name: "body" required: true + schema: + $ref: "#/definitions/ABitOfEverythingServiceUpdateV2Body" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v3/{value}:check: get: tags: - - ABitOfEverything - operationId: ABitOfEverythingService_CheckExternalNestedPathEnum + - "ABitOfEverything" + operationId: "ABitOfEverythingService_CheckExternalNestedPathEnum" parameters: - - name: value - in: path - required: true - style: simple - explode: false - schema: - type: string - enum: - - GHI - - JKL + - name: "value" + in: "path" + required: true + type: "string" + enum: + - "GHI" + - "JKL" + x-exportParamName: "Value" responses: "200": - description: A successful response. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "A successful response." + schema: + type: "object" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" "418": - description: I'm a teapot. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbNumericEnum" + description: "I'm a teapot." + schema: + $ref: "#/definitions/examplepbNumericEnum" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbErrorResponse" + description: "Server error" + schema: + $ref: "#/definitions/examplepbErrorResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" -components: - schemas: - ABitOfEverythingNested: - type: object - properties: - name: - type: string - description: name is nested field. - amount: - type: integer - format: int64 - ok: - $ref: "#/components/schemas/NestedDeepEnum" - description: Nested is nested type. - example: - ok: "TRUE" - ABitOfEverythingServiceDeepPathEchoBody: - title: A bit of everything - required: - - doubleValue - - floatValue - - int64Value - - requiredStringField1 - - requiredStringField2 - - requiredStringViaFieldBehaviorAnnotation - - required_field_behavior_json_name_custom - - required_field_schema_json_name_custom - - uuid - type: object - properties: - singleNested: - $ref: "#/components/schemas/ABitOfEverythingServiceDeepPathEchoBody_singleNested" - uuid: + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" +securityDefinitions: + ApiKeyAuth: + type: "apiKey" + name: "X-API-Key" + in: "header" + x-amazon-apigateway-authorizer: + authorizerResultTtlInSeconds: 60 + type: "token" + x-amazon-apigateway-authtype: "oauth2" + BasicAuth: + type: "basic" + OAuth2: + type: "oauth2" + authorizationUrl: "https://example.com/oauth/authorize" + tokenUrl: "https://example.com/oauth/token" + flow: "accessCode" + scopes: + admin: "Grants read and write access to administrative information" + read: "Grants read access" + write: "Grants write access" +definitions: + ABitOfEverythingNested: + type: "object" + properties: + name: + type: "string" + description: "name is nested field." + amount: + type: "integer" + format: "int64" + ok: + description: "DeepEnum description." + $ref: "#/definitions/NestedDeepEnum" + description: "Nested is nested type." + example: + ok: "TRUE" + ABitOfEverythingServiceDeepPathEchoBody: + type: "object" + required: + - "doubleValue" + - "floatValue" + - "int64Value" + - "requiredStringField1" + - "requiredStringField2" + - "requiredStringViaFieldBehaviorAnnotation" + - "required_field_behavior_json_name_custom" + - "required_field_schema_json_name_custom" + - "uuid" + properties: + singleNested: + $ref: "#/definitions/ABitOfEverythingServiceDeepPathEchoBody_singleNested" + uuid: + type: "string" + format: "uuid" + minLength: 1 + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + x-internal: true + nested: + type: "array" + items: + $ref: "#/definitions/ABitOfEverythingNested" + floatValue: + type: "number" + format: "float" + description: "Float value field" + default: 0.2 + doubleValue: + type: "number" + format: "double" + int64Value: + type: "string" + format: "int64" + uint64Value: + type: "string" + format: "uint64" + int32Value: + type: "integer" + format: "int32" + fixed64Value: + type: "string" + format: "uint64" + fixed32Value: + type: "integer" + format: "int64" + boolValue: + type: "boolean" + stringValue: + type: "string" + bytesValue: + type: "string" + format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + uint32Value: + type: "integer" + format: "int64" + enumValue: + $ref: "#/definitions/examplepbNumericEnum" + pathEnumValue: + $ref: "#/definitions/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/definitions/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: "integer" + format: "int32" + sfixed64Value: + type: "string" + format: "int64" + sint32Value: + type: "integer" + format: "int32" + sint64Value: + type: "string" + format: "int64" + repeatedStringValue: + type: "array" + items: + type: "string" + oneofEmpty: + type: "object" + properties: {} + oneofString: + type: "string" + mapValue: + type: "object" + title: "map of numeric enum" + additionalProperties: + $ref: "#/definitions/examplepbNumericEnum" + mappedStringValue: + type: "object" + description: "Map of string description." + title: "Map of string title" + additionalProperties: + type: "string" + mappedNestedValue: + type: "object" + additionalProperties: + $ref: "#/definitions/ABitOfEverythingNested" + nonConventionalNameValue: + type: "string" + timestampValue: + type: "string" + format: "date-time" + repeatedEnumValue: + type: "array" + title: "repeated enum value. it is comma-separated in query" + items: + $ref: "#/definitions/examplepbNumericEnum" + repeatedEnumAnnotation: + type: "array" + description: "Repeated numeric enum description." + title: "Repeated numeric enum title" + items: + $ref: "#/definitions/examplepbNumericEnum" + enumValueAnnotation: + description: "Numeric enum description." + title: "Numeric enum title" + $ref: "#/definitions/examplepbNumericEnum" + repeatedStringAnnotation: + type: "array" + description: "Repeated string description." + title: "Repeated string title" + items: + type: "string" + repeatedNestedAnnotation: + type: "array" + description: "Repeated nested object description." + title: "Repeated nested object title" + items: + $ref: "#/definitions/ABitOfEverythingNested" + nestedAnnotation: + description: "Nested object description." + title: "Nested object title" + $ref: "#/definitions/ABitOfEverythingNested" + int64OverrideType: + type: "integer" + format: "int64" + requiredStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as required in Open API definition" + outputOnlyStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as readonly in Open API definition" + readOnly: true + optionalStringValue: + type: "string" + productId: + type: "array" + description: "Only digits are allowed." + title: "Test openapiv2 generation of repeated fields" + items: + type: "string" minLength: 1 - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - type: string - format: uuid - x-internal: true - nested: - type: array - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - floatValue: - type: number - description: Float value field - format: float - default: 0.2 - doubleValue: - type: number - format: double - int64Value: - type: string - format: int64 - uint64Value: - type: string - format: uint64 - int32Value: - type: integer - format: int32 - fixed64Value: - type: string - format: uint64 - fixed32Value: - type: integer - format: int64 - boolValue: - type: boolean - stringValue: - type: string - bytesValue: - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - uint32Value: - type: integer - format: int64 - enumValue: - $ref: "#/components/schemas/examplepbNumericEnum" - pathEnumValue: - $ref: "#/components/schemas/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: integer - format: int32 - sfixed64Value: - type: string - format: int64 - sint32Value: - type: integer - format: int32 - sint64Value: - type: string - format: int64 - repeatedStringValue: - type: array - items: - type: string - oneofEmpty: - type: object - properties: {} - oneofString: - type: string - mapValue: - title: map of numeric enum - type: object - additionalProperties: - $ref: "#/components/schemas/examplepbNumericEnum" - mappedStringValue: - title: Map of string title - type: object - additionalProperties: - type: string - description: Map of string description. - mappedNestedValue: - type: object - additionalProperties: - $ref: "#/components/schemas/ABitOfEverythingNested" - nonConventionalNameValue: - type: string - timestampValue: - type: string - format: date-time - repeatedEnumValue: - title: repeated enum value. it is comma-separated in query - type: array - items: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedEnumAnnotation: - title: Repeated numeric enum title - type: array - description: Repeated numeric enum description. - items: - $ref: "#/components/schemas/examplepbNumericEnum" - enumValueAnnotation: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedStringAnnotation: - title: Repeated string title - type: array - description: Repeated string description. - items: - type: string - repeatedNestedAnnotation: - title: Repeated nested object title - type: array - description: Repeated nested object description. - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - nestedAnnotation: - $ref: "#/components/schemas/ABitOfEverythingNested" - int64OverrideType: - type: integer - format: int64 - requiredStringViaFieldBehaviorAnnotation: - title: mark a field as required in Open API definition - type: string - outputOnlyStringViaFieldBehaviorAnnotation: - title: mark a field as readonly in Open API definition - type: string - readOnly: true - optionalStringValue: - type: string - productId: - title: Test openapiv2 generation of repeated fields - type: array - description: Only digits are allowed. - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - optionalStringField: - title: Test openapiv2 generation of required fields with annotation and - jsonschema to reproduce - type: string - requiredStringField1: - type: string - requiredStringField2: - type: string - required_field_behavior_json_name_custom: - title: Test openapiv2 handling of required json_name fields - type: string - required_field_schema_json_name_custom: - type: string - trailingOnly: - title: Trailing only - type: string - trailingOnlyDot: - type: string - description: Trailing only dot. - trailingBoth: - title: Leading both - type: string - description: Trailing both. - trailingMultiline: - title: Leading multiline - type: string - description: |- - This is an example of a multi-line comment. - - Trailing multiline. - uuids: - title: Specify a custom format of repeated field items - type: array - items: - type: string - format: uuid - description: Intentionally complicated message type to cover many features of - Protobuf. - example: - int64_value: 12 - double_value: 12.3 - externalDocs: - description: Find out more about ABitOfEverything - url: https://github.com/grpc-ecosystem/grpc-gateway - x-a-bit-of-everything-foo: bar - ABitOfEverythingServicePostWithEmptyBodyBody: - type: object - ABitOfEverythingServiceUpdateV2Body: - title: UpdateV2Request request for update includes the message and the update - mask - type: object - properties: - abe: - $ref: "#/components/schemas/A bit of everything_4" - updateMask: - type: string - description: The paths to update. - MessagePathEnumNestedPathEnum: - type: string - enum: - - GHI - - JKL - default: GHI - NestedDeepEnum: - type: string - description: |- - DeepEnum is one or zero. - - - FALSE: FALSE is false. - - TRUE: TRUE is true. - enum: - - "FALSE" - - "TRUE" - default: "FALSE" - examplepbABitOfEverything: - title: A bit of everything - required: - - doubleValue - - floatValue - - int64Value - - requiredStringField1 - - requiredStringField2 - - requiredStringViaFieldBehaviorAnnotation - - required_field_behavior_json_name_custom - - required_field_schema_json_name_custom - - uuid - type: object - properties: - singleNested: - $ref: "#/components/schemas/ABitOfEverythingNested" - uuid: + maxLength: 19 + pattern: "^[0-9]+$" + optionalStringField: + type: "string" + title: "Test openapiv2 generation of required fields with annotation and jsonschema\ + \ to reproduce" + requiredStringField1: + type: "string" + requiredStringField2: + type: "string" + required_field_behavior_json_name_custom: + type: "string" + title: "Test openapiv2 handling of required json_name fields" + required_field_schema_json_name_custom: + type: "string" + trailingOnly: + type: "string" + title: "Trailing only" + trailingOnlyDot: + type: "string" + description: "Trailing only dot." + trailingBoth: + type: "string" + description: "Trailing both." + title: "Leading both" + trailingMultiline: + type: "string" + description: "This is an example of a multi-line comment.\n\nTrailing multiline." + title: "Leading multiline" + uuids: + type: "array" + title: "Specify a custom format of repeated field items" + items: + type: "string" + format: "uuid" + externalDocs: + description: "Find out more about ABitOfEverything" + url: "https://github.com/grpc-ecosystem/grpc-gateway" + title: "A bit of everything" + description: "Intentionally complicated message type to cover many features of\ + \ Protobuf." + example: + int64_value: 12 + double_value: 12.3 + x-a-bit-of-everything-foo: "bar" + ABitOfEverythingServicePostWithEmptyBodyBody: + type: "object" + ABitOfEverythingServiceUpdateV2Body: + type: "object" + properties: + abe: + $ref: "#/definitions/A bit of everything_2" + updateMask: + type: "string" + description: "The paths to update." + title: "UpdateV2Request request for update includes the message and the update\ + \ mask" + example: + abe: "{\"int64_value\":12,\"double_value\":12.3}" + updateMask: "updateMask" + MessagePathEnumNestedPathEnum: + type: "string" + enum: + - "GHI" + - "JKL" + default: "GHI" + NestedDeepEnum: + type: "string" + description: "DeepEnum is one or zero.\n\n - FALSE: FALSE is false.\n - TRUE:\ + \ TRUE is true." + enum: + - "FALSE" + - "TRUE" + default: "FALSE" + examplepbABitOfEverything: + type: "object" + required: + - "doubleValue" + - "floatValue" + - "int64Value" + - "requiredStringField1" + - "requiredStringField2" + - "requiredStringViaFieldBehaviorAnnotation" + - "required_field_behavior_json_name_custom" + - "required_field_schema_json_name_custom" + - "uuid" + properties: + singleNested: + $ref: "#/definitions/ABitOfEverythingNested" + uuid: + type: "string" + format: "uuid" + minLength: 1 + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" + x-internal: true + nested: + type: "array" + items: + $ref: "#/definitions/ABitOfEverythingNested" + floatValue: + type: "number" + format: "float" + description: "Float value field" + default: 0.2 + doubleValue: + type: "number" + format: "double" + int64Value: + type: "string" + format: "int64" + uint64Value: + type: "string" + format: "uint64" + int32Value: + type: "integer" + format: "int32" + fixed64Value: + type: "string" + format: "uint64" + fixed32Value: + type: "integer" + format: "int64" + boolValue: + type: "boolean" + stringValue: + type: "string" + bytesValue: + type: "string" + format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + uint32Value: + type: "integer" + format: "int64" + enumValue: + $ref: "#/definitions/examplepbNumericEnum" + pathEnumValue: + $ref: "#/definitions/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/definitions/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: "integer" + format: "int32" + sfixed64Value: + type: "string" + format: "int64" + sint32Value: + type: "integer" + format: "int32" + sint64Value: + type: "string" + format: "int64" + repeatedStringValue: + type: "array" + items: + type: "string" + oneofEmpty: + type: "object" + properties: {} + oneofString: + type: "string" + mapValue: + type: "object" + title: "map of numeric enum" + additionalProperties: + $ref: "#/definitions/examplepbNumericEnum" + mappedStringValue: + type: "object" + description: "Map of string description." + title: "Map of string title" + additionalProperties: + type: "string" + mappedNestedValue: + type: "object" + additionalProperties: + $ref: "#/definitions/ABitOfEverythingNested" + nonConventionalNameValue: + type: "string" + timestampValue: + type: "string" + format: "date-time" + repeatedEnumValue: + type: "array" + title: "repeated enum value. it is comma-separated in query" + items: + $ref: "#/definitions/examplepbNumericEnum" + repeatedEnumAnnotation: + type: "array" + description: "Repeated numeric enum description." + title: "Repeated numeric enum title" + items: + $ref: "#/definitions/examplepbNumericEnum" + enumValueAnnotation: + description: "Numeric enum description." + title: "Numeric enum title" + $ref: "#/definitions/examplepbNumericEnum" + repeatedStringAnnotation: + type: "array" + description: "Repeated string description." + title: "Repeated string title" + items: + type: "string" + repeatedNestedAnnotation: + type: "array" + description: "Repeated nested object description." + title: "Repeated nested object title" + items: + $ref: "#/definitions/ABitOfEverythingNested" + nestedAnnotation: + description: "Nested object description." + title: "Nested object title" + $ref: "#/definitions/ABitOfEverythingNested" + int64OverrideType: + type: "integer" + format: "int64" + requiredStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as required in Open API definition" + outputOnlyStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as readonly in Open API definition" + readOnly: true + optionalStringValue: + type: "string" + productId: + type: "array" + description: "Only digits are allowed." + title: "Test openapiv2 generation of repeated fields" + items: + type: "string" minLength: 1 - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - type: string - format: uuid - x-internal: true - nested: - type: array - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - floatValue: - type: number - description: Float value field - format: float - default: 0.2 - doubleValue: - type: number - format: double - int64Value: - type: string - format: int64 - uint64Value: - type: string - format: uint64 - int32Value: - type: integer - format: int32 - fixed64Value: - type: string - format: uint64 - fixed32Value: - type: integer - format: int64 - boolValue: - type: boolean - stringValue: - type: string - bytesValue: - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - uint32Value: - type: integer - format: int64 - enumValue: - $ref: "#/components/schemas/examplepbNumericEnum" - pathEnumValue: - $ref: "#/components/schemas/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: integer - format: int32 - sfixed64Value: - type: string - format: int64 - sint32Value: - type: integer - format: int32 - sint64Value: - type: string - format: int64 - repeatedStringValue: - type: array - items: - type: string - oneofEmpty: - type: object - properties: {} - oneofString: - type: string - mapValue: - title: map of numeric enum - type: object - additionalProperties: - $ref: "#/components/schemas/examplepbNumericEnum" - mappedStringValue: - title: Map of string title - type: object - additionalProperties: - type: string - description: Map of string description. - mappedNestedValue: - type: object - additionalProperties: - $ref: "#/components/schemas/ABitOfEverythingNested" - nonConventionalNameValue: - type: string - timestampValue: - type: string - format: date-time - repeatedEnumValue: - title: repeated enum value. it is comma-separated in query - type: array - items: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedEnumAnnotation: - title: Repeated numeric enum title - type: array - description: Repeated numeric enum description. - items: - $ref: "#/components/schemas/examplepbNumericEnum" - enumValueAnnotation: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedStringAnnotation: - title: Repeated string title - type: array - description: Repeated string description. - items: - type: string - repeatedNestedAnnotation: - title: Repeated nested object title - type: array - description: Repeated nested object description. - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - nestedAnnotation: - $ref: "#/components/schemas/ABitOfEverythingNested" - int64OverrideType: - type: integer - format: int64 - requiredStringViaFieldBehaviorAnnotation: - title: mark a field as required in Open API definition - type: string - outputOnlyStringViaFieldBehaviorAnnotation: - title: mark a field as readonly in Open API definition - type: string - readOnly: true - optionalStringValue: - type: string - productId: - title: Test openapiv2 generation of repeated fields - type: array - description: Only digits are allowed. - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - optionalStringField: - title: Test openapiv2 generation of required fields with annotation and - jsonschema to reproduce - type: string - requiredStringField1: - type: string - requiredStringField2: - type: string - required_field_behavior_json_name_custom: - title: Test openapiv2 handling of required json_name fields - type: string - required_field_schema_json_name_custom: - type: string - trailingOnly: - title: Trailing only - type: string - trailingOnlyDot: - type: string - description: Trailing only dot. - trailingBoth: - title: Leading both - type: string - description: Trailing both. - trailingMultiline: - title: Leading multiline - type: string - description: |- - This is an example of a multi-line comment. - - Trailing multiline. - uuids: - title: Specify a custom format of repeated field items - type: array - items: - type: string - format: uuid - description: Intentionally complicated message type to cover many features of - Protobuf. - example: - int64_value: 12 - double_value: 12.3 - externalDocs: - description: Find out more about ABitOfEverything - url: https://github.com/grpc-ecosystem/grpc-gateway - x-a-bit-of-everything-foo: bar - examplepbABitOfEverythingRepeated: - title: ABitOfEverythingRepeated is used to validate repeated path parameter - functionality - type: object - properties: - pathRepeatedFloatValue: - title: repeated values. they are comma-separated in path - type: array - items: - type: number - format: float - pathRepeatedDoubleValue: - type: array - items: - type: number - format: double - pathRepeatedInt64Value: - type: array - items: - type: string - format: int64 - pathRepeatedUint64Value: - type: array - items: - type: string - format: uint64 - pathRepeatedInt32Value: - type: array - items: - type: integer - format: int32 - pathRepeatedFixed64Value: - type: array - items: - type: string - format: uint64 - pathRepeatedFixed32Value: - type: array - items: - type: integer - format: int64 - pathRepeatedBoolValue: - type: array - items: - type: boolean - pathRepeatedStringValue: - type: array - items: - type: string - pathRepeatedBytesValue: - type: array - items: - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - pathRepeatedUint32Value: - type: array - items: - type: integer - format: int64 - pathRepeatedEnumValue: - type: array - items: - $ref: "#/components/schemas/examplepbNumericEnum" - pathRepeatedSfixed32Value: - type: array - items: - type: integer - format: int32 - pathRepeatedSfixed64Value: - type: array - items: - type: string - format: int64 - pathRepeatedSint32Value: - type: array - items: - type: integer - format: int32 - pathRepeatedSint64Value: - type: array - items: - type: string - format: int64 - example: - path_repeated_bool_value: - - true - - true - - false - - true - path_repeated_int32_value: - - 1 - - 2 - - 3 - examplepbABitOfEverythingServiceUpdateBody: - title: A bit of everything - required: - - doubleValue - - floatValue - - int64Value - - requiredStringField1 - - requiredStringField2 - - requiredStringViaFieldBehaviorAnnotation - - required_field_behavior_json_name_custom - - required_field_schema_json_name_custom - type: object - properties: - singleNested: - $ref: "#/components/schemas/ABitOfEverythingNested" - nested: - type: array - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - floatValue: - type: number - description: Float value field - format: float - default: 0.2 - doubleValue: - type: number - format: double - int64Value: - type: string - format: int64 - uint64Value: - type: string - format: uint64 - int32Value: - type: integer - format: int32 - fixed64Value: - type: string - format: uint64 - fixed32Value: - type: integer - format: int64 - boolValue: - type: boolean - stringValue: - type: string - bytesValue: + maxLength: 19 + pattern: "^[0-9]+$" + optionalStringField: + type: "string" + title: "Test openapiv2 generation of required fields with annotation and jsonschema\ + \ to reproduce" + requiredStringField1: + type: "string" + requiredStringField2: + type: "string" + required_field_behavior_json_name_custom: + type: "string" + title: "Test openapiv2 handling of required json_name fields" + required_field_schema_json_name_custom: + type: "string" + trailingOnly: + type: "string" + title: "Trailing only" + trailingOnlyDot: + type: "string" + description: "Trailing only dot." + trailingBoth: + type: "string" + description: "Trailing both." + title: "Leading both" + trailingMultiline: + type: "string" + description: "This is an example of a multi-line comment.\n\nTrailing multiline." + title: "Leading multiline" + uuids: + type: "array" + title: "Specify a custom format of repeated field items" + items: + type: "string" + format: "uuid" + externalDocs: + description: "Find out more about ABitOfEverything" + url: "https://github.com/grpc-ecosystem/grpc-gateway" + title: "A bit of everything" + description: "Intentionally complicated message type to cover many features of\ + \ Protobuf." + example: + int64_value: 12 + double_value: 12.3 + x-a-bit-of-everything-foo: "bar" + examplepbABitOfEverythingRepeated: + type: "object" + properties: + pathRepeatedFloatValue: + type: "array" + title: "repeated values. they are comma-separated in path" + items: + type: "number" + format: "float" + pathRepeatedDoubleValue: + type: "array" + items: + type: "number" + format: "double" + pathRepeatedInt64Value: + type: "array" + items: + type: "string" + format: "int64" + pathRepeatedUint64Value: + type: "array" + items: + type: "string" + format: "uint64" + pathRepeatedInt32Value: + type: "array" + items: + type: "integer" + format: "int32" + pathRepeatedFixed64Value: + type: "array" + items: + type: "string" + format: "uint64" + pathRepeatedFixed32Value: + type: "array" + items: + type: "integer" + format: "int64" + pathRepeatedBoolValue: + type: "array" + items: + type: "boolean" + pathRepeatedStringValue: + type: "array" + items: + type: "string" + pathRepeatedBytesValue: + type: "array" + items: + type: "string" + format: "byte" pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - uint32Value: - type: integer - format: int64 - enumValue: - $ref: "#/components/schemas/examplepbNumericEnum" - pathEnumValue: - $ref: "#/components/schemas/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: integer - format: int32 - sfixed64Value: - type: string - format: int64 - sint32Value: - type: integer - format: int32 - sint64Value: - type: string - format: int64 - repeatedStringValue: - type: array - items: - type: string - oneofEmpty: - type: object - properties: {} - oneofString: - type: string - mapValue: - title: map of numeric enum - type: object - additionalProperties: - $ref: "#/components/schemas/examplepbNumericEnum" - mappedStringValue: - title: Map of string title - type: object - additionalProperties: - type: string - description: Map of string description. - mappedNestedValue: - type: object - additionalProperties: - $ref: "#/components/schemas/ABitOfEverythingNested" - nonConventionalNameValue: - type: string - timestampValue: - type: string - format: date-time - repeatedEnumValue: - title: repeated enum value. it is comma-separated in query - type: array - items: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedEnumAnnotation: - title: Repeated numeric enum title - type: array - description: Repeated numeric enum description. - items: - $ref: "#/components/schemas/examplepbNumericEnum" - enumValueAnnotation: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedStringAnnotation: - title: Repeated string title - type: array - description: Repeated string description. - items: - type: string - repeatedNestedAnnotation: - title: Repeated nested object title - type: array - description: Repeated nested object description. - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - nestedAnnotation: - $ref: "#/components/schemas/ABitOfEverythingNested" - int64OverrideType: - type: integer - format: int64 - requiredStringViaFieldBehaviorAnnotation: - title: mark a field as required in Open API definition - type: string - outputOnlyStringViaFieldBehaviorAnnotation: - title: mark a field as readonly in Open API definition - type: string - readOnly: true - optionalStringValue: - type: string - productId: - title: Test openapiv2 generation of repeated fields - type: array - description: Only digits are allowed. - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - optionalStringField: - title: Test openapiv2 generation of required fields with annotation and - jsonschema to reproduce - type: string - requiredStringField1: - type: string - requiredStringField2: - type: string - required_field_behavior_json_name_custom: - title: Test openapiv2 handling of required json_name fields - type: string - required_field_schema_json_name_custom: - type: string - trailingOnly: - title: Trailing only - type: string - trailingOnlyDot: - type: string - description: Trailing only dot. - trailingBoth: - title: Leading both - type: string - description: Trailing both. - trailingMultiline: - title: Leading multiline - type: string - description: |- - This is an example of a multi-line comment. - - Trailing multiline. - uuids: - title: Specify a custom format of repeated field items - type: array - items: - type: string - format: uuid - description: Intentionally complicated message type to cover many features of - Protobuf. - example: - int64_value: 12 - double_value: 12.3 - externalDocs: - description: Find out more about ABitOfEverything - url: https://github.com/grpc-ecosystem/grpc-gateway - x-a-bit-of-everything-foo: bar - examplepbBar: - required: - - id - type: object - properties: - id: - type: string - examplepbBody: - type: object - properties: - name: - type: string - examplepbBook: - type: object - properties: - name: - type: string - description: |- - The resource name of the book. - - Format: `publishers/{publisher}/books/{book}` - - Example: `publishers/1257894000000000000/books/my-book` - id: - type: string - description: Output only. The book's ID. - readOnly: true - createTime: - type: string - description: Output only. Creation time of the book. - format: date-time - readOnly: true - description: |- - An example resource type from AIP-123 used to test the behavior described in - the CreateBookRequest message. - - See: https://google.aip.dev/123 - example: - createTime: 2000-01-23T04:56:07.000+00:00 - name: name - id: id - examplepbCheckStatusResponse: - type: object - properties: - status: - $ref: "#/components/schemas/rpcStatus" - example: - status: - code: 0 - details: - - key: {} - - key: {} - message: message - examplepbErrorObject: - type: object - properties: - code: - title: code - type: integer - description: Response code - format: integer - message: - title: message - pattern: "^[a-zA-Z0-9]{1, 32}$" - type: string - description: Response message - examplepbErrorResponse: - type: object - properties: - correlationId: - title: x-correlation-id - pattern: "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$" - type: string - description: Unique event identifier for server requests - format: uuid - example: 2438ac3c-37eb-4902-adef-ed16b4431030 - error: - $ref: "#/components/schemas/examplepbErrorObject" - examplepbNumericEnum: - title: NumericEnum - type: string - description: NumericEnum is one or zero. - example: ZERO - externalDocs: - description: Find out more about ABitOfEverything - url: https://github.com/grpc-ecosystem/grpc-gateway - enum: - - ZERO - - ONE - default: ZERO - x-a-bit-of-everything-foo: bar - examplepbRequiredMessageTypeRequest: - title: |- - Required message type -> OpenAPI - https://github.com/grpc-ecosystem/grpc-gateway/issues/2837 - required: - - foo - - id - type: object - properties: - id: - type: string - foo: - $ref: "#/components/schemas/protoexamplepbFoo" - examplepbSnakeEnumResponse: - type: object - examplepbsnake_case_0_enum: - title: |- - Ignoring lint warnings as this enum type exist to validate proper functionality - for projects that don't follow these lint rules. - buf:lint:ignore ENUM_PASCAL_CASE - type: string - description: |- - - value_e: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - - value_f: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - enum: - - value_e - - value_f - default: value_e - examplepbsnake_case_enum: - title: |- - Ignoring lint warnings as this enum type exist to validate proper functionality - for projects that don't follow these lint rules. - buf:lint:ignore ENUM_PASCAL_CASE - type: string - description: |- - - value_c: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - - value_d: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - enum: - - value_c - - value_d - default: value_c - oneofenumExampleEnum: - type: string - enum: - - EXAMPLE_ENUM_UNSPECIFIED - - EXAMPLE_ENUM_FIRST - default: EXAMPLE_ENUM_UNSPECIFIED - pathenumPathEnum: - type: string - enum: - - ABC - - DEF - default: ABC - pathenumsnake_case_for_import: - title: |- - Ignoring lint warnings as this enum type exist to validate proper functionality - for projects that don't follow these lint rules. - buf:lint:ignore ENUM_PASCAL_CASE - type: string - description: |- - - value_x: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - - value_y: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - enum: - - value_x - - value_y - default: value_x - protobufAny: - type: object - properties: - '@type': - type: string - description: |- - A URL/resource name that uniquely identifies the type of the serialized - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must represent - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a canonical form - (e.g., leading "." is not accepted). - - In practice, teams usually precompile into the binary all types that they - expect it to use in the context of Any. However, for URLs which use the - scheme `http`, `https`, or no scheme, one can optionally set up a type - server that maps type URLs to message definitions as follows: - - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the official - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. As of May 2023, there are no widely used type server - implementations and no plans to implement one. - - Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - additionalProperties: - type: object - description: |- - `Any` contains an arbitrary serialized protocol buffer message along with a - URL that describes the type of the serialized message. - - Protobuf library provides support to pack/unpack Any values in the form - of utility functions or additional generated methods of the Any type. - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". - - JSON - ==== - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - x-schema-name: protobufAny - protoexamplepbFoo: - required: - - bar - type: object - properties: - bar: - $ref: "#/components/schemas/examplepbBar" - rpcStatus: - type: object - properties: - code: - type: integer - description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - format: int32 - message: - type: string - description: |- - A developer-facing error message, which should be in English. Any - user-facing error message should be localized and sent in the - [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - details: - type: array - description: |- - A list of messages that carry the error details. There is a common set of - message types for APIs to use. - items: - $ref: "#/components/schemas/protobufAny" - description: |- - The `Status` type defines a logical error model that is suitable for - different programming environments, including REST APIs and RPC APIs. It is - used by [gRPC](https://github.com/grpc). Each `Status` message contains - three pieces of data: error code, error message, and error details. - - You can find out more about this error model and how to work with it in the - [API Design Guide](https://cloud.google.com/apis/design/errors). - example: + pathRepeatedUint32Value: + type: "array" + items: + type: "integer" + format: "int64" + pathRepeatedEnumValue: + type: "array" + items: + $ref: "#/definitions/examplepbNumericEnum" + pathRepeatedSfixed32Value: + type: "array" + items: + type: "integer" + format: "int32" + pathRepeatedSfixed64Value: + type: "array" + items: + type: "string" + format: "int64" + pathRepeatedSint32Value: + type: "array" + items: + type: "integer" + format: "int32" + pathRepeatedSint64Value: + type: "array" + items: + type: "string" + format: "int64" + title: "ABitOfEverythingRepeated is used to validate repeated path parameter functionality" + example: + path_repeated_bool_value: + - true + - true + - false + - true + path_repeated_int32_value: + - 1 + - 2 + - 3 + examplepbABitOfEverythingServiceUpdateBody: + type: "object" + required: + - "doubleValue" + - "floatValue" + - "int64Value" + - "requiredStringField1" + - "requiredStringField2" + - "requiredStringViaFieldBehaviorAnnotation" + - "required_field_behavior_json_name_custom" + - "required_field_schema_json_name_custom" + properties: + singleNested: + $ref: "#/definitions/ABitOfEverythingNested" + nested: + type: "array" + items: + $ref: "#/definitions/ABitOfEverythingNested" + floatValue: + type: "number" + format: "float" + description: "Float value field" + default: 0.2 + doubleValue: + type: "number" + format: "double" + int64Value: + type: "string" + format: "int64" + uint64Value: + type: "string" + format: "uint64" + int32Value: + type: "integer" + format: "int32" + fixed64Value: + type: "string" + format: "uint64" + fixed32Value: + type: "integer" + format: "int64" + boolValue: + type: "boolean" + stringValue: + type: "string" + bytesValue: + type: "string" + format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + uint32Value: + type: "integer" + format: "int64" + enumValue: + $ref: "#/definitions/examplepbNumericEnum" + pathEnumValue: + $ref: "#/definitions/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/definitions/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: "integer" + format: "int32" + sfixed64Value: + type: "string" + format: "int64" + sint32Value: + type: "integer" + format: "int32" + sint64Value: + type: "string" + format: "int64" + repeatedStringValue: + type: "array" + items: + type: "string" + oneofEmpty: + type: "object" + properties: {} + oneofString: + type: "string" + mapValue: + type: "object" + title: "map of numeric enum" + additionalProperties: + $ref: "#/definitions/examplepbNumericEnum" + mappedStringValue: + type: "object" + description: "Map of string description." + title: "Map of string title" + additionalProperties: + type: "string" + mappedNestedValue: + type: "object" + additionalProperties: + $ref: "#/definitions/ABitOfEverythingNested" + nonConventionalNameValue: + type: "string" + timestampValue: + type: "string" + format: "date-time" + repeatedEnumValue: + type: "array" + title: "repeated enum value. it is comma-separated in query" + items: + $ref: "#/definitions/examplepbNumericEnum" + repeatedEnumAnnotation: + type: "array" + description: "Repeated numeric enum description." + title: "Repeated numeric enum title" + items: + $ref: "#/definitions/examplepbNumericEnum" + enumValueAnnotation: + description: "Numeric enum description." + title: "Numeric enum title" + $ref: "#/definitions/examplepbNumericEnum" + repeatedStringAnnotation: + type: "array" + description: "Repeated string description." + title: "Repeated string title" + items: + type: "string" + repeatedNestedAnnotation: + type: "array" + description: "Repeated nested object description." + title: "Repeated nested object title" + items: + $ref: "#/definitions/ABitOfEverythingNested" + nestedAnnotation: + description: "Nested object description." + title: "Nested object title" + $ref: "#/definitions/ABitOfEverythingNested" + int64OverrideType: + type: "integer" + format: "int64" + requiredStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as required in Open API definition" + outputOnlyStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as readonly in Open API definition" + readOnly: true + optionalStringValue: + type: "string" + productId: + type: "array" + description: "Only digits are allowed." + title: "Test openapiv2 generation of repeated fields" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + optionalStringField: + type: "string" + title: "Test openapiv2 generation of required fields with annotation and jsonschema\ + \ to reproduce" + requiredStringField1: + type: "string" + requiredStringField2: + type: "string" + required_field_behavior_json_name_custom: + type: "string" + title: "Test openapiv2 handling of required json_name fields" + required_field_schema_json_name_custom: + type: "string" + trailingOnly: + type: "string" + title: "Trailing only" + trailingOnlyDot: + type: "string" + description: "Trailing only dot." + trailingBoth: + type: "string" + description: "Trailing both." + title: "Leading both" + trailingMultiline: + type: "string" + description: "This is an example of a multi-line comment.\n\nTrailing multiline." + title: "Leading multiline" + uuids: + type: "array" + title: "Specify a custom format of repeated field items" + items: + type: "string" + format: "uuid" + externalDocs: + description: "Find out more about ABitOfEverything" + url: "https://github.com/grpc-ecosystem/grpc-gateway" + title: "A bit of everything" + description: "Intentionally complicated message type to cover many features of\ + \ Protobuf." + example: + int64_value: 12 + double_value: 12.3 + x-a-bit-of-everything-foo: "bar" + examplepbBar: + type: "object" + required: + - "id" + properties: + id: + type: "string" + examplepbBody: + type: "object" + properties: + name: + type: "string" + examplepbBook: + type: "object" + properties: + name: + type: "string" + description: "The resource name of the book.\n\nFormat: `publishers/{publisher}/books/{book}`\n\ + \nExample: `publishers/1257894000000000000/books/my-book`" + id: + type: "string" + description: "Output only. The book's ID." + readOnly: true + createTime: + type: "string" + format: "date-time" + description: "Output only. Creation time of the book." + readOnly: true + description: "An example resource type from AIP-123 used to test the behavior\ + \ described in\nthe CreateBookRequest message.\n\nSee: https://google.aip.dev/123" + example: + createTime: "2000-01-23T04:56:07.000+00:00" + name: "name" + id: "id" + examplepbCheckStatusResponse: + type: "object" + properties: + status: + $ref: "#/definitions/rpcStatus" + example: + status: code: 0 details: - - key: {} - - key: {} - message: message - subStringMessage: - type: object - properties: - value: - type: string - example: - value: value - v1_book_name_body: - type: object - properties: - id: - type: string - description: Output only. The book's ID. - readOnly: true - createTime: - type: string - description: Output only. Creation time of the book. - format: date-time - readOnly: true - description: |- - An example resource type from AIP-123 used to test the behavior described in - the CreateBookRequest message. - - See: https://google.aip.dev/123 - v1_book_name_body_1: - type: object - properties: - id: - type: string - description: Output only. The book's ID. - readOnly: true - createTime: - type: string - description: Output only. Creation time of the book. - format: date-time - readOnly: true - description: |- - An example resource type from AIP-123 used to test the behavior described in - the CreateBookRequest message. - - See: https://google.aip.dev/123 - A bit of everything: - title: A bit of everything - required: - - doubleValue - - floatValue - - int64Value - - requiredStringField1 - - requiredStringField2 - - requiredStringViaFieldBehaviorAnnotation - - required_field_behavior_json_name_custom - - required_field_schema_json_name_custom - type: object - properties: - singleNested: - $ref: "#/components/schemas/ABitOfEverythingNested" - nested: - type: array - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - floatValue: - type: number - description: Float value field - format: float - default: 0.2 - doubleValue: - type: number - format: double - int64Value: - type: string - format: int64 - uint64Value: - type: string - format: uint64 - int32Value: - type: integer - format: int32 - fixed64Value: - type: string - format: uint64 - fixed32Value: - type: integer - format: int64 - boolValue: - type: boolean - stringValue: - type: string - bytesValue: - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - uint32Value: - type: integer - format: int64 - enumValue: - $ref: "#/components/schemas/examplepbNumericEnum" - pathEnumValue: - $ref: "#/components/schemas/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: integer - format: int32 - sfixed64Value: - type: string - format: int64 - sint32Value: - type: integer - format: int32 - sint64Value: - type: string - format: int64 - repeatedStringValue: - type: array - items: - type: string - oneofEmpty: - type: object - properties: {} - oneofString: - type: string - mapValue: - title: map of numeric enum - type: object - additionalProperties: - $ref: "#/components/schemas/examplepbNumericEnum" - mappedStringValue: - title: Map of string title - type: object - additionalProperties: - type: string - description: Map of string description. - mappedNestedValue: - type: object - additionalProperties: - $ref: "#/components/schemas/ABitOfEverythingNested" - nonConventionalNameValue: - type: string - timestampValue: - type: string - format: date-time - repeatedEnumValue: - title: repeated enum value. it is comma-separated in query - type: array - items: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedEnumAnnotation: - title: Repeated numeric enum title - type: array - description: Repeated numeric enum description. - items: - $ref: "#/components/schemas/examplepbNumericEnum" - enumValueAnnotation: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedStringAnnotation: - title: Repeated string title - type: array - description: Repeated string description. - items: - type: string - repeatedNestedAnnotation: - title: Repeated nested object title - type: array - description: Repeated nested object description. - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - nestedAnnotation: - $ref: "#/components/schemas/ABitOfEverythingNested" - int64OverrideType: - type: integer - format: int64 - requiredStringViaFieldBehaviorAnnotation: - title: mark a field as required in Open API definition - type: string - outputOnlyStringViaFieldBehaviorAnnotation: - title: mark a field as readonly in Open API definition - type: string - readOnly: true - optionalStringValue: - type: string - productId: - title: Test openapiv2 generation of repeated fields - type: array - description: Only digits are allowed. - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - optionalStringField: - title: Test openapiv2 generation of required fields with annotation and - jsonschema to reproduce - type: string - requiredStringField1: - type: string - requiredStringField2: - type: string - required_field_behavior_json_name_custom: - title: Test openapiv2 handling of required json_name fields - type: string - required_field_schema_json_name_custom: - type: string - trailingOnly: - title: Trailing only - type: string - trailingOnlyDot: - type: string - description: Trailing only dot. - trailingBoth: - title: Leading both - type: string - description: Trailing both. - trailingMultiline: - title: Leading multiline - type: string - description: |- - This is an example of a multi-line comment. - - Trailing multiline. - uuids: - title: Specify a custom format of repeated field items - type: array - items: - type: string - format: uuid - description: Intentionally complicated message type to cover many features of - Protobuf. - example: - int64_value: 12 - double_value: 12.3 - externalDocs: - description: Find out more about ABitOfEverything - url: https://github.com/grpc-ecosystem/grpc-gateway - x-a-bit-of-everything-foo: bar - A bit of everything_1: - title: A bit of everything - required: - - doubleValue - - floatValue - - int64Value - - requiredStringField1 - - requiredStringField2 - - requiredStringViaFieldBehaviorAnnotation - - required_field_behavior_json_name_custom - - required_field_schema_json_name_custom - type: object - properties: - singleNested: - $ref: "#/components/schemas/ABitOfEverythingNested" - nested: - type: array - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - floatValue: - type: number - description: Float value field - format: float - default: 0.2 - doubleValue: - type: number - format: double - int64Value: - type: string - format: int64 - uint64Value: - type: string - format: uint64 - int32Value: - type: integer - format: int32 - fixed64Value: - type: string - format: uint64 - fixed32Value: - type: integer - format: int64 - boolValue: - type: boolean - stringValue: - type: string - bytesValue: - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - uint32Value: - type: integer - format: int64 - enumValue: - $ref: "#/components/schemas/examplepbNumericEnum" - pathEnumValue: - $ref: "#/components/schemas/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: integer - format: int32 - sfixed64Value: - type: string - format: int64 - sint32Value: - type: integer - format: int32 - sint64Value: - type: string - format: int64 - repeatedStringValue: - type: array - items: - type: string - oneofEmpty: - type: object - properties: {} - oneofString: - type: string - mapValue: - title: map of numeric enum - type: object - additionalProperties: - $ref: "#/components/schemas/examplepbNumericEnum" - mappedStringValue: - title: Map of string title - type: object - additionalProperties: - type: string - description: Map of string description. - mappedNestedValue: - type: object - additionalProperties: - $ref: "#/components/schemas/ABitOfEverythingNested" - nonConventionalNameValue: - type: string - timestampValue: - type: string - format: date-time - repeatedEnumValue: - title: repeated enum value. it is comma-separated in query - type: array - items: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedEnumAnnotation: - title: Repeated numeric enum title - type: array - description: Repeated numeric enum description. - items: - $ref: "#/components/schemas/examplepbNumericEnum" - enumValueAnnotation: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedStringAnnotation: - title: Repeated string title - type: array - description: Repeated string description. - items: - type: string - repeatedNestedAnnotation: - title: Repeated nested object title - type: array - description: Repeated nested object description. - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - nestedAnnotation: - $ref: "#/components/schemas/ABitOfEverythingNested" - int64OverrideType: - type: integer - format: int64 - requiredStringViaFieldBehaviorAnnotation: - title: mark a field as required in Open API definition - type: string - outputOnlyStringViaFieldBehaviorAnnotation: - title: mark a field as readonly in Open API definition - type: string - readOnly: true - optionalStringValue: - type: string - productId: - title: Test openapiv2 generation of repeated fields - type: array - description: Only digits are allowed. - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - optionalStringField: - title: Test openapiv2 generation of required fields with annotation and - jsonschema to reproduce - type: string - requiredStringField1: - type: string - requiredStringField2: - type: string - required_field_behavior_json_name_custom: - title: Test openapiv2 handling of required json_name fields - type: string - required_field_schema_json_name_custom: - type: string - trailingOnly: - title: Trailing only - type: string - trailingOnlyDot: - type: string - description: Trailing only dot. - trailingBoth: - title: Leading both - type: string - description: Trailing both. - trailingMultiline: - title: Leading multiline - type: string - description: |- - This is an example of a multi-line comment. - - Trailing multiline. - uuids: - title: Specify a custom format of repeated field items - type: array - items: - type: string - format: uuid - description: Intentionally complicated message type to cover many features of - Protobuf. - example: - int64_value: 12 - double_value: 12.3 - externalDocs: - description: Find out more about ABitOfEverything - url: https://github.com/grpc-ecosystem/grpc-gateway - x-a-bit-of-everything-foo: bar - A bit of everything_2: - title: A bit of everything - required: - - doubleValue - - floatValue - - int64Value - - requiredStringField1 - - requiredStringField2 - - requiredStringViaFieldBehaviorAnnotation - - required_field_behavior_json_name_custom - - required_field_schema_json_name_custom - type: object - properties: - singleNested: - $ref: "#/components/schemas/ABitOfEverythingNested" - nested: - type: array - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - floatValue: - type: number - description: Float value field - format: float - default: 0.2 - doubleValue: - type: number - format: double - int64Value: - type: string - format: int64 - uint64Value: - type: string - format: uint64 - int32Value: - type: integer - format: int32 - fixed64Value: - type: string - format: uint64 - fixed32Value: - type: integer - format: int64 - boolValue: - type: boolean - stringValue: - type: string - bytesValue: - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - uint32Value: - type: integer - format: int64 - enumValue: - $ref: "#/components/schemas/examplepbNumericEnum" - pathEnumValue: - $ref: "#/components/schemas/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: integer - format: int32 - sfixed64Value: - type: string - format: int64 - sint32Value: - type: integer - format: int32 - sint64Value: - type: string - format: int64 - repeatedStringValue: - type: array - items: - type: string - oneofEmpty: - type: object - properties: {} - oneofString: - type: string - mapValue: - title: map of numeric enum - type: object - additionalProperties: - $ref: "#/components/schemas/examplepbNumericEnum" - mappedStringValue: - title: Map of string title - type: object - additionalProperties: - type: string - description: Map of string description. - mappedNestedValue: - type: object - additionalProperties: - $ref: "#/components/schemas/ABitOfEverythingNested" - nonConventionalNameValue: - type: string - timestampValue: - type: string - format: date-time - repeatedEnumValue: - title: repeated enum value. it is comma-separated in query - type: array - items: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedEnumAnnotation: - title: Repeated numeric enum title - type: array - description: Repeated numeric enum description. - items: - $ref: "#/components/schemas/examplepbNumericEnum" - enumValueAnnotation: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedStringAnnotation: - title: Repeated string title - type: array - description: Repeated string description. - items: - type: string - repeatedNestedAnnotation: - title: Repeated nested object title - type: array - description: Repeated nested object description. - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - nestedAnnotation: - $ref: "#/components/schemas/ABitOfEverythingNested" - int64OverrideType: - type: integer - format: int64 - requiredStringViaFieldBehaviorAnnotation: - title: mark a field as required in Open API definition - type: string - outputOnlyStringViaFieldBehaviorAnnotation: - title: mark a field as readonly in Open API definition - type: string - readOnly: true - optionalStringValue: - type: string - productId: - title: Test openapiv2 generation of repeated fields - type: array - description: Only digits are allowed. - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - optionalStringField: - title: Test openapiv2 generation of required fields with annotation and - jsonschema to reproduce - type: string - requiredStringField1: - type: string - requiredStringField2: - type: string - required_field_behavior_json_name_custom: - title: Test openapiv2 handling of required json_name fields - type: string - required_field_schema_json_name_custom: - type: string - trailingOnly: - title: Trailing only - type: string - trailingOnlyDot: - type: string - description: Trailing only dot. - trailingBoth: - title: Leading both - type: string - description: Trailing both. - trailingMultiline: - title: Leading multiline - type: string - description: |- - This is an example of a multi-line comment. - - Trailing multiline. - uuids: - title: Specify a custom format of repeated field items - type: array - items: - type: string - format: uuid - description: Intentionally complicated message type to cover many features of - Protobuf. - example: - int64_value: 12 - double_value: 12.3 - externalDocs: - description: Find out more about ABitOfEverything - url: https://github.com/grpc-ecosystem/grpc-gateway - x-a-bit-of-everything-foo: bar - A bit of everything_3: - title: A bit of everything - required: - - doubleValue - - floatValue - - int64Value - - requiredStringField1 - - requiredStringField2 - - requiredStringViaFieldBehaviorAnnotation - - required_field_behavior_json_name_custom - - required_field_schema_json_name_custom - type: object - properties: - singleNested: - $ref: "#/components/schemas/ABitOfEverythingNested" - nested: - type: array - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - floatValue: - type: number - description: Float value field - format: float - default: 0.2 - doubleValue: - type: number - format: double - int64Value: - type: string - format: int64 - uint64Value: - type: string - format: uint64 - int32Value: - type: integer - format: int32 - fixed64Value: - type: string - format: uint64 - fixed32Value: - type: integer - format: int64 - boolValue: - type: boolean - stringValue: - type: string - bytesValue: - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - uint32Value: - type: integer - format: int64 - enumValue: - $ref: "#/components/schemas/examplepbNumericEnum" - pathEnumValue: - $ref: "#/components/schemas/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: integer - format: int32 - sfixed64Value: - type: string - format: int64 - sint32Value: - type: integer - format: int32 - sint64Value: - type: string - format: int64 - repeatedStringValue: - type: array - items: - type: string - oneofEmpty: - type: object - properties: {} - oneofString: - type: string - mapValue: - title: map of numeric enum - type: object - additionalProperties: - $ref: "#/components/schemas/examplepbNumericEnum" - mappedStringValue: - title: Map of string title - type: object - additionalProperties: - type: string - description: Map of string description. - mappedNestedValue: - type: object - additionalProperties: - $ref: "#/components/schemas/ABitOfEverythingNested" - nonConventionalNameValue: - type: string - timestampValue: - type: string - format: date-time - repeatedEnumValue: - title: repeated enum value. it is comma-separated in query - type: array - items: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedEnumAnnotation: - title: Repeated numeric enum title - type: array - description: Repeated numeric enum description. - items: - $ref: "#/components/schemas/examplepbNumericEnum" - enumValueAnnotation: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedStringAnnotation: - title: Repeated string title - type: array - description: Repeated string description. - items: - type: string - repeatedNestedAnnotation: - title: Repeated nested object title - type: array - description: Repeated nested object description. - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - nestedAnnotation: - $ref: "#/components/schemas/ABitOfEverythingNested" - int64OverrideType: - type: integer - format: int64 - requiredStringViaFieldBehaviorAnnotation: - title: mark a field as required in Open API definition - type: string - outputOnlyStringViaFieldBehaviorAnnotation: - title: mark a field as readonly in Open API definition - type: string - readOnly: true - optionalStringValue: - type: string - productId: - title: Test openapiv2 generation of repeated fields - type: array - description: Only digits are allowed. - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - optionalStringField: - title: Test openapiv2 generation of required fields with annotation and - jsonschema to reproduce - type: string - requiredStringField1: - type: string - requiredStringField2: - type: string - required_field_behavior_json_name_custom: - title: Test openapiv2 handling of required json_name fields - type: string - required_field_schema_json_name_custom: - type: string - trailingOnly: - title: Trailing only - type: string - trailingOnlyDot: - type: string - description: Trailing only dot. - trailingBoth: - title: Leading both - type: string - description: Trailing both. - trailingMultiline: - title: Leading multiline - type: string - description: |- - This is an example of a multi-line comment. - - Trailing multiline. - uuids: - title: Specify a custom format of repeated field items - type: array - items: - type: string - format: uuid - description: Intentionally complicated message type to cover many features of - Protobuf. - example: - int64_value: 12 - double_value: 12.3 - externalDocs: - description: Find out more about ABitOfEverything - url: https://github.com/grpc-ecosystem/grpc-gateway - x-a-bit-of-everything-foo: bar - ABitOfEverythingServiceDeepPathEchoBody_singleNested: - type: object - properties: - amount: - type: integer - format: int64 - ok: - $ref: "#/components/schemas/NestedDeepEnum" - description: Nested is nested type. - example: "{\"ok\":\"TRUE\"}" - A bit of everything_4: - title: A bit of everything - type: object - properties: - singleNested: - $ref: "#/components/schemas/ABitOfEverythingNested" - nested: - type: array - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - floatValue: - type: number - description: Float value field - format: float - default: 0.2 - doubleValue: - type: number - format: double - int64Value: - type: string - format: int64 - uint64Value: - type: string - format: uint64 - int32Value: - type: integer - format: int32 - fixed64Value: - type: string - format: uint64 - fixed32Value: - type: integer - format: int64 - boolValue: - type: boolean - stringValue: - type: string - bytesValue: - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - format: byte - uint32Value: - type: integer - format: int64 - enumValue: - $ref: "#/components/schemas/examplepbNumericEnum" - pathEnumValue: - $ref: "#/components/schemas/pathenumPathEnum" - nestedPathEnumValue: - $ref: "#/components/schemas/MessagePathEnumNestedPathEnum" - sfixed32Value: - type: integer - format: int32 - sfixed64Value: - type: string - format: int64 - sint32Value: - type: integer - format: int32 - sint64Value: - type: string - format: int64 - repeatedStringValue: - type: array - items: - type: string - oneofEmpty: - type: object - properties: {} - oneofString: - type: string - mapValue: - title: map of numeric enum - type: object - additionalProperties: - $ref: "#/components/schemas/examplepbNumericEnum" - mappedStringValue: - title: Map of string title - type: object - additionalProperties: - type: string - description: Map of string description. - mappedNestedValue: - type: object - additionalProperties: - $ref: "#/components/schemas/ABitOfEverythingNested" - nonConventionalNameValue: - type: string - timestampValue: - type: string - format: date-time - repeatedEnumValue: - title: repeated enum value. it is comma-separated in query - type: array - items: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedEnumAnnotation: - title: Repeated numeric enum title - type: array - description: Repeated numeric enum description. - items: - $ref: "#/components/schemas/examplepbNumericEnum" - enumValueAnnotation: - $ref: "#/components/schemas/examplepbNumericEnum" - repeatedStringAnnotation: - title: Repeated string title - type: array - description: Repeated string description. - items: - type: string - repeatedNestedAnnotation: - title: Repeated nested object title - type: array - description: Repeated nested object description. - items: - $ref: "#/components/schemas/ABitOfEverythingNested" - nestedAnnotation: - $ref: "#/components/schemas/ABitOfEverythingNested" - int64OverrideType: - type: integer - format: int64 - requiredStringViaFieldBehaviorAnnotation: - title: mark a field as required in Open API definition - type: string - outputOnlyStringViaFieldBehaviorAnnotation: - title: mark a field as readonly in Open API definition - type: string - readOnly: true - optionalStringValue: - type: string - productId: - title: Test openapiv2 generation of repeated fields - type: array - description: Only digits are allowed. - items: - maxLength: 19 - minLength: 1 - pattern: "^[0-9]+$" - type: string - optionalStringField: - title: Test openapiv2 generation of required fields with annotation and - jsonschema to reproduce - type: string - requiredStringField1: - type: string - requiredStringField2: - type: string - required_field_behavior_json_name_custom: - title: Test openapiv2 handling of required json_name fields - type: string - required_field_schema_json_name_custom: - type: string - trailingOnly: - title: Trailing only - type: string - trailingOnlyDot: - type: string - description: Trailing only dot. - trailingBoth: - title: Leading both - type: string - description: Trailing both. - trailingMultiline: - title: Leading multiline - type: string - description: |- - This is an example of a multi-line comment. - - Trailing multiline. - uuids: - title: Specify a custom format of repeated field items - type: array - items: - type: string - format: uuid - description: Intentionally complicated message type to cover many features of - Protobuf. - example: "{\"int64_value\":12,\"double_value\":12.3}" - securitySchemes: - ApiKeyAuth: - type: apiKey - name: X-API-Key - in: header - x-amazon-apigateway-authorizer: - authorizerResultTtlInSeconds: 60 - type: token - x-amazon-apigateway-authtype: oauth2 - BasicAuth: - type: http - scheme: basic - OAuth2: - type: oauth2 - flows: - authorizationCode: - authorizationUrl: https://example.com/oauth/authorize - tokenUrl: https://example.com/oauth/token - scopes: - admin: Grants read and write access to administrative information - read: Grants read access - write: Grants write access + - '@type': "@type" + - '@type': "@type" + message: "message" + examplepbErrorObject: + type: "object" + properties: + code: + type: "integer" + format: "integer" + description: "Response code" + title: "code" + message: + type: "string" + description: "Response message" + title: "message" + pattern: "^[a-zA-Z0-9]{1, 32}$" + examplepbErrorResponse: + type: "object" + properties: + correlationId: + type: "string" + format: "uuid" + example: "2438ac3c-37eb-4902-adef-ed16b4431030" + description: "Unique event identifier for server requests" + title: "x-correlation-id" + pattern: "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$" + error: + $ref: "#/definitions/examplepbErrorObject" + examplepbNumericEnum: + type: "string" + externalDocs: + description: "Find out more about ABitOfEverything" + url: "https://github.com/grpc-ecosystem/grpc-gateway" + title: "NumericEnum" + description: "NumericEnum is one or zero." + example: "ZERO" + enum: + - "ZERO" + - "ONE" + default: "ZERO" + x-a-bit-of-everything-foo: "bar" + examplepbRequiredMessageTypeRequest: + type: "object" + required: + - "foo" + - "id" + properties: + id: + type: "string" + foo: + $ref: "#/definitions/protoexamplepbFoo" + title: "Required message type -> OpenAPI\nhttps://github.com/grpc-ecosystem/grpc-gateway/issues/2837" + examplepbSnakeEnumResponse: + type: "object" + examplepbsnake_case_0_enum: + type: "string" + title: "Ignoring lint warnings as this enum type exist to validate proper functionality\n\ + for projects that don't follow these lint rules.\nbuf:lint:ignore ENUM_PASCAL_CASE" + description: "- value_e: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n - value_f:\ + \ buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE" + enum: + - "value_e" + - "value_f" + default: "value_e" + examplepbsnake_case_enum: + type: "string" + title: "Ignoring lint warnings as this enum type exist to validate proper functionality\n\ + for projects that don't follow these lint rules.\nbuf:lint:ignore ENUM_PASCAL_CASE" + description: "- value_c: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n - value_d:\ + \ buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE" + enum: + - "value_c" + - "value_d" + default: "value_c" + oneofenumExampleEnum: + type: "string" + enum: + - "EXAMPLE_ENUM_UNSPECIFIED" + - "EXAMPLE_ENUM_FIRST" + default: "EXAMPLE_ENUM_UNSPECIFIED" + pathenumPathEnum: + type: "string" + enum: + - "ABC" + - "DEF" + default: "ABC" + pathenumsnake_case_for_import: + type: "string" + title: "Ignoring lint warnings as this enum type exist to validate proper functionality\n\ + for projects that don't follow these lint rules.\nbuf:lint:ignore ENUM_PASCAL_CASE" + description: "- value_x: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n - value_y:\ + \ buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE" + enum: + - "value_x" + - "value_y" + default: "value_x" + protobufAny: + type: "object" + properties: + '@type': + type: "string" + description: "A URL/resource name that uniquely identifies the type of the\ + \ serialized\nprotocol buffer message. This string must contain at least\n\ + one \"/\" character. The last segment of the URL's path must represent\n\ + the fully qualified name of the type (as in\n`path/google.protobuf.Duration`).\ + \ The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\ + \nIn practice, teams usually precompile into the binary all types that they\n\ + expect it to use in the context of Any. However, for URLs which use the\n\ + scheme `http`, `https`, or no scheme, one can optionally set up a type\n\ + server that maps type URLs to message definitions as follows:\n\n* If no\ + \ scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must\ + \ yield a [google.protobuf.Type][]\n value in binary format, or produce\ + \ an error.\n* Applications are allowed to cache lookup results based on\ + \ the\n URL, or have them precompiled into a binary to avoid any\n lookup.\ + \ Therefore, binary compatibility needs to be preserved\n on changes to\ + \ types. (Use versioned type names to manage\n breaking changes.)\n\nNote:\ + \ this functionality is not currently available in the official\nprotobuf\ + \ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\ + \ As of May 2023, there are no widely used type server\nimplementations\ + \ and no plans to implement one.\n\nSchemes other than `http`, `https` (or\ + \ the empty scheme) might be\nused with implementation specific semantics." + description: "`Any` contains an arbitrary serialized protocol buffer message along\ + \ with a\nURL that describes the type of the serialized message.\n\nProtobuf\ + \ library provides support to pack/unpack Any values in the form\nof utility\ + \ functions or additional generated methods of the Any type.\n\nExample 1: Pack\ + \ and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n\ + \ ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack\ + \ and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n\ + \ ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n\ + \ }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n\ + \ foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack\ + \ and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n \ + \ any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n\ + \ ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n\ + \ any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n\ + \ ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err !=\ + \ nil {\n ...\n }\n\nThe pack methods provided by protobuf library\ + \ will by default use\n'type.googleapis.com/full.type.name' as the type URL\ + \ and the unpack\nmethods only use the fully qualified type name after the last\ + \ '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\ + name \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses\ + \ the regular\nrepresentation of the deserialized, embedded message, with an\n\ + additional field `@type` which contains the type URL. Example:\n\n package\ + \ google.profile;\n message Person {\n string first_name = 1;\n \ + \ string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\ + ,\n \"firstName\": ,\n \"lastName\": \n }\n\nIf\ + \ the embedded message type is well-known and has a custom JSON\nrepresentation,\ + \ that representation will be embedded adding a field\n`value` which holds the\ + \ custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\ + \n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n\ + \ \"value\": \"1.212s\"\n }" + example: + '@type': "@type" + additionalProperties: {} + protoexamplepbFoo: + type: "object" + required: + - "bar" + properties: + bar: + $ref: "#/definitions/examplepbBar" + rpcStatus: + type: "object" + properties: + code: + type: "integer" + format: "int32" + description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." + message: + type: "string" + description: "A developer-facing error message, which should be in English.\ + \ Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details]\ + \ field, or localized by the client." + details: + type: "array" + description: "A list of messages that carry the error details. There is a\ + \ common set of\nmessage types for APIs to use." + items: + $ref: "#/definitions/protobufAny" + description: "The `Status` type defines a logical error model that is suitable\ + \ for\ndifferent programming environments, including REST APIs and RPC APIs.\ + \ It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\n\ + three pieces of data: error code, error message, and error details.\n\nYou can\ + \ find out more about this error model and how to work with it in the\n[API\ + \ Design Guide](https://cloud.google.com/apis/design/errors)." + example: + code: 0 + details: + - '@type': "@type" + - '@type': "@type" + message: "message" + subStringMessage: + type: "object" + properties: + value: + type: "string" + book: + type: "object" + properties: + id: + type: "string" + description: "Output only. The book's ID." + readOnly: true + createTime: + type: "string" + format: "date-time" + description: "Output only. Creation time of the book." + readOnly: true + description: "An example resource type from AIP-123 used to test the behavior\ + \ described in\nthe CreateBookRequest message.\n\nSee: https://google.aip.dev/123" + A bit of everything: + type: "object" + required: + - "doubleValue" + - "floatValue" + - "int64Value" + - "requiredStringField1" + - "requiredStringField2" + - "requiredStringViaFieldBehaviorAnnotation" + - "required_field_behavior_json_name_custom" + - "required_field_schema_json_name_custom" + properties: + singleNested: + $ref: "#/definitions/ABitOfEverythingNested" + nested: + type: "array" + items: + $ref: "#/definitions/ABitOfEverythingNested" + floatValue: + type: "number" + format: "float" + description: "Float value field" + default: 0.2 + doubleValue: + type: "number" + format: "double" + int64Value: + type: "string" + format: "int64" + uint64Value: + type: "string" + format: "uint64" + int32Value: + type: "integer" + format: "int32" + fixed64Value: + type: "string" + format: "uint64" + fixed32Value: + type: "integer" + format: "int64" + boolValue: + type: "boolean" + stringValue: + type: "string" + bytesValue: + type: "string" + format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + uint32Value: + type: "integer" + format: "int64" + enumValue: + $ref: "#/definitions/examplepbNumericEnum" + pathEnumValue: + $ref: "#/definitions/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/definitions/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: "integer" + format: "int32" + sfixed64Value: + type: "string" + format: "int64" + sint32Value: + type: "integer" + format: "int32" + sint64Value: + type: "string" + format: "int64" + repeatedStringValue: + type: "array" + items: + type: "string" + oneofEmpty: + type: "object" + properties: {} + oneofString: + type: "string" + mapValue: + type: "object" + title: "map of numeric enum" + additionalProperties: + $ref: "#/definitions/examplepbNumericEnum" + mappedStringValue: + type: "object" + description: "Map of string description." + title: "Map of string title" + additionalProperties: + type: "string" + mappedNestedValue: + type: "object" + additionalProperties: + $ref: "#/definitions/ABitOfEverythingNested" + nonConventionalNameValue: + type: "string" + timestampValue: + type: "string" + format: "date-time" + repeatedEnumValue: + type: "array" + title: "repeated enum value. it is comma-separated in query" + items: + $ref: "#/definitions/examplepbNumericEnum" + repeatedEnumAnnotation: + type: "array" + description: "Repeated numeric enum description." + title: "Repeated numeric enum title" + items: + $ref: "#/definitions/examplepbNumericEnum" + enumValueAnnotation: + description: "Numeric enum description." + title: "Numeric enum title" + $ref: "#/definitions/examplepbNumericEnum" + repeatedStringAnnotation: + type: "array" + description: "Repeated string description." + title: "Repeated string title" + items: + type: "string" + repeatedNestedAnnotation: + type: "array" + description: "Repeated nested object description." + title: "Repeated nested object title" + items: + $ref: "#/definitions/ABitOfEverythingNested" + nestedAnnotation: + description: "Nested object description." + title: "Nested object title" + $ref: "#/definitions/ABitOfEverythingNested" + int64OverrideType: + type: "integer" + format: "int64" + requiredStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as required in Open API definition" + outputOnlyStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as readonly in Open API definition" + readOnly: true + optionalStringValue: + type: "string" + productId: + type: "array" + description: "Only digits are allowed." + title: "Test openapiv2 generation of repeated fields" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + optionalStringField: + type: "string" + title: "Test openapiv2 generation of required fields with annotation and jsonschema\ + \ to reproduce" + requiredStringField1: + type: "string" + requiredStringField2: + type: "string" + required_field_behavior_json_name_custom: + type: "string" + title: "Test openapiv2 handling of required json_name fields" + required_field_schema_json_name_custom: + type: "string" + trailingOnly: + type: "string" + title: "Trailing only" + trailingOnlyDot: + type: "string" + description: "Trailing only dot." + trailingBoth: + type: "string" + description: "Trailing both." + title: "Leading both" + trailingMultiline: + type: "string" + description: "This is an example of a multi-line comment.\n\nTrailing multiline." + title: "Leading multiline" + uuids: + type: "array" + title: "Specify a custom format of repeated field items" + items: + type: "string" + format: "uuid" + externalDocs: + description: "Find out more about ABitOfEverything" + url: "https://github.com/grpc-ecosystem/grpc-gateway" + title: "A bit of everything" + description: "Intentionally complicated message type to cover many features of\ + \ Protobuf." + example: + int64_value: 12 + double_value: 12.3 + x-a-bit-of-everything-foo: "bar" + A bit of everything_1: + type: "object" + required: + - "doubleValue" + - "floatValue" + - "int64Value" + - "requiredStringField1" + - "requiredStringField2" + - "requiredStringViaFieldBehaviorAnnotation" + - "required_field_behavior_json_name_custom" + - "required_field_schema_json_name_custom" + properties: + singleNested: + $ref: "#/definitions/ABitOfEverythingNested" + nested: + type: "array" + items: + $ref: "#/definitions/ABitOfEverythingNested" + floatValue: + type: "number" + format: "float" + description: "Float value field" + default: 0.2 + doubleValue: + type: "number" + format: "double" + int64Value: + type: "string" + format: "int64" + uint64Value: + type: "string" + format: "uint64" + int32Value: + type: "integer" + format: "int32" + fixed64Value: + type: "string" + format: "uint64" + fixed32Value: + type: "integer" + format: "int64" + boolValue: + type: "boolean" + stringValue: + type: "string" + bytesValue: + type: "string" + format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + uint32Value: + type: "integer" + format: "int64" + enumValue: + $ref: "#/definitions/examplepbNumericEnum" + pathEnumValue: + $ref: "#/definitions/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/definitions/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: "integer" + format: "int32" + sfixed64Value: + type: "string" + format: "int64" + sint32Value: + type: "integer" + format: "int32" + sint64Value: + type: "string" + format: "int64" + repeatedStringValue: + type: "array" + items: + type: "string" + oneofEmpty: + type: "object" + properties: {} + oneofString: + type: "string" + mapValue: + type: "object" + title: "map of numeric enum" + additionalProperties: + $ref: "#/definitions/examplepbNumericEnum" + mappedStringValue: + type: "object" + description: "Map of string description." + title: "Map of string title" + additionalProperties: + type: "string" + mappedNestedValue: + type: "object" + additionalProperties: + $ref: "#/definitions/ABitOfEverythingNested" + nonConventionalNameValue: + type: "string" + timestampValue: + type: "string" + format: "date-time" + repeatedEnumValue: + type: "array" + title: "repeated enum value. it is comma-separated in query" + items: + $ref: "#/definitions/examplepbNumericEnum" + repeatedEnumAnnotation: + type: "array" + description: "Repeated numeric enum description." + title: "Repeated numeric enum title" + items: + $ref: "#/definitions/examplepbNumericEnum" + enumValueAnnotation: + description: "Numeric enum description." + title: "Numeric enum title" + $ref: "#/definitions/examplepbNumericEnum" + repeatedStringAnnotation: + type: "array" + description: "Repeated string description." + title: "Repeated string title" + items: + type: "string" + repeatedNestedAnnotation: + type: "array" + description: "Repeated nested object description." + title: "Repeated nested object title" + items: + $ref: "#/definitions/ABitOfEverythingNested" + nestedAnnotation: + description: "Nested object description." + title: "Nested object title" + $ref: "#/definitions/ABitOfEverythingNested" + int64OverrideType: + type: "integer" + format: "int64" + requiredStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as required in Open API definition" + outputOnlyStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as readonly in Open API definition" + readOnly: true + optionalStringValue: + type: "string" + productId: + type: "array" + description: "Only digits are allowed." + title: "Test openapiv2 generation of repeated fields" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + optionalStringField: + type: "string" + title: "Test openapiv2 generation of required fields with annotation and jsonschema\ + \ to reproduce" + requiredStringField1: + type: "string" + requiredStringField2: + type: "string" + required_field_behavior_json_name_custom: + type: "string" + title: "Test openapiv2 handling of required json_name fields" + required_field_schema_json_name_custom: + type: "string" + trailingOnly: + type: "string" + title: "Trailing only" + trailingOnlyDot: + type: "string" + description: "Trailing only dot." + trailingBoth: + type: "string" + description: "Trailing both." + title: "Leading both" + trailingMultiline: + type: "string" + description: "This is an example of a multi-line comment.\n\nTrailing multiline." + title: "Leading multiline" + uuids: + type: "array" + title: "Specify a custom format of repeated field items" + items: + type: "string" + format: "uuid" + externalDocs: + description: "Find out more about ABitOfEverything" + url: "https://github.com/grpc-ecosystem/grpc-gateway" + title: "A bit of everything" + description: "Intentionally complicated message type to cover many features of\ + \ Protobuf." + example: + int64_value: 12 + double_value: 12.3 + x-a-bit-of-everything-foo: "bar" + ABitOfEverythingServiceDeepPathEchoBody_singleNested: + type: "object" + properties: + amount: + type: "integer" + format: "int64" + ok: + description: "DeepEnum description." + $ref: "#/definitions/NestedDeepEnum" + description: "Nested is nested type." + example: "{\"ok\":\"TRUE\"}" + A bit of everything_2: + type: "object" + properties: + singleNested: + $ref: "#/definitions/ABitOfEverythingNested" + nested: + type: "array" + items: + $ref: "#/definitions/ABitOfEverythingNested" + floatValue: + type: "number" + format: "float" + description: "Float value field" + default: 0.2 + doubleValue: + type: "number" + format: "double" + int64Value: + type: "string" + format: "int64" + uint64Value: + type: "string" + format: "uint64" + int32Value: + type: "integer" + format: "int32" + fixed64Value: + type: "string" + format: "uint64" + fixed32Value: + type: "integer" + format: "int64" + boolValue: + type: "boolean" + stringValue: + type: "string" + bytesValue: + type: "string" + format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + uint32Value: + type: "integer" + format: "int64" + enumValue: + $ref: "#/definitions/examplepbNumericEnum" + pathEnumValue: + $ref: "#/definitions/pathenumPathEnum" + nestedPathEnumValue: + $ref: "#/definitions/MessagePathEnumNestedPathEnum" + sfixed32Value: + type: "integer" + format: "int32" + sfixed64Value: + type: "string" + format: "int64" + sint32Value: + type: "integer" + format: "int32" + sint64Value: + type: "string" + format: "int64" + repeatedStringValue: + type: "array" + items: + type: "string" + oneofEmpty: + type: "object" + properties: {} + oneofString: + type: "string" + mapValue: + type: "object" + title: "map of numeric enum" + additionalProperties: + $ref: "#/definitions/examplepbNumericEnum" + mappedStringValue: + type: "object" + description: "Map of string description." + title: "Map of string title" + additionalProperties: + type: "string" + mappedNestedValue: + type: "object" + additionalProperties: + $ref: "#/definitions/ABitOfEverythingNested" + nonConventionalNameValue: + type: "string" + timestampValue: + type: "string" + format: "date-time" + repeatedEnumValue: + type: "array" + title: "repeated enum value. it is comma-separated in query" + items: + $ref: "#/definitions/examplepbNumericEnum" + repeatedEnumAnnotation: + type: "array" + description: "Repeated numeric enum description." + title: "Repeated numeric enum title" + items: + $ref: "#/definitions/examplepbNumericEnum" + enumValueAnnotation: + description: "Numeric enum description." + title: "Numeric enum title" + $ref: "#/definitions/examplepbNumericEnum" + repeatedStringAnnotation: + type: "array" + description: "Repeated string description." + title: "Repeated string title" + items: + type: "string" + repeatedNestedAnnotation: + type: "array" + description: "Repeated nested object description." + title: "Repeated nested object title" + items: + $ref: "#/definitions/ABitOfEverythingNested" + nestedAnnotation: + description: "Nested object description." + title: "Nested object title" + $ref: "#/definitions/ABitOfEverythingNested" + int64OverrideType: + type: "integer" + format: "int64" + requiredStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as required in Open API definition" + outputOnlyStringViaFieldBehaviorAnnotation: + type: "string" + title: "mark a field as readonly in Open API definition" + readOnly: true + optionalStringValue: + type: "string" + productId: + type: "array" + description: "Only digits are allowed." + title: "Test openapiv2 generation of repeated fields" + items: + type: "string" + minLength: 1 + maxLength: 19 + pattern: "^[0-9]+$" + optionalStringField: + type: "string" + title: "Test openapiv2 generation of required fields with annotation and jsonschema\ + \ to reproduce" + requiredStringField1: + type: "string" + requiredStringField2: + type: "string" + required_field_behavior_json_name_custom: + type: "string" + title: "Test openapiv2 handling of required json_name fields" + required_field_schema_json_name_custom: + type: "string" + trailingOnly: + type: "string" + title: "Trailing only" + trailingOnlyDot: + type: "string" + description: "Trailing only dot." + trailingBoth: + type: "string" + description: "Trailing both." + title: "Leading both" + trailingMultiline: + type: "string" + description: "This is an example of a multi-line comment.\n\nTrailing multiline." + title: "Leading multiline" + uuids: + type: "array" + title: "Specify a custom format of repeated field items" + items: + type: "string" + format: "uuid" + description: "Intentionally complicated message type to cover many features of\ + \ Protobuf." + example: "{\"int64_value\":12,\"double_value\":12.3}" + x-a-bit-of-everything-foo: "bar" +externalDocs: + description: "More about gRPC-Gateway" + url: "https://github.com/grpc-ecosystem/grpc-gateway" x-grpc-gateway-baz-list: -- one +- "one" - true -x-grpc-gateway-foo: bar -x-original-swagger-version: "2.0" +x-grpc-gateway-foo: "bar" diff --git a/examples/internal/clients/abe/api_a_bit_of_everything.go b/examples/internal/clients/abe/api_a_bit_of_everything.go index c2c8104474d..a9963811995 100644 --- a/examples/internal/clients/abe/api_a_bit_of_everything.go +++ b/examples/internal/clients/abe/api_a_bit_of_everything.go @@ -8,6 +8,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe import ( @@ -26,10 +27,12 @@ var ( ) type ABitOfEverythingApiService service + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param value + @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedPathEnum(ctx context.Context, value string) (interface{}, *http.Response, error) { @@ -50,7 +53,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -98,9 +101,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -108,6 +109,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -118,6 +120,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -128,6 +131,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -138,6 +142,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -148,6 +153,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -158,6 +164,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -168,15 +175,18 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalNestedP newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param value + @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnum(ctx context.Context, value string) (interface{}, *http.Response, error) { @@ -197,7 +207,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -245,9 +255,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -255,6 +263,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -265,6 +274,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -275,6 +285,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -285,6 +296,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -295,6 +307,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -305,6 +318,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -315,11 +329,13 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckExternalPathEnu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -352,11 +368,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of interface{}) - + * @param "OneofEmpty" (optional.Interface of map[string]string) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of Object) - map of numeric enum + * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of Object) - + * @param "MappedNestedValue" (optional.Interface of interface{}) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -375,51 +391,52 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + @return ExamplepbABitOfEverything */ -type ABitOfEverythingApiABitOfEverythingServiceCheckGetQueryParamsOpts struct { - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCheckGetQueryParamsOpts struct { + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams(ctx context.Context, singleNestedName string, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCheckGetQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { @@ -572,7 +589,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -620,9 +637,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -630,6 +645,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -640,6 +656,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -650,6 +667,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -660,6 +678,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -670,6 +689,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -680,6 +700,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -690,11 +711,13 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckGetQueryParams( newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -727,11 +750,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of interface{}) - + * @param "OneofEmpty" (optional.Interface of map[string]string) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of Object) - map of numeric enum + * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of Object) - + * @param "MappedNestedValue" (optional.Interface of interface{}) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -750,51 +773,52 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + @return ExamplepbABitOfEverything */ -type ABitOfEverythingApiABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQueryParams(ctx context.Context, singleNestedOk string, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { @@ -947,7 +971,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -995,9 +1019,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1005,6 +1027,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1015,6 +1038,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1025,6 +1049,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1035,6 +1060,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1045,6 +1071,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1055,6 +1082,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1065,15 +1093,18 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckNestedEnumGetQu newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body + * @param stringValue + * @param singleNested * @param uuid * @param floatValue Float value field * @param doubleValue @@ -1083,7 +1114,6 @@ ABitOfEverythingApiService * @param requiredStringField2 * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields * @param requiredFieldSchemaJsonNameCustom - * @param stringValue * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceCheckPostQueryParamsOpts - Optional Parameters: * @param "Uint64Value" (optional.String) - * @param "Int32Value" (optional.Int32) - @@ -1100,11 +1130,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of interface{}) - + * @param "OneofEmpty" (optional.Interface of map[string]string) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of Object) - map of numeric enum + * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of Object) - + * @param "MappedNestedValue" (optional.Interface of interface{}) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -1124,52 +1154,53 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + @return ExamplepbABitOfEverything */ -type ABitOfEverythingApiABitOfEverythingServiceCheckPostQueryParamsOpts struct { - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCheckPostQueryParamsOpts struct { + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams(ctx context.Context, body ABitOfEverythingNested, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, stringValue string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCheckPostQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams(ctx context.Context, stringValue string, singleNested ABitOfEverythingNested, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCheckPostQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -1330,7 +1361,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &body + localVarPostBody = &singleNested if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -1363,9 +1394,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1373,6 +1402,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1383,6 +1413,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1393,6 +1424,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1403,6 +1435,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1413,6 +1446,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1423,6 +1457,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1433,14 +1468,17 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckPostQueryParams newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ExamplepbCheckStatusResponse */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx context.Context) (ExamplepbCheckStatusResponse, *http.Response, error) { @@ -1460,7 +1498,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1508,9 +1546,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1518,6 +1554,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbCheckStatusResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1528,6 +1565,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1538,6 +1576,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1548,6 +1587,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1558,6 +1598,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1568,6 +1609,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1578,11 +1620,13 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCheckStatus(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService Create a new ABitOfEverything This API creates a new ABitOfEverything @@ -1618,11 +1662,11 @@ This API creates a new ABitOfEverything * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. * @param "BytesValue" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of interface{}) - + * @param "OneofEmpty" (optional.Interface of map[string]string) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of Object) - map of numeric enum + * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of Object) - + * @param "MappedNestedValue" (optional.Interface of interface{}) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "RepeatedEnumAnnotation" (optional.Interface of []string) - Repeated numeric enum title Repeated numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -1640,37 +1684,38 @@ This API creates a new ABitOfEverything * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + @return ExamplepbABitOfEverything */ -type ABitOfEverythingApiABitOfEverythingServiceCreateOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - BytesValue optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCreateOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + BytesValue optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.Context, floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, nonConventionalNameValue string, enumValue string, pathEnumValue string, nestedPathEnumValue string, enumValueAnnotation string, uuid string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCreateOpts) (ExamplepbABitOfEverything, *http.Response, error) { @@ -1796,7 +1841,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1844,9 +1889,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1854,6 +1897,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1864,6 +1908,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1874,6 +1919,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1884,6 +1930,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1894,6 +1941,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1904,6 +1952,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1914,15 +1963,18 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Intentionally complicated message type to cover many features of Protobuf. + @return ExamplepbABitOfEverything */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx context.Context, body ExamplepbABitOfEverything) (ExamplepbABitOfEverything, *http.Response, error) { @@ -1992,9 +2044,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -2002,6 +2052,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2012,6 +2063,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2022,6 +2074,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2032,6 +2085,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2042,6 +2096,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2052,6 +2107,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2062,26 +2118,29 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBody(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService Create a book. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body The book to create. * @param parent The publisher in which to create the book. Format: `publishers/{publisher}` Example: `publishers/1257894000000000000` + * @param book The book to create. * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceCreateBookOpts - Optional Parameters: * @param "BookId" (optional.String) - The ID to use for the book. This must start with an alphanumeric character. + @return ExamplepbBook */ -type ABitOfEverythingApiABitOfEverythingServiceCreateBookOpts struct { - BookId optional.String +type ABitOfEverythingApiABitOfEverythingServiceCreateBookOpts struct { + BookId optional.String } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx context.Context, body ExamplepbBook, parent string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCreateBookOpts) (ExamplepbBook, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx context.Context, parent string, book ExamplepbBook, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCreateBookOpts) (ExamplepbBook, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -2119,7 +2178,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &body + localVarPostBody = &book if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -2152,9 +2211,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -2162,6 +2219,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbBook err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2172,6 +2230,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2182,6 +2241,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2192,6 +2252,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2202,6 +2263,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2212,6 +2274,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2222,11 +2285,13 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCreateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -2259,11 +2324,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of interface{}) - + * @param "OneofEmpty" (optional.Interface of map[string]string) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of Object) - map of numeric enum + * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of Object) - + * @param "MappedNestedValue" (optional.Interface of interface{}) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -2283,53 +2348,54 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + @return ExamplepbABitOfEverything */ -type ABitOfEverythingApiABitOfEverythingServiceCustomOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCustomOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCustomOpts) (ExamplepbABitOfEverything, *http.Response, error) { @@ -2487,7 +2553,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -2535,9 +2601,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -2545,6 +2609,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2555,6 +2620,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2565,6 +2631,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2575,6 +2642,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2585,6 +2653,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2595,6 +2664,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2605,11 +2675,13 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustom(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -2642,11 +2714,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of interface{}) - + * @param "OneofEmpty" (optional.Interface of map[string]string) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of Object) - map of numeric enum + * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of Object) - + * @param "MappedNestedValue" (optional.Interface of interface{}) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -2666,53 +2738,54 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + @return interface{} */ -type ABitOfEverythingApiABitOfEverythingServiceCustomOptionsRequestOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceCustomOptionsRequestOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceCustomOptionsRequestOpts) (interface{}, *http.Response, error) { @@ -2870,7 +2943,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -2918,9 +2991,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -2928,6 +2999,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2938,6 +3010,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -2948,19 +3021,22 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceCustomOptionsRequest newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body * @param singleNestedName name is nested field. + * @param body + @return ExamplepbABitOfEverything */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx context.Context, body ABitOfEverythingServiceDeepPathEchoBody, singleNestedName string) (ExamplepbABitOfEverything, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx context.Context, singleNestedName string, body ABitOfEverythingServiceDeepPathEchoBody) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -3028,9 +3104,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -3038,6 +3112,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3048,6 +3123,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3058,6 +3134,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3068,6 +3145,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3078,6 +3156,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3088,6 +3167,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3098,15 +3178,18 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDeepPathEcho(ctx con newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuid + @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.Context, uuid string) (interface{}, *http.Response, error) { @@ -3127,7 +3210,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -3175,9 +3258,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -3185,6 +3266,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3195,6 +3277,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3205,6 +3288,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3215,6 +3299,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3225,6 +3310,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3235,6 +3321,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3245,11 +3332,13 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDelete(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -3282,11 +3371,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of interface{}) - + * @param "OneofEmpty" (optional.Interface of map[string]string) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of Object) - map of numeric enum + * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of Object) - + * @param "MappedNestedValue" (optional.Interface of interface{}) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -3306,53 +3395,54 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + @return ExamplepbABitOfEverything */ -type ABitOfEverythingApiABitOfEverythingServiceDoubleColonOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceDoubleColonOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceDoubleColonOpts) (ExamplepbABitOfEverything, *http.Response, error) { @@ -3510,7 +3600,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -3558,9 +3648,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -3568,6 +3656,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3578,6 +3667,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3588,6 +3678,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3598,6 +3689,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3608,6 +3700,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3618,6 +3711,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3628,14 +3722,17 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceDoubleColon(ctx cont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx context.Context) (interface{}, *http.Response, error) { @@ -3655,7 +3752,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -3703,9 +3800,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -3713,6 +3808,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3723,6 +3819,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3733,6 +3830,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3743,6 +3841,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3753,6 +3852,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3763,6 +3863,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -3773,11 +3874,13 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceErrorWithDetails(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -3810,11 +3913,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of interface{}) - + * @param "OneofEmpty" (optional.Interface of map[string]string) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of Object) - map of numeric enum + * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of Object) - + * @param "MappedNestedValue" (optional.Interface of interface{}) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -3834,53 +3937,54 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + @return interface{} */ -type ABitOfEverythingApiABitOfEverythingServiceExistsOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceExistsOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceExistsOpts) (interface{}, *http.Response, error) { @@ -4038,7 +4142,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.C localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -4086,9 +4190,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.C if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -4096,6 +4198,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4106,6 +4209,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4116,19 +4220,22 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceExists(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body * @param id + * @param data + @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(ctx context.Context, body ExamplepbBody, id string) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(ctx context.Context, id string, data ExamplepbBody) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -4163,7 +4270,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &body + localVarPostBody = &data if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -4196,9 +4303,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -4206,6 +4311,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4216,6 +4322,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4226,6 +4333,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4236,6 +4344,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4246,6 +4355,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4256,6 +4366,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4266,11 +4377,13 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetMessageWithBody(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -4303,11 +4416,11 @@ ABitOfEverythingApiService * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - - * @param "OneofEmpty" (optional.Interface of interface{}) - + * @param "OneofEmpty" (optional.Interface of map[string]string) - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of Object) - map of numeric enum + * @param "MapValue" (optional.Interface of interface{}) - map of numeric enum * @param "MappedStringValue" (optional.String) - Map of string title Map of string description. - * @param "MappedNestedValue" (optional.Interface of Object) - + * @param "MappedNestedValue" (optional.Interface of interface{}) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1 @@ -4327,53 +4440,54 @@ ABitOfEverythingApiService * @param "TrailingBoth" (optional.String) - Leading both Trailing both. * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + @return interface{} */ -type ABitOfEverythingApiABitOfEverythingServiceGetQueryOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk optional.String - Uint64Value optional.String - Int32Value optional.Int32 - Fixed64Value optional.String - Fixed32Value optional.Int64 - BoolValue optional.Bool - StringValue optional.String - BytesValue optional.String - Uint32Value optional.Int64 - EnumValue optional.String - PathEnumValue optional.String - NestedPathEnumValue optional.String - Sfixed32Value optional.Int32 - Sfixed64Value optional.String - Sint32Value optional.Int32 - Sint64Value optional.String - RepeatedStringValue optional.Interface - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - NonConventionalNameValue optional.String - TimestampValue optional.Time - RepeatedEnumValue optional.Interface - RepeatedEnumAnnotation optional.Interface - EnumValueAnnotation optional.String - RepeatedStringAnnotation optional.Interface - NestedAnnotationName optional.String - NestedAnnotationAmount optional.Int64 - NestedAnnotationOk optional.String - Int64OverrideType optional.Int64 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface +type ABitOfEverythingApiABitOfEverythingServiceGetQueryOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk optional.String + Uint64Value optional.String + Int32Value optional.Int32 + Fixed64Value optional.String + Fixed32Value optional.Int64 + BoolValue optional.Bool + StringValue optional.String + BytesValue optional.String + Uint32Value optional.Int64 + EnumValue optional.String + PathEnumValue optional.String + NestedPathEnumValue optional.String + Sfixed32Value optional.Int32 + Sfixed64Value optional.String + Sint32Value optional.Int32 + Sint64Value optional.String + RepeatedStringValue optional.Interface + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + NonConventionalNameValue optional.String + TimestampValue optional.Time + RepeatedEnumValue optional.Interface + RepeatedEnumAnnotation optional.Interface + EnumValueAnnotation optional.String + RepeatedStringAnnotation optional.Interface + NestedAnnotationName optional.String + NestedAnnotationAmount optional.Int64 + NestedAnnotationOk optional.String + Int64OverrideType optional.Int64 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface } func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceGetQueryOpts) (interface{}, *http.Response, error) { @@ -4531,7 +4645,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -4566,9 +4680,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -4576,6 +4688,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4586,6 +4699,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4596,6 +4710,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4606,6 +4721,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4616,6 +4732,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4626,6 +4743,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4636,11 +4754,13 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -4660,6 +4780,7 @@ ABitOfEverythingApiService * @param pathRepeatedSfixed64Value * @param pathRepeatedSint32Value * @param pathRepeatedSint64Value + @return ExamplepbABitOfEverythingRepeated */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx context.Context, pathRepeatedFloatValue []float32, pathRepeatedDoubleValue []float64, pathRepeatedInt64Value []string, pathRepeatedUint64Value []string, pathRepeatedInt32Value []int32, pathRepeatedFixed64Value []string, pathRepeatedFixed32Value []int64, pathRepeatedBoolValue []bool, pathRepeatedStringValue []string, pathRepeatedBytesValue []string, pathRepeatedUint32Value []int64, pathRepeatedEnumValue []string, pathRepeatedSfixed32Value []int32, pathRepeatedSfixed64Value []string, pathRepeatedSint32Value []int32, pathRepeatedSint64Value []string) (ExamplepbABitOfEverythingRepeated, *http.Response, error) { @@ -4743,7 +4864,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -4791,9 +4912,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -4801,6 +4920,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverythingRepeated err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4811,6 +4931,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4821,6 +4942,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4831,6 +4953,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4841,6 +4964,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4851,6 +4975,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4861,15 +4986,18 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuid + @return ExamplepbABitOfEverything */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.Context, uuid string) (ExamplepbABitOfEverything, *http.Response, error) { @@ -4890,7 +5018,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -4938,9 +5066,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -4948,6 +5074,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4958,6 +5085,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4968,6 +5096,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4978,6 +5107,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4988,6 +5118,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -4998,6 +5129,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5008,15 +5140,18 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceLookup(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body + @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestContentType(ctx context.Context, body ExamplepbBody) (interface{}, *http.Response, error) { @@ -5086,9 +5221,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -5096,6 +5229,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5106,6 +5240,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5116,6 +5251,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5126,6 +5262,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5136,6 +5273,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5146,6 +5284,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5156,14 +5295,17 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestCont newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return string */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseContentType(ctx context.Context) (string, *http.Response, error) { @@ -5183,7 +5325,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -5231,9 +5373,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -5241,6 +5381,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5251,6 +5392,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5261,6 +5403,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5271,6 +5414,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5281,6 +5425,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5291,6 +5436,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5301,18 +5447,21 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteResponseCon newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body + * @param exampleEnum + @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx context.Context, body string) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx context.Context, exampleEnum OneofenumExampleEnum) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -5346,7 +5495,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &body + localVarPostBody = &exampleEnum if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -5379,9 +5528,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -5389,6 +5536,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5399,6 +5547,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5409,6 +5558,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5419,6 +5569,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5429,6 +5580,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5439,6 +5591,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5449,15 +5602,18 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostOneofEnum(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body + @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageType(ctx context.Context, body ExamplepbRequiredMessageTypeRequest) (interface{}, *http.Response, error) { @@ -5527,9 +5683,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -5537,6 +5691,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5547,6 +5702,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5557,6 +5713,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5567,6 +5724,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5577,6 +5735,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5587,6 +5746,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5597,19 +5757,22 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostRequiredMessageT newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body * @param name + * @param body + @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ctx context.Context, body ABitOfEverythingServicePostWithEmptyBodyBody, name string) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ctx context.Context, name string, body ABitOfEverythingServicePostWithEmptyBodyBody) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -5677,9 +5840,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -5687,6 +5848,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5697,6 +5859,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5707,6 +5870,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5717,6 +5881,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5727,6 +5892,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5737,6 +5903,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5747,14 +5914,17 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServicePostWithEmptyBody(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return interface{} */ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context.Context) (interface{}, *http.Response, error) { @@ -5774,7 +5944,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -5822,9 +5992,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -5832,6 +6000,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5842,6 +6011,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5852,6 +6022,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5862,6 +6033,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5872,6 +6044,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5882,6 +6055,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5892,19 +6066,22 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceTimeout(ctx context. newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body * @param uuidName + * @param body + @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.Context, body ExamplepbABitOfEverythingServiceUpdateBody, uuidName string) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.Context, uuidName string, body ExamplepbABitOfEverythingServiceUpdateBody) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -5972,9 +6149,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -5982,6 +6157,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -5992,6 +6168,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6002,6 +6179,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6012,6 +6190,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6022,6 +6201,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6032,6 +6212,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6042,26 +6223,29 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdate(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body The book to update. The book's `name` field is used to identify the book to be updated. Format: publishers/{publisher}/books/{book} * @param bookName The resource name of the book. Format: `publishers/{publisher}/books/{book}` Example: `publishers/1257894000000000000/books/my-book` + * @param book The book to update. The book's `name` field is used to identify the book to be updated. Format: publishers/{publisher}/books/{book} * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceUpdateBookOpts - Optional Parameters: * @param "AllowMissing" (optional.Bool) - If set to true, and the book is not found, a new book will be created. In this situation, `update_mask` is ignored. + @return ExamplepbBook */ -type ABitOfEverythingApiABitOfEverythingServiceUpdateBookOpts struct { - AllowMissing optional.Bool +type ABitOfEverythingApiABitOfEverythingServiceUpdateBookOpts struct { + AllowMissing optional.Bool } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx context.Context, body V1BookNameBody, bookName string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceUpdateBookOpts) (ExamplepbBook, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx context.Context, bookName string, book Book, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceUpdateBookOpts) (ExamplepbBook, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -6099,7 +6283,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &body + localVarPostBody = &book if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -6132,9 +6316,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -6142,6 +6324,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbBook err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6152,6 +6335,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6162,6 +6346,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6172,6 +6357,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6182,6 +6368,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6192,6 +6379,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6202,26 +6390,29 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateBook(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body A bit of everything Intentionally complicated message type to cover many features of Protobuf. * @param uuidName + * @param abe A bit of everything Intentionally complicated message type to cover many features of Protobuf. * @param optional nil or *ABitOfEverythingApiABitOfEverythingServiceUpdateV2Opts - Optional Parameters: * @param "UpdateMask" (optional.String) - The paths to update. + @return interface{} */ -type ABitOfEverythingApiABitOfEverythingServiceUpdateV2Opts struct { - UpdateMask optional.String +type ABitOfEverythingApiABitOfEverythingServiceUpdateV2Opts struct { + UpdateMask optional.String } -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context.Context, body ABitOfEverything, uuidName string, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceUpdateV2Opts) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context.Context, uuidName string, abe ABitOfEverything, localVarOptionals *ABitOfEverythingApiABitOfEverythingServiceUpdateV2Opts) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -6259,7 +6450,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &body + localVarPostBody = &abe if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -6292,9 +6483,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -6302,6 +6491,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6312,6 +6502,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6322,6 +6513,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6332,6 +6524,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6342,6 +6535,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6352,6 +6546,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6362,19 +6557,22 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV2(ctx context newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body A bit of everything Intentionally complicated message type to cover many features of Protobuf. * @param uuidName + * @param abe A bit of everything Intentionally complicated message type to cover many features of Protobuf. + @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx context.Context, body ABitOfEverything2, uuidName string) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx context.Context, uuidName string, abe ABitOfEverything1) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -6409,7 +6607,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &body + localVarPostBody = &abe if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -6442,9 +6640,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -6452,6 +6648,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6462,6 +6659,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6472,6 +6670,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6482,6 +6681,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6492,6 +6692,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6502,6 +6703,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6512,19 +6714,22 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV22(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ABitOfEverythingApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body * @param uuidName + * @param body + @return interface{} */ -func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx context.Context, body ABitOfEverythingServiceUpdateV2Body, uuidName string) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx context.Context, uuidName string, body ABitOfEverythingServiceUpdateV2Body) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -6592,9 +6797,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -6602,6 +6805,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6612,6 +6816,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6622,6 +6827,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6632,6 +6838,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6642,6 +6849,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6652,6 +6860,7 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -6662,8 +6871,10 @@ func (a *ABitOfEverythingApiService) ABitOfEverythingServiceUpdateV23(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/examples/internal/clients/abe/api_camel_case_service_name.go b/examples/internal/clients/abe/api_camel_case_service_name.go index b591883a66b..e687b47d481 100644 --- a/examples/internal/clients/abe/api_camel_case_service_name.go +++ b/examples/internal/clients/abe/api_camel_case_service_name.go @@ -8,6 +8,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe import ( @@ -24,9 +25,11 @@ var ( ) type CamelCaseServiceNameApiService service + /* CamelCaseServiceNameApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return interface{} */ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.Context) (interface{}, *http.Response, error) { @@ -46,7 +49,7 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -94,9 +97,7 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -104,6 +105,7 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -114,6 +116,7 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -124,6 +127,7 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -134,6 +138,7 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -144,6 +149,7 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -154,6 +160,7 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -164,8 +171,10 @@ func (a *CamelCaseServiceNameApiService) CamelCaseServiceNameEmpty(ctx context.C newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/examples/internal/clients/abe/api_echo_rpc.go b/examples/internal/clients/abe/api_echo_rpc.go index a5ac9e42361..addb5bbfb34 100644 --- a/examples/internal/clients/abe/api_echo_rpc.go +++ b/examples/internal/clients/abe/api_echo_rpc.go @@ -8,6 +8,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe import ( @@ -26,11 +27,13 @@ var ( ) type EchoRpcApiService service + /* EchoRpcApiService Summary: Echo rpc Description Echo * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param value + @return SubStringMessage */ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, value string) (SubStringMessage, *http.Response, error) { @@ -51,7 +54,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -99,9 +102,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -109,6 +110,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v SubStringMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -119,6 +121,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -129,6 +132,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -139,6 +143,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -149,6 +154,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -159,6 +165,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -169,6 +176,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -179,19 +187,22 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho(ctx context.Context, val newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoRpcApiService Summary: Echo rpc Description Echo * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body + * @param value + @return SubStringMessage */ -func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, body string) (SubStringMessage, *http.Response, error) { +func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, value string) (SubStringMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -225,7 +236,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &body + localVarPostBody = &value if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -258,9 +269,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -268,6 +277,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v SubStringMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -278,6 +288,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -288,6 +299,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -298,6 +310,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -308,6 +321,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -318,6 +332,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -328,6 +343,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -338,22 +354,25 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, bo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoRpcApiService Summary: Echo rpc Description Echo * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *EchoRpcApiABitOfEverythingServiceEcho3Opts - Optional Parameters: * @param "Value" (optional.String) - + @return SubStringMessage */ -type EchoRpcApiABitOfEverythingServiceEcho3Opts struct { - Value optional.String +type EchoRpcApiABitOfEverythingServiceEcho3Opts struct { + Value optional.String } func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, localVarOptionals *EchoRpcApiABitOfEverythingServiceEcho3Opts) (SubStringMessage, *http.Response, error) { @@ -376,7 +395,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo localVarQueryParams.Add("value", parameterToString(localVarOptionals.Value.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -424,9 +443,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -434,6 +451,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v SubStringMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -444,6 +462,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -454,6 +473,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -464,6 +484,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -474,6 +495,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -484,6 +506,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -494,6 +517,7 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -504,8 +528,10 @@ func (a *EchoRpcApiService) ABitOfEverythingServiceEcho3(ctx context.Context, lo newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/examples/internal/clients/abe/api_snake_enum_service.go b/examples/internal/clients/abe/api_snake_enum_service.go index 2edcbd7177d..d8b9794f718 100644 --- a/examples/internal/clients/abe/api_snake_enum_service.go +++ b/examples/internal/clients/abe/api_snake_enum_service.go @@ -8,6 +8,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe import ( @@ -25,12 +26,14 @@ var ( ) type SnakeEnumServiceApiService service + /* SnakeEnumServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param who * @param what * @param where + @return ExamplepbSnakeEnumResponse */ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Context, who string, what string, where string) (ExamplepbSnakeEnumResponse, *http.Response, error) { @@ -53,7 +56,7 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -101,9 +104,7 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -111,6 +112,7 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSnakeEnumResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -121,6 +123,7 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -131,6 +134,7 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -141,6 +145,7 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -151,6 +156,7 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 500 { var v ExamplepbErrorResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -161,6 +167,7 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -171,8 +178,10 @@ func (a *SnakeEnumServiceApiService) SnakeEnumServiceSnakeEnum(ctx context.Conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/examples/internal/clients/abe/client.go b/examples/internal/clients/abe/client.go index 0a5e27a187f..203bba882fc 100644 --- a/examples/internal/clients/abe/client.go +++ b/examples/internal/clients/abe/client.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe import ( @@ -33,8 +34,8 @@ import ( ) var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") ) // APIClient manages communication with the A Bit of Everything API v1.0 diff --git a/examples/internal/clients/abe/configuration.go b/examples/internal/clients/abe/configuration.go index 20454201be0..3e85ff02f0f 100644 --- a/examples/internal/clients/abe/configuration.go +++ b/examples/internal/clients/abe/configuration.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe import ( @@ -60,7 +61,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "/", + BasePath: "http://localhost", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/abe/model_a_bit_of_everything.go b/examples/internal/clients/abe/model_a_bit_of_everything.go index ee16bbd16b6..73426b5dd88 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything.go @@ -7,7 +7,9 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe + import ( "time" ) @@ -36,7 +38,7 @@ type ABitOfEverything struct { Sint32Value int32 `json:"sint32Value,omitempty"` Sint64Value string `json:"sint64Value,omitempty"` RepeatedStringValue []string `json:"repeatedStringValue,omitempty"` - OneofEmpty *interface{} `json:"oneofEmpty,omitempty"` + OneofEmpty interface{} `json:"oneofEmpty,omitempty"` OneofString string `json:"oneofString,omitempty"` MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"` // Map of string description. @@ -47,11 +49,13 @@ type ABitOfEverything struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` + // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` + // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_1.go b/examples/internal/clients/abe/model_a_bit_of_everything_1.go index 0b3d67749a8..417f8a3287b 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_1.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_1.go @@ -7,7 +7,9 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe + import ( "time" ) @@ -36,7 +38,7 @@ type ABitOfEverything1 struct { Sint32Value int32 `json:"sint32Value,omitempty"` Sint64Value string `json:"sint64Value,omitempty"` RepeatedStringValue []string `json:"repeatedStringValue,omitempty"` - OneofEmpty *interface{} `json:"oneofEmpty,omitempty"` + OneofEmpty interface{} `json:"oneofEmpty,omitempty"` OneofString string `json:"oneofString,omitempty"` MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"` // Map of string description. @@ -47,11 +49,13 @@ type ABitOfEverything1 struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` + // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` + // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_2.go b/examples/internal/clients/abe/model_a_bit_of_everything_2.go index 2088fc504fa..02677de439c 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_2.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_2.go @@ -7,7 +7,9 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe + import ( "time" ) @@ -17,9 +19,9 @@ type ABitOfEverything2 struct { SingleNested *ABitOfEverythingNested `json:"singleNested,omitempty"` Nested []ABitOfEverythingNested `json:"nested,omitempty"` // Float value field - FloatValue float32 `json:"floatValue"` - DoubleValue float64 `json:"doubleValue"` - Int64Value string `json:"int64Value"` + FloatValue float32 `json:"floatValue,omitempty"` + DoubleValue float64 `json:"doubleValue,omitempty"` + Int64Value string `json:"int64Value,omitempty"` Uint64Value string `json:"uint64Value,omitempty"` Int32Value int32 `json:"int32Value,omitempty"` Fixed64Value string `json:"fixed64Value,omitempty"` @@ -36,7 +38,7 @@ type ABitOfEverything2 struct { Sint32Value int32 `json:"sint32Value,omitempty"` Sint64Value string `json:"sint64Value,omitempty"` RepeatedStringValue []string `json:"repeatedStringValue,omitempty"` - OneofEmpty *interface{} `json:"oneofEmpty,omitempty"` + OneofEmpty interface{} `json:"oneofEmpty,omitempty"` OneofString string `json:"oneofString,omitempty"` MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"` // Map of string description. @@ -47,23 +49,25 @@ type ABitOfEverything2 struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` + // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` + // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` - RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` + RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation,omitempty"` OutputOnlyStringViaFieldBehaviorAnnotation string `json:"outputOnlyStringViaFieldBehaviorAnnotation,omitempty"` OptionalStringValue string `json:"optionalStringValue,omitempty"` // Only digits are allowed. ProductId []string `json:"productId,omitempty"` OptionalStringField string `json:"optionalStringField,omitempty"` - RequiredStringField1 string `json:"requiredStringField1"` - RequiredStringField2 string `json:"requiredStringField2"` - RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom"` - RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom"` + RequiredStringField1 string `json:"requiredStringField1,omitempty"` + RequiredStringField2 string `json:"requiredStringField2,omitempty"` + RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom,omitempty"` + RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom,omitempty"` TrailingOnly string `json:"trailingOnly,omitempty"` // Trailing only dot. TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_nested.go b/examples/internal/clients/abe/model_a_bit_of_everything_nested.go index 39afd7713e8..586778feaaa 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_nested.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_nested.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe // Nested is nested type. @@ -14,5 +15,6 @@ type ABitOfEverythingNested struct { // name is nested field. Name string `json:"name,omitempty"` Amount int64 `json:"amount,omitempty"` + // DeepEnum description. Ok *NestedDeepEnum `json:"ok,omitempty"` } diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body.go b/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body.go index 3d832d84a4c..5fe2931e675 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body.go @@ -7,7 +7,9 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe + import ( "time" ) @@ -37,7 +39,7 @@ type ABitOfEverythingServiceDeepPathEchoBody struct { Sint32Value int32 `json:"sint32Value,omitempty"` Sint64Value string `json:"sint64Value,omitempty"` RepeatedStringValue []string `json:"repeatedStringValue,omitempty"` - OneofEmpty *interface{} `json:"oneofEmpty,omitempty"` + OneofEmpty interface{} `json:"oneofEmpty,omitempty"` OneofString string `json:"oneofString,omitempty"` MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"` // Map of string description. @@ -48,11 +50,13 @@ type ABitOfEverythingServiceDeepPathEchoBody struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` + // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` + // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body_single_nested.go b/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body_single_nested.go index e66242956a9..2a60d84b6ef 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body_single_nested.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_service_deep_path_echo_body_single_nested.go @@ -7,10 +7,12 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe // Nested is nested type. type ABitOfEverythingServiceDeepPathEchoBodySingleNested struct { Amount int64 `json:"amount,omitempty"` + // DeepEnum description. Ok *NestedDeepEnum `json:"ok,omitempty"` } diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go b/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go index 3890cb98898..8bdd7165a2d 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ABitOfEverythingServicePostWithEmptyBodyBody struct { diff --git a/examples/internal/clients/abe/model_a_bit_of_everything_service_update_v2_body.go b/examples/internal/clients/abe/model_a_bit_of_everything_service_update_v2_body.go index bee582f5c40..b9c2a37682d 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything_service_update_v2_body.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything_service_update_v2_body.go @@ -7,10 +7,11 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ABitOfEverythingServiceUpdateV2Body struct { - Abe *ABitOfEverything4 `json:"abe,omitempty"` + Abe *ABitOfEverything2 `json:"abe,omitempty"` // The paths to update. UpdateMask string `json:"updateMask,omitempty"` } diff --git a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go index 478c6277789..2f6bb864046 100644 --- a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go +++ b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go @@ -7,7 +7,9 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe + import ( "time" ) @@ -37,7 +39,7 @@ type ExamplepbABitOfEverything struct { Sint32Value int32 `json:"sint32Value,omitempty"` Sint64Value string `json:"sint64Value,omitempty"` RepeatedStringValue []string `json:"repeatedStringValue,omitempty"` - OneofEmpty *interface{} `json:"oneofEmpty,omitempty"` + OneofEmpty interface{} `json:"oneofEmpty,omitempty"` OneofString string `json:"oneofString,omitempty"` MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"` // Map of string description. @@ -48,11 +50,13 @@ type ExamplepbABitOfEverything struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` + // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` + // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_repeated.go b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_repeated.go index e6fbb41ca28..4e0b39bd9a1 100644 --- a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_repeated.go +++ b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_repeated.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ExamplepbABitOfEverythingRepeated struct { diff --git a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go index 1491aea9e08..34a955d7cfd 100644 --- a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go +++ b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go @@ -7,7 +7,9 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe + import ( "time" ) @@ -36,7 +38,7 @@ type ExamplepbABitOfEverythingServiceUpdateBody struct { Sint32Value int32 `json:"sint32Value,omitempty"` Sint64Value string `json:"sint64Value,omitempty"` RepeatedStringValue []string `json:"repeatedStringValue,omitempty"` - OneofEmpty *interface{} `json:"oneofEmpty,omitempty"` + OneofEmpty interface{} `json:"oneofEmpty,omitempty"` OneofString string `json:"oneofString,omitempty"` MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"` // Map of string description. @@ -47,11 +49,13 @@ type ExamplepbABitOfEverythingServiceUpdateBody struct { RepeatedEnumValue []ExamplepbNumericEnum `json:"repeatedEnumValue,omitempty"` // Repeated numeric enum description. RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeatedEnumAnnotation,omitempty"` + // Numeric enum description. EnumValueAnnotation *ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"` // Repeated string description. RepeatedStringAnnotation []string `json:"repeatedStringAnnotation,omitempty"` // Repeated nested object description. RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` + // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` Int64OverrideType int64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` diff --git a/examples/internal/clients/abe/model_examplepb_bar.go b/examples/internal/clients/abe/model_examplepb_bar.go index 0318e13f255..40841f24c41 100644 --- a/examples/internal/clients/abe/model_examplepb_bar.go +++ b/examples/internal/clients/abe/model_examplepb_bar.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ExamplepbBar struct { diff --git a/examples/internal/clients/abe/model_examplepb_body.go b/examples/internal/clients/abe/model_examplepb_body.go index ace797a9ccf..0c3d9c9b5b1 100644 --- a/examples/internal/clients/abe/model_examplepb_body.go +++ b/examples/internal/clients/abe/model_examplepb_body.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ExamplepbBody struct { diff --git a/examples/internal/clients/abe/model_examplepb_book.go b/examples/internal/clients/abe/model_examplepb_book.go index 086fd1a3f48..0246900a38c 100644 --- a/examples/internal/clients/abe/model_examplepb_book.go +++ b/examples/internal/clients/abe/model_examplepb_book.go @@ -7,7 +7,9 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe + import ( "time" ) diff --git a/examples/internal/clients/abe/model_examplepb_check_status_response.go b/examples/internal/clients/abe/model_examplepb_check_status_response.go index 6439f51b0b6..602a53dc1ed 100644 --- a/examples/internal/clients/abe/model_examplepb_check_status_response.go +++ b/examples/internal/clients/abe/model_examplepb_check_status_response.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ExamplepbCheckStatusResponse struct { diff --git a/examples/internal/clients/abe/model_examplepb_error_object.go b/examples/internal/clients/abe/model_examplepb_error_object.go index 923750ec851..b41c68fa852 100644 --- a/examples/internal/clients/abe/model_examplepb_error_object.go +++ b/examples/internal/clients/abe/model_examplepb_error_object.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ExamplepbErrorObject struct { diff --git a/examples/internal/clients/abe/model_examplepb_error_response.go b/examples/internal/clients/abe/model_examplepb_error_response.go index 6abfae1f276..55e17df4a48 100644 --- a/examples/internal/clients/abe/model_examplepb_error_response.go +++ b/examples/internal/clients/abe/model_examplepb_error_response.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ExamplepbErrorResponse struct { diff --git a/examples/internal/clients/abe/model_examplepb_numeric_enum.go b/examples/internal/clients/abe/model_examplepb_numeric_enum.go index aa92c09f9a2..ca8dd50a639 100644 --- a/examples/internal/clients/abe/model_examplepb_numeric_enum.go +++ b/examples/internal/clients/abe/model_examplepb_numeric_enum.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe // ExamplepbNumericEnum : NumericEnum is one or zero. type ExamplepbNumericEnum string diff --git a/examples/internal/clients/abe/model_examplepb_required_message_type_request.go b/examples/internal/clients/abe/model_examplepb_required_message_type_request.go index e03cedad232..1dbd19ff092 100644 --- a/examples/internal/clients/abe/model_examplepb_required_message_type_request.go +++ b/examples/internal/clients/abe/model_examplepb_required_message_type_request.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ExamplepbRequiredMessageTypeRequest struct { diff --git a/examples/internal/clients/abe/model_examplepb_snake_enum_response.go b/examples/internal/clients/abe/model_examplepb_snake_enum_response.go index a6e17fbe100..eff692b9826 100644 --- a/examples/internal/clients/abe/model_examplepb_snake_enum_response.go +++ b/examples/internal/clients/abe/model_examplepb_snake_enum_response.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ExamplepbSnakeEnumResponse struct { diff --git a/examples/internal/clients/abe/model_examplepbsnake_case_0_enum.go b/examples/internal/clients/abe/model_examplepbsnake_case_0_enum.go index 5f9756a849c..50f149d8268 100644 --- a/examples/internal/clients/abe/model_examplepbsnake_case_0_enum.go +++ b/examples/internal/clients/abe/model_examplepbsnake_case_0_enum.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe // ExamplepbsnakeCase0Enum : - value_e: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_f: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE type ExamplepbsnakeCase0Enum string diff --git a/examples/internal/clients/abe/model_examplepbsnake_case_enum.go b/examples/internal/clients/abe/model_examplepbsnake_case_enum.go index 4360a08e520..003b2f22f26 100644 --- a/examples/internal/clients/abe/model_examplepbsnake_case_enum.go +++ b/examples/internal/clients/abe/model_examplepbsnake_case_enum.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe // ExamplepbsnakeCaseEnum : - value_c: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_d: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE type ExamplepbsnakeCaseEnum string diff --git a/examples/internal/clients/abe/model_message_path_enum_nested_path_enum.go b/examples/internal/clients/abe/model_message_path_enum_nested_path_enum.go index f446f3bffcb..ef64b6b71e8 100644 --- a/examples/internal/clients/abe/model_message_path_enum_nested_path_enum.go +++ b/examples/internal/clients/abe/model_message_path_enum_nested_path_enum.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type MessagePathEnumNestedPathEnum string diff --git a/examples/internal/clients/abe/model_nested_deep_enum.go b/examples/internal/clients/abe/model_nested_deep_enum.go index 7308783288c..da1c7e372ec 100644 --- a/examples/internal/clients/abe/model_nested_deep_enum.go +++ b/examples/internal/clients/abe/model_nested_deep_enum.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe // NestedDeepEnum : DeepEnum is one or zero. - FALSE: FALSE is false. - TRUE: TRUE is true. type NestedDeepEnum string diff --git a/examples/internal/clients/abe/model_oneofenum_example_enum.go b/examples/internal/clients/abe/model_oneofenum_example_enum.go index 946f30c780d..939f0f7f192 100644 --- a/examples/internal/clients/abe/model_oneofenum_example_enum.go +++ b/examples/internal/clients/abe/model_oneofenum_example_enum.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type OneofenumExampleEnum string diff --git a/examples/internal/clients/abe/model_pathenum_path_enum.go b/examples/internal/clients/abe/model_pathenum_path_enum.go index 74f4a46590a..810e1abe1a7 100644 --- a/examples/internal/clients/abe/model_pathenum_path_enum.go +++ b/examples/internal/clients/abe/model_pathenum_path_enum.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type PathenumPathEnum string diff --git a/examples/internal/clients/abe/model_pathenumsnake_case_for_import.go b/examples/internal/clients/abe/model_pathenumsnake_case_for_import.go index f95f891f593..f6c7ec5100d 100644 --- a/examples/internal/clients/abe/model_pathenumsnake_case_for_import.go +++ b/examples/internal/clients/abe/model_pathenumsnake_case_for_import.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe // PathenumsnakeCaseForImport : - value_x: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_y: buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE type PathenumsnakeCaseForImport string diff --git a/examples/internal/clients/abe/model_protoexamplepb_foo.go b/examples/internal/clients/abe/model_protoexamplepb_foo.go index 7241b58ac13..343c0d93cc4 100644 --- a/examples/internal/clients/abe/model_protoexamplepb_foo.go +++ b/examples/internal/clients/abe/model_protoexamplepb_foo.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type ProtoexamplepbFoo struct { diff --git a/examples/internal/clients/abe/model_rpc_status.go b/examples/internal/clients/abe/model_rpc_status.go index 6754ef66612..0bda0e2a94e 100644 --- a/examples/internal/clients/abe/model_rpc_status.go +++ b/examples/internal/clients/abe/model_rpc_status.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe // The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). @@ -16,5 +17,5 @@ type RpcStatus struct { // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. Message string `json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of message types for APIs to use. - Details []map[string]interface{} `json:"details,omitempty"` + Details []ProtobufAny `json:"details,omitempty"` } diff --git a/examples/internal/clients/abe/model_sub_string_message.go b/examples/internal/clients/abe/model_sub_string_message.go index 413a781038a..d4dcf4ebf16 100644 --- a/examples/internal/clients/abe/model_sub_string_message.go +++ b/examples/internal/clients/abe/model_sub_string_message.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe type SubStringMessage struct { diff --git a/examples/internal/clients/abe/response.go b/examples/internal/clients/abe/response.go index 4c949ea11ff..a42d47cd7ab 100644 --- a/examples/internal/clients/abe/response.go +++ b/examples/internal/clients/abe/response.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package abe import ( diff --git a/examples/internal/clients/echo/.swagger-codegen/VERSION b/examples/internal/clients/echo/.swagger-codegen/VERSION index b61c49d271a..a932b445646 100644 --- a/examples/internal/clients/echo/.swagger-codegen/VERSION +++ b/examples/internal/clients/echo/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.71 \ No newline at end of file +2.4.47-SNAPSHOT \ No newline at end of file diff --git a/examples/internal/clients/echo/api/swagger.yaml b/examples/internal/clients/echo/api/swagger.yaml index 73129246ad6..cbd1a9f2745 100644 --- a/examples/internal/clients/echo/api/swagger.yaml +++ b/examples/internal/clients/echo/api/swagger.yaml @@ -1,1414 +1,1145 @@ -openapi: 3.0.1 +--- +swagger: "2.0" info: - title: Echo Service - description: |- - Echo Service API consists of a single service which returns - a message. - version: version not set -servers: -- url: / + description: "Echo Service API consists of a single service which returns\na message." + version: "version not set" + title: "Echo Service" tags: -- name: EchoService +- name: "EchoService" +consumes: +- "application/json" +produces: +- "application/json" paths: /v1/example/echo/nested/{nId.nId}: get: tags: - - EchoService - summary: Echo method receives a simple message and returns it. - description: |- - The message posted as the id parameter will also be - returned. - operationId: EchoService_Echo7 + - "EchoService" + summary: "Echo method receives a simple message and returns it." + description: "The message posted as the id parameter will also be\nreturned." + operationId: "EchoService_Echo7" parameters: - - name: nId.nId - in: path + - name: "nId.nId" + in: "path" required: true - style: simple - explode: false - schema: - type: string - - name: id - in: query - description: Id represents the message identifier. - required: false - style: form - explode: true - schema: - type: string - - name: num - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + x-exportParamName: "NIdNId" + - name: "id" + in: "query" + description: "Id represents the message identifier." + required: false + type: "string" + x-exportParamName: "Id" + x-optionalDataType: "String" + - name: "num" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Num" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo/resource/{resourceId}: get: tags: - - EchoService - summary: Echo method receives a simple message and returns it. - description: |- - The message posted as the id parameter will also be - returned. - operationId: EchoService_Echo6 + - "EchoService" + summary: "Echo method receives a simple message and returns it." + description: "The message posted as the id parameter will also be\nreturned." + operationId: "EchoService_Echo6" parameters: - - name: resourceId - in: path + - name: "resourceId" + in: "path" required: true - style: simple - explode: false - schema: - type: string - - name: id - in: query - description: Id represents the message identifier. - required: false - style: form - explode: true - schema: - type: string - - name: num - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + x-exportParamName: "ResourceId" + - name: "id" + in: "query" + description: "Id represents the message identifier." + required: false + type: "string" + x-exportParamName: "Id" + x-optionalDataType: "String" + - name: "num" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Num" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo/{id}: post: tags: - - EchoService - summary: Echo method receives a simple message and returns it. - description: |- - The message posted as the id parameter will also be - returned. - operationId: EchoService_Echo + - "EchoService" + summary: "Echo method receives a simple message and returns it." + description: "The message posted as the id parameter will also be\nreturned." + operationId: "EchoService_Echo" parameters: - - name: id - in: path - description: Id represents the message identifier. + - name: "id" + in: "path" + description: "Id represents the message identifier." required: true - style: simple - explode: false - schema: - type: string - - name: num - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + x-exportParamName: "Id" + - name: "num" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Num" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo/{id}/{num}: get: tags: - - EchoService - summary: Echo method receives a simple message and returns it. - description: |- - The message posted as the id parameter will also be - returned. - operationId: EchoService_Echo2 + - "EchoService" + summary: "Echo method receives a simple message and returns it." + description: "The message posted as the id parameter will also be\nreturned." + operationId: "EchoService_Echo2" parameters: - - name: id - in: path - description: Id represents the message identifier. + - name: "id" + in: "path" + description: "Id represents the message identifier." required: true - style: simple - explode: false - schema: - type: string - - name: num - in: path + type: "string" + x-exportParamName: "Id" + - name: "num" + in: "path" required: true - style: simple - explode: false - schema: - type: string - format: int64 - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + format: "int64" + x-exportParamName: "Num" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo/{id}/{num}/{lang}: get: tags: - - EchoService - summary: Echo method receives a simple message and returns it. - description: |- - The message posted as the id parameter will also be - returned. - operationId: EchoService_Echo3 + - "EchoService" + summary: "Echo method receives a simple message and returns it." + description: "The message posted as the id parameter will also be\nreturned." + operationId: "EchoService_Echo3" parameters: - - name: id - in: path - description: Id represents the message identifier. + - name: "id" + in: "path" + description: "Id represents the message identifier." required: true - style: simple - explode: false - schema: - type: string - - name: num - in: path + type: "string" + x-exportParamName: "Id" + - name: "num" + in: "path" required: true - style: simple - explode: false - schema: - type: string - format: int64 - - name: lang - in: path + type: "string" + format: "int64" + x-exportParamName: "Num" + - name: "lang" + in: "path" required: true - style: simple - explode: false - schema: - type: string - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + x-exportParamName: "Lang" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo1/{id}/{lineNum}/{status.note}: get: tags: - - EchoService - summary: Echo method receives a simple message and returns it. - description: |- - The message posted as the id parameter will also be - returned. - operationId: EchoService_Echo4 + - "EchoService" + summary: "Echo method receives a simple message and returns it." + description: "The message posted as the id parameter will also be\nreturned." + operationId: "EchoService_Echo4" parameters: - - name: id - in: path - description: Id represents the message identifier. + - name: "id" + in: "path" + description: "Id represents the message identifier." required: true - style: simple - explode: false - schema: - type: string - - name: lineNum - in: path + type: "string" + x-exportParamName: "Id" + - name: "lineNum" + in: "path" required: true - style: simple - explode: false - schema: - type: string - format: int64 - - name: status.note - in: path + type: "string" + format: "int64" + x-exportParamName: "LineNum" + - name: "status.note" + in: "path" required: true - style: simple - explode: false - schema: - type: string - - name: num - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + x-exportParamName: "StatusNote" + - name: "num" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Num" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo2/{no.note}: get: tags: - - EchoService - summary: Echo method receives a simple message and returns it. - description: |- - The message posted as the id parameter will also be - returned. - operationId: EchoService_Echo5 + - "EchoService" + summary: "Echo method receives a simple message and returns it." + description: "The message posted as the id parameter will also be\nreturned." + operationId: "EchoService_Echo5" parameters: - - name: no.note - in: path + - name: "no.note" + in: "path" required: true - style: simple - explode: false - schema: - type: string - - name: id - in: query - description: Id represents the message identifier. - required: false - style: form - explode: true - schema: - type: string - - name: num - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + x-exportParamName: "NoNote" + - name: "id" + in: "query" + description: "Id represents the message identifier." + required: false + type: "string" + x-exportParamName: "Id" + x-optionalDataType: "String" + - name: "num" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Num" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo_body: post: tags: - - EchoService - summary: EchoBody method receives a simple message and returns it. - operationId: EchoService_EchoBody - requestBody: - description: SimpleMessage represents a simple message sent to the Echo service. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + - "EchoService" + summary: "EchoBody method receives a simple message and returns it." + operationId: "EchoService_EchoBody" + parameters: + - in: "body" + name: "body" + description: "SimpleMessage represents a simple message sent to the Echo service." required: true + schema: + $ref: "#/definitions/examplepbSimpleMessage" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo_body/{id}: put: tags: - - EchoService - summary: EchoBody method receives a simple message and returns it. - operationId: EchoService_EchoBody2 + - "EchoService" + summary: "EchoBody method receives a simple message and returns it." + operationId: "EchoService_EchoBody2" parameters: - - name: id - in: path - description: Id represents the message identifier. + - name: "id" + in: "path" + description: "Id represents the message identifier." required: true - style: simple - explode: false - schema: - type: string - - name: num - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbEmbedded" + type: "string" + x-exportParamName: "Id" + - in: "body" + name: "no" required: true + schema: + $ref: "#/definitions/examplepbEmbedded" + x-exportParamName: "No" + - name: "num" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Num" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: "no" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo_delete: delete: tags: - - EchoService - summary: EchoDelete method receives a simple message and returns it. - operationId: EchoService_EchoDelete + - "EchoService" + summary: "EchoDelete method receives a simple message and returns it." + operationId: "EchoService_EchoDelete" parameters: - - name: id - in: query - description: Id represents the message identifier. - required: false - style: form - explode: true - schema: - type: string - - name: num - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + - name: "id" + in: "query" + description: "Id represents the message identifier." + required: false + type: "string" + x-exportParamName: "Id" + x-optionalDataType: "String" + - name: "num" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Num" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo_patch: patch: tags: - - EchoService - summary: EchoPatch method receives a NonStandardUpdateRequest and returns it. - operationId: EchoService_EchoPatch - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbDynamicMessage" + - "EchoService" + summary: "EchoPatch method receives a NonStandardUpdateRequest and returns it." + operationId: "EchoService_EchoPatch" + parameters: + - in: "body" + name: "body" required: true + schema: + $ref: "#/definitions/examplepbDynamicMessage" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbDynamicMessageUpdate" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbDynamicMessageUpdate" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo_unauthorized: get: tags: - - EchoService - summary: |- - EchoUnauthorized method receives a simple message and returns it. It must - always return a google.rpc.Code of `UNAUTHENTICATED` and a HTTP Status code - of 401. - operationId: EchoService_EchoUnauthorized + - "EchoService" + summary: "EchoUnauthorized method receives a simple message and returns it.\ + \ It must\nalways return a google.rpc.Code of `UNAUTHENTICATED` and a HTTP\ + \ Status code\nof 401." + operationId: "EchoService_EchoUnauthorized" parameters: - - name: id - in: query - description: Id represents the message identifier. - required: false - style: form - explode: true - schema: - type: string - - name: num - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + - name: "id" + in: "query" + description: "Id represents the message identifier." + required: false + type: "string" + x-exportParamName: "Id" + x-optionalDataType: "String" + - name: "num" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "Num" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" -components: - schemas: - examplepbDynamicMessage: - type: object - properties: - structField: - type: object - properties: {} - example: {} - valueField: - type: object - description: |- - DynamicMessage represents a message which can have its structure - built dynamically using Struct and Values. - example: - structField: {} - valueField: {} - examplepbDynamicMessageUpdate: - type: object - properties: - body: - $ref: "#/components/schemas/examplepbDynamicMessage" - updateMask: - type: string - example: - body: - structField: {} - valueField: {} - updateMask: updateMask - examplepbEmbedded: - type: object - properties: - progress: - type: string - format: int64 - note: - type: string - description: Embedded represents a message embedded in SimpleMessage. - example: - note: note - progress: progress - examplepbNestedMessage: - type: object - properties: - nId: - type: string - val: - type: string - example: - val: val - nId: nId - examplepbSimpleMessage: - type: object - properties: - id: - type: string - description: Id represents the message identifier. - num: - type: string - format: int64 - lineNum: - type: string - format: int64 - lang: - type: string - status: - $ref: "#/components/schemas/examplepbEmbedded" - en: - type: string - format: int64 - "no": - $ref: "#/components/schemas/examplepbEmbedded" - resourceId: - type: string - nId: - $ref: "#/components/schemas/examplepbNestedMessage" - description: SimpleMessage represents a simple message sent to the Echo service. - example: - "no": null - resourceId: resourceId - num: num - nId: - val: val - nId: nId - lineNum: lineNum - en: en - id: id - lang: lang - status: - note: note - progress: progress - protobufAny: - type: object - properties: - '@type': - type: string - description: |- - A URL/resource name that uniquely identifies the type of the serialized - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must represent - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a canonical form - (e.g., leading "." is not accepted). - - In practice, teams usually precompile into the binary all types that they - expect it to use in the context of Any. However, for URLs which use the - scheme `http`, `https`, or no scheme, one can optionally set up a type - server that maps type URLs to message definitions as follows: - - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the official - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. As of May 2023, there are no widely used type server - implementations and no plans to implement one. - - Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - additionalProperties: - type: object - description: |- - `Any` contains an arbitrary serialized protocol buffer message along with a - URL that describes the type of the serialized message. - - Protobuf library provides support to pack/unpack Any values in the form - of utility functions or additional generated methods of the Any type. - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". - - JSON - ==== - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - x-schema-name: protobufAny - protobufNullValue: - type: string - description: |- - `NullValue` is a singleton enumeration to represent the null value for the - `Value` type union. - - The JSON representation for `NullValue` is JSON `null`. - - - NULL_VALUE: Null value. - enum: - - NULL_VALUE - default: NULL_VALUE - rpcStatus: - type: object - properties: - code: - type: integer - description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - format: int32 - message: - type: string - description: |- - A developer-facing error message, which should be in English. Any - user-facing error message should be localized and sent in the - [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - details: - type: array - description: |- - A list of messages that carry the error details. There is a common set of - message types for APIs to use. - items: - $ref: "#/components/schemas/protobufAny" - description: |- - The `Status` type defines a logical error model that is suitable for - different programming environments, including REST APIs and RPC APIs. It is - used by [gRPC](https://github.com/grpc). Each `Status` message contains - three pieces of data: error code, error message, and error details. - - You can find out more about this error model and how to work with it in the - [API Design Guide](https://cloud.google.com/apis/design/errors). -x-original-swagger-version: "2.0" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" +definitions: + examplepbDynamicMessage: + type: "object" + properties: + structField: + type: "object" + properties: {} + valueField: {} + description: "DynamicMessage represents a message which can have its structure\n\ + built dynamically using Struct and Values." + example: + structField: "{}" + valueField: "" + examplepbDynamicMessageUpdate: + type: "object" + properties: + body: + $ref: "#/definitions/examplepbDynamicMessage" + updateMask: + type: "string" + example: + body: + structField: "{}" + valueField: "" + updateMask: "updateMask" + examplepbEmbedded: + type: "object" + properties: + progress: + type: "string" + format: "int64" + note: + type: "string" + description: "Embedded represents a message embedded in SimpleMessage." + example: + note: "note" + progress: "progress" + examplepbNestedMessage: + type: "object" + properties: + nId: + type: "string" + val: + type: "string" + example: + val: "val" + nId: "nId" + examplepbSimpleMessage: + type: "object" + properties: + id: + type: "string" + description: "Id represents the message identifier." + num: + type: "string" + format: "int64" + lineNum: + type: "string" + format: "int64" + lang: + type: "string" + status: + $ref: "#/definitions/examplepbEmbedded" + en: + type: "string" + format: "int64" + "no": + $ref: "#/definitions/examplepbEmbedded" + resourceId: + type: "string" + nId: + $ref: "#/definitions/examplepbNestedMessage" + description: "SimpleMessage represents a simple message sent to the Echo service." + example: + "no": + note: "note" + progress: "progress" + resourceId: "resourceId" + num: "num" + nId: + val: "val" + nId: "nId" + lineNum: "lineNum" + en: "en" + id: "id" + lang: "lang" + status: + note: "note" + progress: "progress" + protobufAny: + type: "object" + properties: + '@type': + type: "string" + description: "A URL/resource name that uniquely identifies the type of the\ + \ serialized\nprotocol buffer message. This string must contain at least\n\ + one \"/\" character. The last segment of the URL's path must represent\n\ + the fully qualified name of the type (as in\n`path/google.protobuf.Duration`).\ + \ The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\ + \nIn practice, teams usually precompile into the binary all types that they\n\ + expect it to use in the context of Any. However, for URLs which use the\n\ + scheme `http`, `https`, or no scheme, one can optionally set up a type\n\ + server that maps type URLs to message definitions as follows:\n\n* If no\ + \ scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must\ + \ yield a [google.protobuf.Type][]\n value in binary format, or produce\ + \ an error.\n* Applications are allowed to cache lookup results based on\ + \ the\n URL, or have them precompiled into a binary to avoid any\n lookup.\ + \ Therefore, binary compatibility needs to be preserved\n on changes to\ + \ types. (Use versioned type names to manage\n breaking changes.)\n\nNote:\ + \ this functionality is not currently available in the official\nprotobuf\ + \ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\ + \ As of May 2023, there are no widely used type server\nimplementations\ + \ and no plans to implement one.\n\nSchemes other than `http`, `https` (or\ + \ the empty scheme) might be\nused with implementation specific semantics." + description: "`Any` contains an arbitrary serialized protocol buffer message along\ + \ with a\nURL that describes the type of the serialized message.\n\nProtobuf\ + \ library provides support to pack/unpack Any values in the form\nof utility\ + \ functions or additional generated methods of the Any type.\n\nExample 1: Pack\ + \ and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n\ + \ ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack\ + \ and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n\ + \ ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n\ + \ }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n\ + \ foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack\ + \ and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n \ + \ any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n\ + \ ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n\ + \ any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n\ + \ ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err !=\ + \ nil {\n ...\n }\n\nThe pack methods provided by protobuf library\ + \ will by default use\n'type.googleapis.com/full.type.name' as the type URL\ + \ and the unpack\nmethods only use the fully qualified type name after the last\ + \ '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\ + name \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses\ + \ the regular\nrepresentation of the deserialized, embedded message, with an\n\ + additional field `@type` which contains the type URL. Example:\n\n package\ + \ google.profile;\n message Person {\n string first_name = 1;\n \ + \ string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\ + ,\n \"firstName\": ,\n \"lastName\": \n }\n\nIf\ + \ the embedded message type is well-known and has a custom JSON\nrepresentation,\ + \ that representation will be embedded adding a field\n`value` which holds the\ + \ custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\ + \n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n\ + \ \"value\": \"1.212s\"\n }" + additionalProperties: {} + protobufNullValue: + type: "string" + description: "`NullValue` is a singleton enumeration to represent the null value\ + \ for the\n`Value` type union.\n\nThe JSON representation for `NullValue` is\ + \ JSON `null`.\n\n - NULL_VALUE: Null value." + enum: + - "NULL_VALUE" + default: "NULL_VALUE" + rpcStatus: + type: "object" + properties: + code: + type: "integer" + format: "int32" + description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." + message: + type: "string" + description: "A developer-facing error message, which should be in English.\ + \ Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details]\ + \ field, or localized by the client." + details: + type: "array" + description: "A list of messages that carry the error details. There is a\ + \ common set of\nmessage types for APIs to use." + items: + $ref: "#/definitions/protobufAny" + description: "The `Status` type defines a logical error model that is suitable\ + \ for\ndifferent programming environments, including REST APIs and RPC APIs.\ + \ It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\n\ + three pieces of data: error code, error message, and error details.\n\nYou can\ + \ find out more about this error model and how to work with it in the\n[API\ + \ Design Guide](https://cloud.google.com/apis/design/errors)." diff --git a/examples/internal/clients/echo/api_echo_service.go b/examples/internal/clients/echo/api_echo_service.go index 4f3b2a46cfd..d4c74e6e66e 100644 --- a/examples/internal/clients/echo/api_echo_service.go +++ b/examples/internal/clients/echo/api_echo_service.go @@ -7,6 +7,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo import ( @@ -25,6 +26,7 @@ var ( ) type EchoServiceApiService service + /* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. @@ -42,21 +44,22 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEchoOpts struct { - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEchoOpts struct { + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, localVarOptionals *EchoServiceApiEchoServiceEchoOpts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -110,7 +113,7 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -145,9 +148,7 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -155,6 +156,7 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -165,6 +167,7 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -175,11 +178,13 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. @@ -197,20 +202,21 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEcho2Opts struct { - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho2Opts struct { + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, num string, localVarOptionals *EchoServiceApiEchoServiceEcho2Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -262,7 +268,7 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -297,9 +303,7 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -307,6 +311,7 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -317,6 +322,7 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -327,11 +333,13 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. @@ -349,19 +357,20 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEcho3Opts struct { - LineNum optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho3Opts struct { + LineNum optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, num string, lang string, localVarOptionals *EchoServiceApiEchoServiceEcho3Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -411,7 +420,7 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -446,9 +455,7 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -456,6 +463,7 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -466,6 +474,7 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -476,11 +485,13 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. @@ -497,18 +508,19 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEcho4Opts struct { - Num optional.String - Lang optional.String - StatusProgress optional.String - En optional.String - NoProgress optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho4Opts struct { + Num optional.String + Lang optional.String + StatusProgress optional.String + En optional.String + NoProgress optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, lineNum string, statusNote string, localVarOptionals *EchoServiceApiEchoServiceEcho4Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -555,7 +567,7 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -590,9 +602,7 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -600,6 +610,7 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -610,6 +621,7 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -620,11 +632,13 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. @@ -641,20 +655,21 @@ The message posted as the id parameter will also be returned. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEcho5Opts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - En optional.String - NoProgress optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho5Opts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + En optional.String + NoProgress optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote string, localVarOptionals *EchoServiceApiEchoServiceEcho5Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -705,7 +720,7 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -740,9 +755,7 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -750,6 +763,7 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -760,6 +774,7 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -770,11 +785,13 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. @@ -792,21 +809,22 @@ The message posted as the id parameter will also be returned. * @param "NoNote" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEcho6Opts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho6Opts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + NIdNId optional.String + NIdVal optional.String } func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId string, localVarOptionals *EchoServiceApiEchoServiceEcho6Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -860,7 +878,7 @@ func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -895,9 +913,7 @@ func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -905,6 +921,7 @@ func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -915,6 +932,7 @@ func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -925,11 +943,13 @@ func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. @@ -947,21 +967,22 @@ The message posted as the id parameter will also be returned. * @param "NoNote" (optional.String) - * @param "ResourceId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEcho7Opts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEcho7Opts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdVal optional.String } func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId string, localVarOptionals *EchoServiceApiEchoServiceEcho7Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -1015,7 +1036,7 @@ func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId str localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1050,9 +1071,7 @@ func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId str if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1060,6 +1079,7 @@ func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId str body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1070,6 +1090,7 @@ func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1080,15 +1101,18 @@ func (a *EchoServiceApiService) EchoServiceEcho7(ctx context.Context, nIdNId str newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService EchoBody method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body SimpleMessage represents a simple message sent to the Echo service. + @return ExamplepbSimpleMessage */ func (a *EchoServiceApiService) EchoServiceEchoBody(ctx context.Context, body ExamplepbSimpleMessage) (ExamplepbSimpleMessage, *http.Response, error) { @@ -1145,9 +1169,7 @@ func (a *EchoServiceApiService) EchoServiceEchoBody(ctx context.Context, body Ex if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1155,6 +1177,7 @@ func (a *EchoServiceApiService) EchoServiceEchoBody(ctx context.Context, body Ex body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1165,6 +1188,7 @@ func (a *EchoServiceApiService) EchoServiceEchoBody(ctx context.Context, body Ex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1175,16 +1199,18 @@ func (a *EchoServiceApiService) EchoServiceEchoBody(ctx context.Context, body Ex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService EchoBody method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body * @param id Id represents the message identifier. + * @param no * @param optional nil or *EchoServiceApiEchoServiceEchoBody2Opts - Optional Parameters: * @param "Num" (optional.String) - * @param "LineNum" (optional.String) - @@ -1194,21 +1220,22 @@ EchoServiceApiService EchoBody method receives a simple message and returns it. * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEchoBody2Opts struct { - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEchoBody2Opts struct { + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } -func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, body ExamplepbEmbedded, id string, localVarOptionals *EchoServiceApiEchoServiceEchoBody2Opts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, id string, no ExamplepbEmbedded, localVarOptionals *EchoServiceApiEchoServiceEchoBody2Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -1267,7 +1294,7 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, body E localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params - localVarPostBody = &body + localVarPostBody = &no r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -1287,9 +1314,7 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, body E if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1297,6 +1322,7 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, body E body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1307,6 +1333,7 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, body E newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1317,11 +1344,13 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, body E newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService EchoDelete method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1338,22 +1367,23 @@ EchoServiceApiService EchoDelete method receives a simple message and returns it * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEchoDeleteOpts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEchoDeleteOpts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, localVarOptionals *EchoServiceApiEchoServiceEchoDeleteOpts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -1409,7 +1439,7 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1444,9 +1474,7 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1454,6 +1482,7 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1464,6 +1493,7 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1474,15 +1504,18 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService EchoPatch method receives a NonStandardUpdateRequest and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body + @return ExamplepbDynamicMessageUpdate */ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body ExamplepbDynamicMessage) (ExamplepbDynamicMessageUpdate, *http.Response, error) { @@ -1539,9 +1572,7 @@ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body E if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1549,6 +1580,7 @@ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body E body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbDynamicMessageUpdate err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1559,6 +1591,7 @@ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body E newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1569,11 +1602,13 @@ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body E newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* EchoServiceApiService EchoUnauthorized method receives a simple message and returns it. It must always return a google.rpc.Code of `UNAUTHENTICATED` and a HTTP Status code of 401. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1590,22 +1625,23 @@ EchoServiceApiService EchoUnauthorized method receives a simple message and retu * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbSimpleMessage */ -type EchoServiceApiEchoServiceEchoUnauthorizedOpts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type EchoServiceApiEchoServiceEchoUnauthorizedOpts struct { + Id optional.String + Num optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, localVarOptionals *EchoServiceApiEchoServiceEchoUnauthorizedOpts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -1661,7 +1697,7 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -1696,9 +1732,7 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -1706,6 +1740,7 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1716,6 +1751,7 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -1726,8 +1762,10 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/examples/internal/clients/echo/client.go b/examples/internal/clients/echo/client.go index 562ee4166ff..0cd38eb1ce7 100644 --- a/examples/internal/clients/echo/client.go +++ b/examples/internal/clients/echo/client.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo import ( @@ -32,8 +33,8 @@ import ( ) var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") ) // APIClient manages communication with the Echo Service API vversion not set diff --git a/examples/internal/clients/echo/configuration.go b/examples/internal/clients/echo/configuration.go index 89d6931a32c..6a44e4c9cf6 100644 --- a/examples/internal/clients/echo/configuration.go +++ b/examples/internal/clients/echo/configuration.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo import ( @@ -59,7 +60,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "/", + BasePath: "https://localhost", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/echo/model_examplepb_dynamic_message.go b/examples/internal/clients/echo/model_examplepb_dynamic_message.go index 3f113c64248..ca1ce728781 100644 --- a/examples/internal/clients/echo/model_examplepb_dynamic_message.go +++ b/examples/internal/clients/echo/model_examplepb_dynamic_message.go @@ -6,10 +6,11 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo // DynamicMessage represents a message which can have its structure built dynamically using Struct and Values. type ExamplepbDynamicMessage struct { - StructField *interface{} `json:"structField,omitempty"` - ValueField *interface{} `json:"valueField,omitempty"` + StructField interface{} `json:"structField,omitempty"` + ValueField interface{} `json:"valueField,omitempty"` } diff --git a/examples/internal/clients/echo/model_examplepb_dynamic_message_update.go b/examples/internal/clients/echo/model_examplepb_dynamic_message_update.go index 71d571ddd67..086ab7c045e 100644 --- a/examples/internal/clients/echo/model_examplepb_dynamic_message_update.go +++ b/examples/internal/clients/echo/model_examplepb_dynamic_message_update.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo type ExamplepbDynamicMessageUpdate struct { diff --git a/examples/internal/clients/echo/model_examplepb_embedded.go b/examples/internal/clients/echo/model_examplepb_embedded.go index 4f40a5a8dca..7f6ff8a7848 100644 --- a/examples/internal/clients/echo/model_examplepb_embedded.go +++ b/examples/internal/clients/echo/model_examplepb_embedded.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo // Embedded represents a message embedded in SimpleMessage. diff --git a/examples/internal/clients/echo/model_examplepb_nested_message.go b/examples/internal/clients/echo/model_examplepb_nested_message.go index db91506bfeb..fc20b232123 100644 --- a/examples/internal/clients/echo/model_examplepb_nested_message.go +++ b/examples/internal/clients/echo/model_examplepb_nested_message.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo type ExamplepbNestedMessage struct { diff --git a/examples/internal/clients/echo/model_examplepb_simple_message.go b/examples/internal/clients/echo/model_examplepb_simple_message.go index 84c99d6b5d8..c6e66072a0a 100644 --- a/examples/internal/clients/echo/model_examplepb_simple_message.go +++ b/examples/internal/clients/echo/model_examplepb_simple_message.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo // SimpleMessage represents a simple message sent to the Echo service. diff --git a/examples/internal/clients/echo/model_protobuf_null_value.go b/examples/internal/clients/echo/model_protobuf_null_value.go index 309cf777c1b..1f7188c2187 100644 --- a/examples/internal/clients/echo/model_protobuf_null_value.go +++ b/examples/internal/clients/echo/model_protobuf_null_value.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo // ProtobufNullValue : `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. type ProtobufNullValue string diff --git a/examples/internal/clients/echo/model_rpc_status.go b/examples/internal/clients/echo/model_rpc_status.go index 07e8704ce7e..f87184fd029 100644 --- a/examples/internal/clients/echo/model_rpc_status.go +++ b/examples/internal/clients/echo/model_rpc_status.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo // The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). @@ -15,5 +16,5 @@ type RpcStatus struct { // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. Message string `json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of message types for APIs to use. - Details []map[string]interface{} `json:"details,omitempty"` + Details []ProtobufAny `json:"details,omitempty"` } diff --git a/examples/internal/clients/echo/response.go b/examples/internal/clients/echo/response.go index 08b1ed02a87..a82295589de 100644 --- a/examples/internal/clients/echo/response.go +++ b/examples/internal/clients/echo/response.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package echo import ( diff --git a/examples/internal/clients/generateunboundmethods/.swagger-codegen/VERSION b/examples/internal/clients/generateunboundmethods/.swagger-codegen/VERSION index b61c49d271a..a932b445646 100644 --- a/examples/internal/clients/generateunboundmethods/.swagger-codegen/VERSION +++ b/examples/internal/clients/generateunboundmethods/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.71 \ No newline at end of file +2.4.47-SNAPSHOT \ No newline at end of file diff --git a/examples/internal/clients/generateunboundmethods/api/swagger.yaml b/examples/internal/clients/generateunboundmethods/api/swagger.yaml index e36e8498bb2..f009353d62a 100644 --- a/examples/internal/clients/generateunboundmethods/api/swagger.yaml +++ b/examples/internal/clients/generateunboundmethods/api/swagger.yaml @@ -1,142 +1,124 @@ -openapi: 3.0.1 +--- +swagger: "2.0" info: - title: examples/internal/proto/examplepb/generate_unbound_methods.proto - description: |- - Generate Unannotated Methods Echo Service - Similar to echo_service.proto but without annotations and without external configuration. - - Generate Unannotated Methods Echo Service API consists of a single service which returns - a message. - version: version not set -servers: -- url: / + description: "Generate Unannotated Methods Echo Service\nSimilar to echo_service.proto\ + \ but without annotations and without external configuration.\n\nGenerate Unannotated\ + \ Methods Echo Service API consists of a single service which returns\na message." + version: "version not set" + title: "examples/internal/proto/examplepb/generate_unbound_methods.proto" tags: -- name: GenerateUnboundMethodsEchoService +- name: "GenerateUnboundMethodsEchoService" +consumes: +- "application/json" +produces: +- "application/json" paths: /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/Echo: post: tags: - - GenerateUnboundMethodsEchoService - summary: Echo method receives a simple message and returns it. - description: |- - The message posted as the id parameter will also be - returned. - operationId: GenerateUnboundMethodsEchoService_Echo - requestBody: - description: GenerateUnboundMethodsSimpleMessage represents a simple message - sent to the unannotated GenerateUnboundMethodsEchoService service. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" + - "GenerateUnboundMethodsEchoService" + summary: "Echo method receives a simple message and returns it." + description: "The message posted as the id parameter will also be\nreturned." + operationId: "GenerateUnboundMethodsEchoService_Echo" + parameters: + - in: "body" + name: "body" + description: "GenerateUnboundMethodsSimpleMessage represents a simple message\ + \ sent to the unannotated GenerateUnboundMethodsEchoService service." required: true + schema: + $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/EchoBody: post: tags: - - GenerateUnboundMethodsEchoService - summary: EchoBody method receives a simple message and returns it. - operationId: GenerateUnboundMethodsEchoService_EchoBody - requestBody: - description: GenerateUnboundMethodsSimpleMessage represents a simple message - sent to the unannotated GenerateUnboundMethodsEchoService service. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" + - "GenerateUnboundMethodsEchoService" + summary: "EchoBody method receives a simple message and returns it." + operationId: "GenerateUnboundMethodsEchoService_EchoBody" + parameters: + - in: "body" + name: "body" + description: "GenerateUnboundMethodsSimpleMessage represents a simple message\ + \ sent to the unannotated GenerateUnboundMethodsEchoService service." required: true + schema: + $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/EchoDelete: post: tags: - - GenerateUnboundMethodsEchoService - summary: EchoDelete method receives a simple message and returns it. - operationId: GenerateUnboundMethodsEchoService_EchoDelete - requestBody: - description: GenerateUnboundMethodsSimpleMessage represents a simple message - sent to the unannotated GenerateUnboundMethodsEchoService service. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" + - "GenerateUnboundMethodsEchoService" + summary: "EchoDelete method receives a simple message and returns it." + operationId: "GenerateUnboundMethodsEchoService_EchoDelete" + parameters: + - in: "body" + name: "body" + description: "GenerateUnboundMethodsSimpleMessage represents a simple message\ + \ sent to the unannotated GenerateUnboundMethodsEchoService service." required: true + schema: + $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbGenerateUnboundMethodsSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbGenerateUnboundMethodsSimpleMessage" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body -components: - schemas: - examplepbGenerateUnboundMethodsSimpleMessage: - type: object - properties: - id: - type: string - description: Id represents the message identifier. - num: - type: string - format: int64 - duration: - type: string - description: GenerateUnboundMethodsSimpleMessage represents a simple message - sent to the unannotated GenerateUnboundMethodsEchoService service. - example: - duration: duration - num: num - id: id - protobufAny: - type: object - properties: - '@type': - type: string - additionalProperties: - type: object - x-schema-name: protobufAny - rpcStatus: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - $ref: "#/components/schemas/protobufAny" -x-original-swagger-version: "2.0" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" +definitions: + examplepbGenerateUnboundMethodsSimpleMessage: + type: "object" + properties: + id: + type: "string" + description: "Id represents the message identifier." + num: + type: "string" + format: "int64" + duration: + type: "string" + description: "GenerateUnboundMethodsSimpleMessage represents a simple message\ + \ sent to the unannotated GenerateUnboundMethodsEchoService service." + example: + duration: "duration" + num: "num" + id: "id" + protobufAny: + type: "object" + properties: + '@type': + type: "string" + additionalProperties: {} + rpcStatus: + type: "object" + properties: + code: + type: "integer" + format: "int32" + message: + type: "string" + details: + type: "array" + items: + $ref: "#/definitions/protobufAny" diff --git a/examples/internal/clients/generateunboundmethods/api_generate_unbound_methods_echo_service.go b/examples/internal/clients/generateunboundmethods/api_generate_unbound_methods_echo_service.go index 78d98a0f52b..42c4d6c56be 100644 --- a/examples/internal/clients/generateunboundmethods/api_generate_unbound_methods_echo_service.go +++ b/examples/internal/clients/generateunboundmethods/api_generate_unbound_methods_echo_service.go @@ -7,6 +7,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package generateunboundmethods import ( @@ -23,11 +24,13 @@ var ( ) type GenerateUnboundMethodsEchoServiceApiService service + /* GenerateUnboundMethodsEchoServiceApiService Echo method receives a simple message and returns it. The message posted as the id parameter will also be returned. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body GenerateUnboundMethodsSimpleMessage represents a simple message sent to the unannotated GenerateUnboundMethodsEchoService service. + @return ExamplepbGenerateUnboundMethodsSimpleMessage */ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEchoServiceEcho(ctx context.Context, body ExamplepbGenerateUnboundMethodsSimpleMessage) (ExamplepbGenerateUnboundMethodsSimpleMessage, *http.Response, error) { @@ -84,9 +87,7 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -94,6 +95,7 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbGenerateUnboundMethodsSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -104,6 +106,7 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -114,15 +117,18 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* GenerateUnboundMethodsEchoServiceApiService EchoBody method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body GenerateUnboundMethodsSimpleMessage represents a simple message sent to the unannotated GenerateUnboundMethodsEchoService service. + @return ExamplepbGenerateUnboundMethodsSimpleMessage */ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEchoServiceEchoBody(ctx context.Context, body ExamplepbGenerateUnboundMethodsSimpleMessage) (ExamplepbGenerateUnboundMethodsSimpleMessage, *http.Response, error) { @@ -179,9 +185,7 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -189,6 +193,7 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbGenerateUnboundMethodsSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -199,6 +204,7 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -209,15 +215,18 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* GenerateUnboundMethodsEchoServiceApiService EchoDelete method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body GenerateUnboundMethodsSimpleMessage represents a simple message sent to the unannotated GenerateUnboundMethodsEchoService service. + @return ExamplepbGenerateUnboundMethodsSimpleMessage */ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEchoServiceEchoDelete(ctx context.Context, body ExamplepbGenerateUnboundMethodsSimpleMessage) (ExamplepbGenerateUnboundMethodsSimpleMessage, *http.Response, error) { @@ -274,9 +283,7 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -284,6 +291,7 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbGenerateUnboundMethodsSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -294,6 +302,7 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -304,8 +313,10 @@ func (a *GenerateUnboundMethodsEchoServiceApiService) GenerateUnboundMethodsEcho newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/examples/internal/clients/generateunboundmethods/client.go b/examples/internal/clients/generateunboundmethods/client.go index 58fa91d1a08..216efec3f13 100644 --- a/examples/internal/clients/generateunboundmethods/client.go +++ b/examples/internal/clients/generateunboundmethods/client.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package generateunboundmethods import ( @@ -32,8 +33,8 @@ import ( ) var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") ) // APIClient manages communication with the examples/internal/proto/examplepb/generate_unbound_methods.proto API vversion not set diff --git a/examples/internal/clients/generateunboundmethods/configuration.go b/examples/internal/clients/generateunboundmethods/configuration.go index edbdbb9919d..1a0022dd7d8 100644 --- a/examples/internal/clients/generateunboundmethods/configuration.go +++ b/examples/internal/clients/generateunboundmethods/configuration.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package generateunboundmethods import ( @@ -59,7 +60,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "/", + BasePath: "https://localhost", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/generateunboundmethods/docs/ExamplepbGenerateUnboundMethodsSimpleMessage.md b/examples/internal/clients/generateunboundmethods/docs/ExamplepbGenerateUnboundMethodsSimpleMessage.md index fdb3935b3b7..aba65365948 100644 --- a/examples/internal/clients/generateunboundmethods/docs/ExamplepbGenerateUnboundMethodsSimpleMessage.md +++ b/examples/internal/clients/generateunboundmethods/docs/ExamplepbGenerateUnboundMethodsSimpleMessage.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/generateunboundmethods/docs/GenerateUnboundMethodsEchoServiceApi.md b/examples/internal/clients/generateunboundmethods/docs/GenerateUnboundMethodsEchoServiceApi.md index 98d0e93967e..58446c8c6a8 100644 --- a/examples/internal/clients/generateunboundmethods/docs/GenerateUnboundMethodsEchoServiceApi.md +++ b/examples/internal/clients/generateunboundmethods/docs/GenerateUnboundMethodsEchoServiceApi.md @@ -1,6 +1,6 @@ -# {{classname}} +# \GenerateUnboundMethodsEchoServiceApi -All URIs are relative to */* +All URIs are relative to *https://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -8,6 +8,7 @@ Method | HTTP request | Description [**GenerateUnboundMethodsEchoServiceEchoBody**](GenerateUnboundMethodsEchoServiceApi.md#GenerateUnboundMethodsEchoServiceEchoBody) | **Post** /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/EchoBody | EchoBody method receives a simple message and returns it. [**GenerateUnboundMethodsEchoServiceEchoDelete**](GenerateUnboundMethodsEchoServiceApi.md#GenerateUnboundMethodsEchoServiceEchoDelete) | **Post** /grpc.gateway.examples.internal.proto.examplepb.GenerateUnboundMethodsEchoService/EchoDelete | EchoDelete method receives a simple message and returns it. + # **GenerateUnboundMethodsEchoServiceEcho** > ExamplepbGenerateUnboundMethodsSimpleMessage GenerateUnboundMethodsEchoServiceEcho(ctx, body) Echo method receives a simple message and returns it. diff --git a/examples/internal/clients/generateunboundmethods/model_examplepb_generate_unbound_methods_simple_message.go b/examples/internal/clients/generateunboundmethods/model_examplepb_generate_unbound_methods_simple_message.go index b35840b9220..9f884625983 100644 --- a/examples/internal/clients/generateunboundmethods/model_examplepb_generate_unbound_methods_simple_message.go +++ b/examples/internal/clients/generateunboundmethods/model_examplepb_generate_unbound_methods_simple_message.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package generateunboundmethods // GenerateUnboundMethodsSimpleMessage represents a simple message sent to the unannotated GenerateUnboundMethodsEchoService service. diff --git a/examples/internal/clients/generateunboundmethods/model_rpc_status.go b/examples/internal/clients/generateunboundmethods/model_rpc_status.go index 70351bfbf6f..c1054032159 100644 --- a/examples/internal/clients/generateunboundmethods/model_rpc_status.go +++ b/examples/internal/clients/generateunboundmethods/model_rpc_status.go @@ -6,10 +6,11 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package generateunboundmethods type RpcStatus struct { Code int32 `json:"code,omitempty"` Message string `json:"message,omitempty"` - Details []map[string]interface{} `json:"details,omitempty"` + Details []ProtobufAny `json:"details,omitempty"` } diff --git a/examples/internal/clients/generateunboundmethods/response.go b/examples/internal/clients/generateunboundmethods/response.go index e0729288127..a4a4c064884 100644 --- a/examples/internal/clients/generateunboundmethods/response.go +++ b/examples/internal/clients/generateunboundmethods/response.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package generateunboundmethods import ( diff --git a/examples/internal/clients/responsebody/.swagger-codegen/VERSION b/examples/internal/clients/responsebody/.swagger-codegen/VERSION index b61c49d271a..a932b445646 100644 --- a/examples/internal/clients/responsebody/.swagger-codegen/VERSION +++ b/examples/internal/clients/responsebody/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.71 \ No newline at end of file +2.4.47-SNAPSHOT \ No newline at end of file diff --git a/examples/internal/clients/responsebody/api/swagger.yaml b/examples/internal/clients/responsebody/api/swagger.yaml index 7e2d29ce20c..cc601983ad9 100644 --- a/examples/internal/clients/responsebody/api/swagger.yaml +++ b/examples/internal/clients/responsebody/api/swagger.yaml @@ -1,375 +1,270 @@ -openapi: 3.0.1 +--- +swagger: "2.0" info: - title: examples/internal/proto/examplepb/response_body_service.proto - version: version not set -servers: -- url: / + version: "version not set" + title: "examples/internal/proto/examplepb/response_body_service.proto" tags: -- name: ResponseBodyService +- name: "ResponseBodyService" +consumes: +- "application/json" +produces: +- "application/json" paths: /responsebodies/{data}: get: tags: - - ResponseBodyService - operationId: ResponseBodyService_ListResponseBodies + - "ResponseBodyService" + operationId: "ResponseBodyService_ListResponseBodies" parameters: - - name: data - in: path + - name: "data" + in: "path" required: true - style: simple - explode: false - schema: - type: string + type: "string" + x-exportParamName: "Data" responses: "200": description: "" - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/examplepbRepeatedResponseBodyOutResponse" - x-content-type: application/json + schema: + type: "array" + items: + $ref: "#/definitions/examplepbRepeatedResponseBodyOutResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /responsebody/samename/{data}: get: tags: - - ResponseBodyService - operationId: ResponseBodyService_GetResponseBodySameName + - "ResponseBodyService" + operationId: "ResponseBodyService_GetResponseBodySameName" parameters: - - name: data - in: path + - name: "data" + in: "path" required: true - style: simple - explode: false - schema: - type: string + type: "string" + x-exportParamName: "Data" responses: "200": description: "" - content: - application/json: - schema: - type: string - x-content-type: application/json + schema: + type: "string" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /responsebody/stream/{data}: get: tags: - - ResponseBodyService - operationId: ResponseBodyService_GetResponseBodyStream + - "ResponseBodyService" + operationId: "ResponseBodyService_GetResponseBodyStream" parameters: - - name: data - in: path + - name: "data" + in: "path" required: true - style: simple - explode: false - schema: - type: string + type: "string" + x-exportParamName: "Data" responses: "200": - description: (streaming responses) - content: - application/json: - schema: - $ref: "#/components/schemas/Stream result of examplepbResponseBodyOut" + description: "(streaming responses)" + schema: + $ref: "#/definitions/Stream result of examplepbResponseBodyOut" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /responsebody/{data}: get: tags: - - ResponseBodyService - operationId: ResponseBodyService_GetResponseBody + - "ResponseBodyService" + operationId: "ResponseBodyService_GetResponseBody" parameters: - - name: data - in: path + - name: "data" + in: "path" required: true - style: simple - explode: false - schema: - type: string + type: "string" + x-exportParamName: "Data" responses: "200": description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbResponseBodyOutResponse" + schema: + $ref: "#/definitions/examplepbResponseBodyOutResponse" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /responsestrings/{data}: get: tags: - - ResponseBodyService - operationId: ResponseBodyService_ListResponseStrings + - "ResponseBodyService" + operationId: "ResponseBodyService_ListResponseStrings" parameters: - - name: data - in: path + - name: "data" + in: "path" required: true - style: simple - explode: false - schema: - type: string + type: "string" + x-exportParamName: "Data" responses: "200": description: "" - content: - application/json: - schema: - type: array - items: - type: string - x-content-type: application/json + schema: + type: "array" + items: + type: "string" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" -components: - schemas: - ResponseResponseType: - title: |- - - UNKNOWN: UNKNOWN - - A: A is 1 - - B: B is 2 - type: string - enum: - - UNKNOWN - - A - - B - default: UNKNOWN - examplepbRepeatedResponseBodyOut: - type: object - properties: - response: - type: array - items: - $ref: "#/components/schemas/examplepbRepeatedResponseBodyOutResponse" - examplepbRepeatedResponseBodyOutResponse: - type: object - properties: - data: - type: string - type: - $ref: "#/components/schemas/ResponseResponseType" - example: - data: data - type: UNKNOWN - examplepbRepeatedResponseStrings: - type: object - properties: - values: - type: array - items: - type: string - examplepbResponseBodyOut: - type: object - properties: - response: - $ref: "#/components/schemas/examplepbResponseBodyOutResponse" - examplepbResponseBodyOutResponse: - type: object - properties: - data: - type: string - example: - data: data - examplepbResponseBodyValue: - type: object - properties: - responseBodyValue: - type: string - protobufAny: - type: object - properties: - '@type': - type: string - description: |- - A URL/resource name that uniquely identifies the type of the serialized - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must represent - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a canonical form - (e.g., leading "." is not accepted). - - In practice, teams usually precompile into the binary all types that they - expect it to use in the context of Any. However, for URLs which use the - scheme `http`, `https`, or no scheme, one can optionally set up a type - server that maps type URLs to message definitions as follows: - - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the official - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. As of May 2023, there are no widely used type server - implementations and no plans to implement one. - - Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - additionalProperties: - type: object - description: |- - `Any` contains an arbitrary serialized protocol buffer message along with a - URL that describes the type of the serialized message. - - Protobuf library provides support to pack/unpack Any values in the form - of utility functions or additional generated methods of the Any type. - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". - - JSON - ==== - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - x-schema-name: protobufAny - rpcStatus: - type: object - properties: - code: - type: integer - description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - format: int32 - message: - type: string - description: |- - A developer-facing error message, which should be in English. Any - user-facing error message should be localized and sent in the - [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - details: - type: array - description: |- - A list of messages that carry the error details. There is a common set of - message types for APIs to use. - items: - $ref: "#/components/schemas/protobufAny" - description: |- - The `Status` type defines a logical error model that is suitable for - different programming environments, including REST APIs and RPC APIs. It is - used by [gRPC](https://github.com/grpc). Each `Status` message contains - three pieces of data: error code, error message, and error details. - - You can find out more about this error model and how to work with it in the - [API Design Guide](https://cloud.google.com/apis/design/errors). - example: + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" +definitions: + ResponseResponseType: + type: "string" + title: "- UNKNOWN: UNKNOWN\n - A: A is 1\n - B: B is 2" + enum: + - "UNKNOWN" + - "A" + - "B" + default: "UNKNOWN" + examplepbRepeatedResponseBodyOut: + type: "object" + properties: + response: + type: "array" + items: + $ref: "#/definitions/examplepbRepeatedResponseBodyOutResponse" + examplepbRepeatedResponseBodyOutResponse: + type: "object" + properties: + data: + type: "string" + type: + $ref: "#/definitions/ResponseResponseType" + example: + data: "data" + type: {} + examplepbRepeatedResponseStrings: + type: "object" + properties: + values: + type: "array" + items: + type: "string" + examplepbResponseBodyOut: + type: "object" + properties: + response: + $ref: "#/definitions/examplepbResponseBodyOutResponse" + examplepbResponseBodyOutResponse: + type: "object" + properties: + data: + type: "string" + example: + data: "data" + examplepbResponseBodyValue: + type: "object" + properties: + responseBodyValue: + type: "string" + protobufAny: + type: "object" + properties: + '@type': + type: "string" + description: "A URL/resource name that uniquely identifies the type of the\ + \ serialized\nprotocol buffer message. This string must contain at least\n\ + one \"/\" character. The last segment of the URL's path must represent\n\ + the fully qualified name of the type (as in\n`path/google.protobuf.Duration`).\ + \ The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\ + \nIn practice, teams usually precompile into the binary all types that they\n\ + expect it to use in the context of Any. However, for URLs which use the\n\ + scheme `http`, `https`, or no scheme, one can optionally set up a type\n\ + server that maps type URLs to message definitions as follows:\n\n* If no\ + \ scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must\ + \ yield a [google.protobuf.Type][]\n value in binary format, or produce\ + \ an error.\n* Applications are allowed to cache lookup results based on\ + \ the\n URL, or have them precompiled into a binary to avoid any\n lookup.\ + \ Therefore, binary compatibility needs to be preserved\n on changes to\ + \ types. (Use versioned type names to manage\n breaking changes.)\n\nNote:\ + \ this functionality is not currently available in the official\nprotobuf\ + \ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\ + \ As of May 2023, there are no widely used type server\nimplementations\ + \ and no plans to implement one.\n\nSchemes other than `http`, `https` (or\ + \ the empty scheme) might be\nused with implementation specific semantics." + description: "`Any` contains an arbitrary serialized protocol buffer message along\ + \ with a\nURL that describes the type of the serialized message.\n\nProtobuf\ + \ library provides support to pack/unpack Any values in the form\nof utility\ + \ functions or additional generated methods of the Any type.\n\nExample 1: Pack\ + \ and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n\ + \ ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack\ + \ and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n\ + \ ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n\ + \ }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n\ + \ foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack\ + \ and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n \ + \ any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n\ + \ ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n\ + \ any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n\ + \ ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err !=\ + \ nil {\n ...\n }\n\nThe pack methods provided by protobuf library\ + \ will by default use\n'type.googleapis.com/full.type.name' as the type URL\ + \ and the unpack\nmethods only use the fully qualified type name after the last\ + \ '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\ + name \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses\ + \ the regular\nrepresentation of the deserialized, embedded message, with an\n\ + additional field `@type` which contains the type URL. Example:\n\n package\ + \ google.profile;\n message Person {\n string first_name = 1;\n \ + \ string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\ + ,\n \"firstName\": ,\n \"lastName\": \n }\n\nIf\ + \ the embedded message type is well-known and has a custom JSON\nrepresentation,\ + \ that representation will be embedded adding a field\n`value` which holds the\ + \ custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\ + \n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n\ + \ \"value\": \"1.212s\"\n }" + example: + '@type': "@type" + additionalProperties: {} + rpcStatus: + type: "object" + properties: + code: + type: "integer" + format: "int32" + description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." + message: + type: "string" + description: "A developer-facing error message, which should be in English.\ + \ Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details]\ + \ field, or localized by the client." + details: + type: "array" + description: "A list of messages that carry the error details. There is a\ + \ common set of\nmessage types for APIs to use." + items: + $ref: "#/definitions/protobufAny" + description: "The `Status` type defines a logical error model that is suitable\ + \ for\ndifferent programming environments, including REST APIs and RPC APIs.\ + \ It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\n\ + three pieces of data: error code, error message, and error details.\n\nYou can\ + \ find out more about this error model and how to work with it in the\n[API\ + \ Design Guide](https://cloud.google.com/apis/design/errors)." + example: + code: 0 + details: + - '@type': "@type" + - '@type': "@type" + message: "message" + Stream result of examplepbResponseBodyOut: + type: "object" + properties: + result: + $ref: "#/definitions/examplepbResponseBodyOutResponse" + error: + $ref: "#/definitions/rpcStatus" + example: + result: + data: "data" + error: code: 0 details: - - key: {} - - key: {} - message: message - Stream result of examplepbResponseBodyOut: - title: Stream result of examplepbResponseBodyOut - type: object - properties: - result: - $ref: "#/components/schemas/examplepbResponseBodyOutResponse" - error: - $ref: "#/components/schemas/rpcStatus" - example: - result: - data: data - error: - code: 0 - details: - - key: {} - - key: {} - message: message -x-original-swagger-version: "2.0" + - '@type': "@type" + - '@type': "@type" + message: "message" diff --git a/examples/internal/clients/responsebody/api_response_body_service.go b/examples/internal/clients/responsebody/api_response_body_service.go index c6686891adf..f403b1a23ed 100644 --- a/examples/internal/clients/responsebody/api_response_body_service.go +++ b/examples/internal/clients/responsebody/api_response_body_service.go @@ -7,6 +7,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody import ( @@ -24,10 +25,12 @@ var ( ) type ResponseBodyServiceApiService service + /* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data + @return ExamplepbResponseBodyOutResponse */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx context.Context, data string) (ExamplepbResponseBodyOutResponse, *http.Response, error) { @@ -48,7 +51,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx c localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -83,9 +86,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx c if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -93,6 +94,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx c body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbResponseBodyOutResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -103,6 +105,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -113,15 +116,18 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBody(ctx c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data + @return string */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameName(ctx context.Context, data string) (string, *http.Response, error) { @@ -142,7 +148,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameNa localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -177,9 +183,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameNa if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -187,6 +191,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameNa body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -197,6 +202,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameNa newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -207,15 +213,18 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodySameNa newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data + @return StreamResultOfExamplepbResponseBodyOut */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream(ctx context.Context, data string) (StreamResultOfExamplepbResponseBodyOut, *http.Response, error) { @@ -236,7 +245,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -271,9 +280,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -281,6 +288,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v StreamResultOfExamplepbResponseBodyOut err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -291,6 +299,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -301,15 +310,18 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceGetResponseBodyStream newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data + @return []ExamplepbRepeatedResponseBodyOutResponse */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ctx context.Context, data string) ([]ExamplepbRepeatedResponseBodyOutResponse, *http.Response, error) { @@ -330,7 +342,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ct localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -365,9 +377,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ct if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -375,6 +385,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ct body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v []ExamplepbRepeatedResponseBodyOutResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -385,6 +396,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -395,15 +407,18 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseBodies(ct newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* ResponseBodyServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param data + @return []string */ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(ctx context.Context, data string) ([]string, *http.Response, error) { @@ -424,7 +439,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(c localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -459,9 +474,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(c if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -469,6 +482,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(c body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v []string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -479,6 +493,7 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -489,8 +504,10 @@ func (a *ResponseBodyServiceApiService) ResponseBodyServiceListResponseStrings(c newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/examples/internal/clients/responsebody/client.go b/examples/internal/clients/responsebody/client.go index 7f23dfac588..96625f03733 100644 --- a/examples/internal/clients/responsebody/client.go +++ b/examples/internal/clients/responsebody/client.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody import ( @@ -32,8 +33,8 @@ import ( ) var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") ) // APIClient manages communication with the examples/internal/proto/examplepb/response_body_service.proto API vversion not set diff --git a/examples/internal/clients/responsebody/configuration.go b/examples/internal/clients/responsebody/configuration.go index 9ffc70e913e..fa7de58d731 100644 --- a/examples/internal/clients/responsebody/configuration.go +++ b/examples/internal/clients/responsebody/configuration.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody import ( @@ -59,7 +60,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "/", + BasePath: "https://localhost", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOut.md b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOut.md index cccbb1077f1..1a78a92234c 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOut.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOut.md @@ -7,3 +7,4 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOutResponse.md b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOutResponse.md index d1aac34d7e9..f7169959b1b 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOutResponse.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseBodyOutResponse.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseStrings.md b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseStrings.md index 089861990ca..702cfa03868 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseStrings.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbRepeatedResponseStrings.md @@ -7,3 +7,4 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOut.md b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOut.md index 40547751e01..5a7146581bf 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOut.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOut.md @@ -7,3 +7,4 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOutResponse.md b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOutResponse.md index 2a75dfc0954..aff3fe461e4 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOutResponse.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyOutResponse.md @@ -7,3 +7,4 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyValue.md b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyValue.md index 16cff3c975a..1d55912e981 100644 --- a/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyValue.md +++ b/examples/internal/clients/responsebody/docs/ExamplepbResponseBodyValue.md @@ -7,3 +7,4 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/responsebody/docs/ResponseBodyServiceApi.md b/examples/internal/clients/responsebody/docs/ResponseBodyServiceApi.md index af03248d517..940417257da 100644 --- a/examples/internal/clients/responsebody/docs/ResponseBodyServiceApi.md +++ b/examples/internal/clients/responsebody/docs/ResponseBodyServiceApi.md @@ -1,6 +1,6 @@ -# {{classname}} +# \ResponseBodyServiceApi -All URIs are relative to */* +All URIs are relative to *https://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -10,6 +10,7 @@ Method | HTTP request | Description [**ResponseBodyServiceListResponseBodies**](ResponseBodyServiceApi.md#ResponseBodyServiceListResponseBodies) | **Get** /responsebodies/{data} | [**ResponseBodyServiceListResponseStrings**](ResponseBodyServiceApi.md#ResponseBodyServiceListResponseStrings) | **Get** /responsestrings/{data} | + # **ResponseBodyServiceGetResponseBody** > ExamplepbResponseBodyOutResponse ResponseBodyServiceGetResponseBody(ctx, data) @@ -31,7 +32,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -57,7 +58,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -83,7 +84,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -109,7 +110,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -135,7 +136,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/examples/internal/clients/responsebody/docs/ResponseResponseType.md b/examples/internal/clients/responsebody/docs/ResponseResponseType.md index c71897eb90d..31085130a0c 100644 --- a/examples/internal/clients/responsebody/docs/ResponseResponseType.md +++ b/examples/internal/clients/responsebody/docs/ResponseResponseType.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/responsebody/docs/RpcStatus.md b/examples/internal/clients/responsebody/docs/RpcStatus.md index 1366feb1020..52a18490d9e 100644 --- a/examples/internal/clients/responsebody/docs/RpcStatus.md +++ b/examples/internal/clients/responsebody/docs/RpcStatus.md @@ -5,7 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Code** | **int32** | The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. | [optional] [default to null] **Message** | **string** | A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. | [optional] [default to null] -**Details** | [**[]map[string]interface{}**](map.md) | A list of messages that carry the error details. There is a common set of message types for APIs to use. | [optional] [default to null] +**Details** | [**[]ProtobufAny**](protobufAny.md) | A list of messages that carry the error details. There is a common set of message types for APIs to use. | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/responsebody/docs/StreamResultOfExamplepbResponseBodyOut.md b/examples/internal/clients/responsebody/docs/StreamResultOfExamplepbResponseBodyOut.md index 6bb5b9f1518..608ad5047c3 100644 --- a/examples/internal/clients/responsebody/docs/StreamResultOfExamplepbResponseBodyOut.md +++ b/examples/internal/clients/responsebody/docs/StreamResultOfExamplepbResponseBodyOut.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out.go b/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out.go index 88533897eae..574246373eb 100644 --- a/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out.go +++ b/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody type ExamplepbRepeatedResponseBodyOut struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out_response.go b/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out_response.go index ca46c13b636..1ea5daf3fae 100644 --- a/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out_response.go +++ b/examples/internal/clients/responsebody/model_examplepb_repeated_response_body_out_response.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody type ExamplepbRepeatedResponseBodyOutResponse struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_repeated_response_strings.go b/examples/internal/clients/responsebody/model_examplepb_repeated_response_strings.go index de1dc3eeb40..47ec55c7f12 100644 --- a/examples/internal/clients/responsebody/model_examplepb_repeated_response_strings.go +++ b/examples/internal/clients/responsebody/model_examplepb_repeated_response_strings.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody type ExamplepbRepeatedResponseStrings struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_response_body_out.go b/examples/internal/clients/responsebody/model_examplepb_response_body_out.go index 7ddb49c6121..ea912e8976d 100644 --- a/examples/internal/clients/responsebody/model_examplepb_response_body_out.go +++ b/examples/internal/clients/responsebody/model_examplepb_response_body_out.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody type ExamplepbResponseBodyOut struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_response_body_out_response.go b/examples/internal/clients/responsebody/model_examplepb_response_body_out_response.go index 83f0f84feb9..b78f80ec655 100644 --- a/examples/internal/clients/responsebody/model_examplepb_response_body_out_response.go +++ b/examples/internal/clients/responsebody/model_examplepb_response_body_out_response.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody type ExamplepbResponseBodyOutResponse struct { diff --git a/examples/internal/clients/responsebody/model_examplepb_response_body_value.go b/examples/internal/clients/responsebody/model_examplepb_response_body_value.go index 54c4c0683b2..037e3bf33c6 100644 --- a/examples/internal/clients/responsebody/model_examplepb_response_body_value.go +++ b/examples/internal/clients/responsebody/model_examplepb_response_body_value.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody type ExamplepbResponseBodyValue struct { diff --git a/examples/internal/clients/responsebody/model_response_response_type.go b/examples/internal/clients/responsebody/model_response_response_type.go index 210a8442438..b249571ee56 100644 --- a/examples/internal/clients/responsebody/model_response_response_type.go +++ b/examples/internal/clients/responsebody/model_response_response_type.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody type ResponseResponseType string diff --git a/examples/internal/clients/responsebody/model_rpc_status.go b/examples/internal/clients/responsebody/model_rpc_status.go index b930c4bf7bc..9ad2f03a053 100644 --- a/examples/internal/clients/responsebody/model_rpc_status.go +++ b/examples/internal/clients/responsebody/model_rpc_status.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody // The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). @@ -15,5 +16,5 @@ type RpcStatus struct { // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. Message string `json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of message types for APIs to use. - Details []map[string]interface{} `json:"details,omitempty"` + Details []ProtobufAny `json:"details,omitempty"` } diff --git a/examples/internal/clients/responsebody/model_stream_result_of_examplepb_response_body_out.go b/examples/internal/clients/responsebody/model_stream_result_of_examplepb_response_body_out.go index 910e1e89e20..20893eec6bd 100644 --- a/examples/internal/clients/responsebody/model_stream_result_of_examplepb_response_body_out.go +++ b/examples/internal/clients/responsebody/model_stream_result_of_examplepb_response_body_out.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody type StreamResultOfExamplepbResponseBodyOut struct { diff --git a/examples/internal/clients/responsebody/response.go b/examples/internal/clients/responsebody/response.go index c88ea641e15..09f1698e322 100644 --- a/examples/internal/clients/responsebody/response.go +++ b/examples/internal/clients/responsebody/response.go @@ -6,6 +6,7 @@ * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package responsebody import ( diff --git a/examples/internal/clients/unannotatedecho/.swagger-codegen/VERSION b/examples/internal/clients/unannotatedecho/.swagger-codegen/VERSION index b61c49d271a..a932b445646 100644 --- a/examples/internal/clients/unannotatedecho/.swagger-codegen/VERSION +++ b/examples/internal/clients/unannotatedecho/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.71 \ No newline at end of file +2.4.47-SNAPSHOT \ No newline at end of file diff --git a/examples/internal/clients/unannotatedecho/api/swagger.yaml b/examples/internal/clients/unannotatedecho/api/swagger.yaml index 8e35dfe4830..58201325f08 100644 --- a/examples/internal/clients/unannotatedecho/api/swagger.yaml +++ b/examples/internal/clients/unannotatedecho/api/swagger.yaml @@ -1,754 +1,572 @@ -openapi: 3.0.1 +--- +swagger: "2.0" info: - title: Unannotated Echo - description: |- - Unannotated Echo Service - Similar to echo_service.proto but without annotations. See - unannotated_echo_service.yaml for the equivalent of the annotations in - gRPC API configuration format. - - Echo Service API consists of a single service which returns - a message. + description: "Unannotated Echo Service\nSimilar to echo_service.proto but without\ + \ annotations. See\nunannotated_echo_service.yaml for the equivalent of the annotations\ + \ in\ngRPC API configuration format.\n\nEcho Service API consists of a single\ + \ service which returns\na message." + version: "1.0" + title: "Unannotated Echo" contact: - name: gRPC-Gateway project - url: https://github.com/grpc-ecosystem/grpc-gateway - email: none@example.com + 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/main/LICENSE - version: "1.0" - x-something-something: yadda -externalDocs: - description: More about gRPC-Gateway - url: https://github.com/grpc-ecosystem/grpc-gateway -servers: -- url: / + name: "BSD 3-Clause License" + url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE" + x-something-something: "yadda" +tags: +- name: "Echo" + description: "Echo description" +- name: "Internal" + description: "Internal description" + x-traitTag: true +- name: "UnannotatedEchoService" + description: "UnannotatedEchoService description -- which should not be used in\ + \ place of the documentation comment!" + externalDocs: + description: "Find out more about UnannotatedEchoService" + url: "https://github.com/grpc-ecosystem/grpc-gateway" +schemes: +- "http" +- "https" +- "wss" +consumes: +- "application/json" +- "application/x-foo-mime" +produces: +- "application/json" +- "application/x-foo-mime" security: - ApiKeyAuth: [] BasicAuth: [] - ApiKeyAuth: [] OAuth2: - - read - - write -tags: -- name: Echo - description: Echo description -- name: Internal - description: Internal description - x-traitTag: true -- name: UnannotatedEchoService - description: UnannotatedEchoService description -- which should not be used in place - of the documentation comment! - externalDocs: - description: Find out more about UnannotatedEchoService - url: https://github.com/grpc-ecosystem/grpc-gateway + - "read" + - "write" paths: /v1/example/echo/{id}: post: tags: - - UnannotatedEchoService + - "UnannotatedEchoService" summary: "Summary: Echo rpc" - description: Description Echo - externalDocs: - description: Find out more Echo - url: https://github.com/grpc-ecosystem/grpc-gateway - operationId: UnannotatedEchoService_Echo + description: "Description Echo" + operationId: "UnannotatedEchoService_Echo" parameters: - - name: id - in: path - description: Id represents the message identifier. + - name: "id" + in: "path" + description: "Id represents the message identifier." required: true - style: simple - explode: false - schema: - type: string - - name: num - in: query - description: Int value field + type: "string" + x-exportParamName: "Id" + - name: "num" + in: "query" + description: "Int value field" required: true - style: form - explode: true - schema: - type: string - format: int64 - default: "42" - - name: duration - in: query - required: false - style: form - explode: true - schema: - type: string - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + default: "42" + format: "int64" + x-exportParamName: "Num" + - name: "duration" + in: "query" + required: false + type: "string" + x-exportParamName: "Duration" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" + externalDocs: + description: "Find out more Echo" + url: "https://github.com/grpc-ecosystem/grpc-gateway" responses: "200": - description: A successful response. - content: + description: "A successful response." + examples: application/json: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" - example: - value: the input value - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + value: "the input value" + schema: + $ref: "#/definitions/examplepbUnannotatedSimpleMessage" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: integer - format: integer - x-content-type: application/json - application/x-foo-mime: - schema: - type: integer - format: integer + description: "Returned when the resource does not exist." + schema: + type: "integer" + format: "integer" "503": - description: Returned when the resource is temporarily unavailable. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the resource is temporarily unavailable." + schema: {} x-number: 100 default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo/{id}/{num}: get: tags: - - UnannotatedEchoService + - "UnannotatedEchoService" summary: "Summary: Echo rpc" - description: Description Echo - externalDocs: - description: Find out more Echo - url: https://github.com/grpc-ecosystem/grpc-gateway - operationId: UnannotatedEchoService_Echo2 + description: "Description Echo" + operationId: "UnannotatedEchoService_Echo2" parameters: - - name: id - in: path - description: Id represents the message identifier. + - name: "id" + in: "path" + description: "Id represents the message identifier." required: true - style: simple - explode: false - schema: - type: string - - name: num - in: path - description: Int value field + type: "string" + x-exportParamName: "Id" + - name: "num" + in: "path" + description: "Int value field" required: true - style: simple - explode: false - schema: - type: string - format: int64 - default: "42" - - name: duration - in: query - required: false - style: form - explode: true - schema: - type: string - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + default: "42" + format: "int64" + x-exportParamName: "Num" + - name: "duration" + in: "query" + required: false + type: "string" + x-exportParamName: "Duration" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" + externalDocs: + description: "Find out more Echo" + url: "https://github.com/grpc-ecosystem/grpc-gateway" responses: "200": - description: A successful response. - content: + description: "A successful response." + examples: application/json: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" - example: - value: the input value - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + value: "the input value" + schema: + $ref: "#/definitions/examplepbUnannotatedSimpleMessage" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: integer - format: integer - x-content-type: application/json - application/x-foo-mime: - schema: - type: integer - format: integer + description: "Returned when the resource does not exist." + schema: + type: "integer" + format: "integer" "503": - description: Returned when the resource is temporarily unavailable. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the resource is temporarily unavailable." + schema: {} x-number: 100 default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo_body: post: tags: - - UnannotatedEchoService - summary: EchoBody method receives a simple message and returns it. - operationId: UnannotatedEchoService_EchoBody - requestBody: - description: A simple message with many types - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + - "UnannotatedEchoService" + summary: "EchoBody method receives a simple message and returns it." + operationId: "UnannotatedEchoService_EchoBody" + parameters: + - in: "body" + name: "body" + description: "A simple message with many types" required: true + schema: + $ref: "#/definitions/examplepbUnannotatedSimpleMessage" + x-exportParamName: "Body" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbUnannotatedSimpleMessage" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo_delete: delete: tags: - - UnannotatedEchoService - summary: EchoDelete method receives a simple message and returns it. - operationId: UnannotatedEchoService_EchoDelete + - "UnannotatedEchoService" + summary: "EchoDelete method receives a simple message and returns it." + operationId: "UnannotatedEchoService_EchoDelete" parameters: - - name: id - in: query - description: Id represents the message identifier. - required: false - style: form - explode: true - schema: - type: string - - name: num - in: query - description: Int value field + - name: "id" + in: "query" + description: "Id represents the message identifier." + required: false + type: "string" + x-exportParamName: "Id" + x-optionalDataType: "String" + - name: "num" + in: "query" + description: "Int value field" required: true - style: form - explode: true - schema: - type: string - format: int64 - default: "42" - - name: duration - in: query - required: false - style: form - explode: true - schema: - type: string - - name: lineNum - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: lang - in: query - required: false - style: form - explode: true - schema: - type: string - - name: status.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: status.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: en - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.progress - in: query - required: false - style: form - explode: true - schema: - type: string - format: int64 - - name: no.note - in: query - required: false - style: form - explode: true - schema: - type: string - - name: resourceId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.nId - in: query - required: false - style: form - explode: true - schema: - type: string - - name: nId.val - in: query - required: false - style: form - explode: true - schema: - type: string + type: "string" + default: "42" + format: "int64" + x-exportParamName: "Num" + - name: "duration" + in: "query" + required: false + type: "string" + x-exportParamName: "Duration" + x-optionalDataType: "String" + - name: "lineNum" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "LineNum" + x-optionalDataType: "String" + - name: "lang" + in: "query" + required: false + type: "string" + x-exportParamName: "Lang" + x-optionalDataType: "String" + - name: "status.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "StatusProgress" + x-optionalDataType: "String" + - name: "status.note" + in: "query" + required: false + type: "string" + x-exportParamName: "StatusNote" + x-optionalDataType: "String" + - name: "en" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "En" + x-optionalDataType: "String" + - name: "no.progress" + in: "query" + required: false + type: "string" + format: "int64" + x-exportParamName: "NoProgress" + x-optionalDataType: "String" + - name: "no.note" + in: "query" + required: false + type: "string" + x-exportParamName: "NoNote" + x-optionalDataType: "String" + - name: "resourceId" + in: "query" + required: false + type: "string" + x-exportParamName: "ResourceId" + x-optionalDataType: "String" + - name: "nId.nId" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdNId" + x-optionalDataType: "String" + - name: "nId.val" + in: "query" + required: false + type: "string" + x-exportParamName: "NIdVal" + x-optionalDataType: "String" responses: "200": - description: A successful response. - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + description: "A successful response." + schema: + $ref: "#/definitions/examplepbUnannotatedSimpleMessage" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" /v1/example/echo_nested: put: tags: - - UnannotatedEchoService - summary: EchoNested method receives a simple message and returns it. - operationId: UnannotatedEchoService_EchoNested - requestBody: - description: A simple message with many types - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbUnannotatedSimpleMessage" + - "UnannotatedEchoService" + summary: "EchoNested method receives a simple message and returns it." + operationId: "UnannotatedEchoService_EchoNested" + parameters: + - in: "body" + name: "body" + description: "A simple message with many types" required: true + schema: + $ref: "#/definitions/examplepbUnannotatedSimpleMessage" + x-exportParamName: "Body" responses: "200": description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/examplepbUnannotatedNestedMessage" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/examplepbUnannotatedNestedMessage" + schema: + $ref: "#/definitions/examplepbUnannotatedNestedMessage" "403": - description: Returned when the user does not have permission to access the - resource. - content: - application/json: - schema: - type: object - x-content-type: application/json - application/x-foo-mime: - schema: - type: object + description: "Returned when the user does not have permission to access\ + \ the resource." + schema: {} "404": - description: Returned when the resource does not exist. - content: - application/json: - schema: - type: string - format: string - x-content-type: application/json - application/x-foo-mime: - schema: - type: string - format: string + description: "Returned when the resource does not exist." + schema: + type: "string" + format: "string" default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: "#/components/schemas/rpcStatus" - application/x-foo-mime: - schema: - $ref: "#/components/schemas/rpcStatus" - x-codegen-request-body-name: body -components: - schemas: - examplepbUnannotatedEmbedded: - type: object - properties: - progress: - type: string - format: int64 - note: - type: string - description: Embedded represents a message embedded in SimpleMessage. - x-go-type: - import: - package: github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb - type: UnannotatedEmbedded - examplepbUnannotatedNestedMessage: - type: object - properties: - nId: - type: string - val: - type: string - example: - val: val - nId: nId - x-go-type: - import: - package: github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb - type: UnannotatedNestedMessage - examplepbUnannotatedSimpleMessage: - title: A bit of everything - required: - - id - - num - type: object - properties: - id: - type: string - description: Id represents the message identifier. - num: - type: string - description: Int value field - format: int64 - default: "42" - duration: - type: string - lineNum: - type: string - format: int64 - lang: - type: string - status: - $ref: "#/components/schemas/examplepbUnannotatedEmbedded" - en: - type: string - format: int64 - "no": - $ref: "#/components/schemas/examplepbUnannotatedEmbedded" - resourceId: - type: string - nId: - $ref: "#/components/schemas/examplepbUnannotatedNestedMessage" - description: A simple message with many types - example: - id: myid - externalDocs: - description: Find out more about UnannotatedSimpleMessage - url: https://github.com/grpc-ecosystem/grpc-gateway - protobufAny: - type: object - properties: - '@type': - type: string - additionalProperties: - type: object - x-go-type: - import: - package: google.golang.org/protobuf/types/known/anypb - type: Any - x-schema-name: protobufAny - rpcStatus: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - $ref: "#/components/schemas/protobufAny" - x-go-type: - import: - package: google.golang.org/genproto/googleapis/rpc/status - type: Status - securitySchemes: - ApiKeyAuth: - type: apiKey - name: X-API-Key - in: header - x-amazon-apigateway-authorizer: - authorizerResultTtlInSeconds: 60 - type: token - x-amazon-apigateway-authtype: oauth2 - BasicAuth: - type: http - scheme: basic + description: "An unexpected error response." + schema: + $ref: "#/definitions/rpcStatus" +securityDefinitions: + ApiKeyAuth: + type: "apiKey" + name: "X-API-Key" + in: "header" + x-amazon-apigateway-authorizer: + authorizerResultTtlInSeconds: 60 + type: "token" + x-amazon-apigateway-authtype: "oauth2" + BasicAuth: + type: "basic" +definitions: + examplepbUnannotatedEmbedded: + type: "object" + properties: + progress: + type: "string" + format: "int64" + note: + type: "string" + description: "Embedded represents a message embedded in SimpleMessage." + x-go-type: + import: + package: "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb" + type: "UnannotatedEmbedded" + examplepbUnannotatedNestedMessage: + type: "object" + properties: + nId: + type: "string" + val: + type: "string" + example: + val: "val" + nId: "nId" + x-go-type: + import: + package: "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb" + type: "UnannotatedNestedMessage" + examplepbUnannotatedSimpleMessage: + type: "object" + required: + - "id" + - "num" + properties: + id: + type: "string" + description: "Id represents the message identifier." + num: + type: "string" + format: "int64" + description: "Int value field" + default: "42" + duration: + type: "string" + lineNum: + type: "string" + format: "int64" + lang: + type: "string" + status: + $ref: "#/definitions/examplepbUnannotatedEmbedded" + en: + type: "string" + format: "int64" + "no": + $ref: "#/definitions/examplepbUnannotatedEmbedded" + resourceId: + type: "string" + nId: + $ref: "#/definitions/examplepbUnannotatedNestedMessage" + externalDocs: + description: "Find out more about UnannotatedSimpleMessage" + url: "https://github.com/grpc-ecosystem/grpc-gateway" + title: "A bit of everything" + description: "A simple message with many types" + example: + id: "myid" + protobufAny: + type: "object" + properties: + '@type': + type: "string" + additionalProperties: {} + x-go-type: + import: + package: "google.golang.org/protobuf/types/known/anypb" + type: "Any" + rpcStatus: + type: "object" + properties: + code: + type: "integer" + format: "int32" + message: + type: "string" + details: + type: "array" + items: + $ref: "#/definitions/protobufAny" + x-go-type: + import: + package: "google.golang.org/genproto/googleapis/rpc/status" + type: "Status" +externalDocs: + description: "More about gRPC-Gateway" + url: "https://github.com/grpc-ecosystem/grpc-gateway" x-grpc-gateway-baz-list: -- one +- "one" - true -x-grpc-gateway-foo: bar -x-original-swagger-version: "2.0" +x-grpc-gateway-foo: "bar" diff --git a/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go b/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go index 4609309ad55..6f783de95ea 100644 --- a/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go +++ b/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go @@ -8,6 +8,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package unannotatedecho import ( @@ -26,6 +27,7 @@ var ( ) type UnannotatedEchoServiceApiService service + /* UnannotatedEchoServiceApiService Summary: Echo rpc Description Echo @@ -44,21 +46,22 @@ Description Echo * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbUnannotatedSimpleMessage */ -type UnannotatedEchoServiceApiUnannotatedEchoServiceEchoOpts struct { - Duration optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type UnannotatedEchoServiceApiUnannotatedEchoServiceEchoOpts struct { + Duration optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx context.Context, id string, num string, localVarOptionals *UnannotatedEchoServiceApiUnannotatedEchoServiceEchoOpts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { @@ -113,7 +116,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -161,9 +164,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -171,6 +172,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -181,6 +183,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -191,6 +194,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -201,6 +205,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -211,6 +216,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -221,11 +227,13 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* UnannotatedEchoServiceApiService Summary: Echo rpc Description Echo @@ -244,21 +252,22 @@ Description Echo * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbUnannotatedSimpleMessage */ -type UnannotatedEchoServiceApiUnannotatedEchoServiceEcho2Opts struct { - Duration optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type UnannotatedEchoServiceApiUnannotatedEchoServiceEcho2Opts struct { + Duration optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx context.Context, id string, num string, localVarOptionals *UnannotatedEchoServiceApiUnannotatedEchoServiceEcho2Opts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { @@ -313,7 +322,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -361,9 +370,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -371,6 +378,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -381,6 +389,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -391,6 +400,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v int32 err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -401,6 +411,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 503 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -411,6 +422,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -421,15 +433,18 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* UnannotatedEchoServiceApiService EchoBody method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body A simple message with many types + @return ExamplepbUnannotatedSimpleMessage */ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx context.Context, body ExamplepbUnannotatedSimpleMessage) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { @@ -499,9 +514,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -509,6 +522,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -519,6 +533,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -529,6 +544,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -539,6 +555,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -549,11 +566,13 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoBody(ctx co newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* UnannotatedEchoServiceApiService EchoDelete method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -571,22 +590,23 @@ UnannotatedEchoServiceApiService EchoDelete method receives a simple message and * @param "ResourceId" (optional.String) - * @param "NIdNId" (optional.String) - * @param "NIdVal" (optional.String) - + @return ExamplepbUnannotatedSimpleMessage */ -type UnannotatedEchoServiceApiUnannotatedEchoServiceEchoDeleteOpts struct { - Id optional.String - Duration optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String - ResourceId optional.String - NIdNId optional.String - NIdVal optional.String +type UnannotatedEchoServiceApiUnannotatedEchoServiceEchoDeleteOpts struct { + Id optional.String + Duration optional.String + LineNum optional.String + Lang optional.String + StatusProgress optional.String + StatusNote optional.String + En optional.String + NoProgress optional.String + NoNote optional.String + ResourceId optional.String + NIdNId optional.String + NIdVal optional.String } func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx context.Context, num string, localVarOptionals *UnannotatedEchoServiceApiUnannotatedEchoServiceEchoDeleteOpts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { @@ -643,7 +663,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx localVarQueryParams.Add("nId.val", parameterToString(localVarOptionals.NIdVal.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -691,9 +711,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -701,6 +719,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedSimpleMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -711,6 +730,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -721,6 +741,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -731,6 +752,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -741,15 +763,18 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + /* UnannotatedEchoServiceApiService EchoNested method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body A simple message with many types + @return ExamplepbUnannotatedNestedMessage */ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx context.Context, body ExamplepbUnannotatedSimpleMessage) (ExamplepbUnannotatedNestedMessage, *http.Response, error) { @@ -819,9 +844,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -829,6 +852,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx body: localVarBody, error: localVarHttpResponse.Status, } + if localVarHttpResponse.StatusCode == 200 { var v ExamplepbUnannotatedNestedMessage err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -839,6 +863,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -849,6 +874,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -859,6 +885,7 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + if localVarHttpResponse.StatusCode == 0 { var v RpcStatus err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -869,8 +896,10 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoNested(ctx newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } + return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/examples/internal/clients/unannotatedecho/client.go b/examples/internal/clients/unannotatedecho/client.go index 73793d9aca6..85e6de91cb2 100644 --- a/examples/internal/clients/unannotatedecho/client.go +++ b/examples/internal/clients/unannotatedecho/client.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package unannotatedecho import ( @@ -33,8 +34,8 @@ import ( ) var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") ) // APIClient manages communication with the Unannotated Echo API v1.0 diff --git a/examples/internal/clients/unannotatedecho/configuration.go b/examples/internal/clients/unannotatedecho/configuration.go index 428325378e3..a471d97120f 100644 --- a/examples/internal/clients/unannotatedecho/configuration.go +++ b/examples/internal/clients/unannotatedecho/configuration.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package unannotatedecho import ( @@ -60,7 +61,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "/", + BasePath: "http://localhost", DefaultHeader: make(map[string]string), UserAgent: "Swagger-Codegen/1.0.0/go", } diff --git a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_embedded.go b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_embedded.go index c016143a772..e91de2d8a02 100644 --- a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_embedded.go +++ b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_embedded.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package unannotatedecho // Embedded represents a message embedded in SimpleMessage. diff --git a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_nested_message.go b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_nested_message.go index f5907a81b79..8f212000c8b 100644 --- a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_nested_message.go +++ b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_nested_message.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package unannotatedecho type ExamplepbUnannotatedNestedMessage struct { diff --git a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go index 26ec808716c..99099038bf6 100644 --- a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go +++ b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package unannotatedecho // A simple message with many types diff --git a/examples/internal/clients/unannotatedecho/model_rpc_status.go b/examples/internal/clients/unannotatedecho/model_rpc_status.go index 350acb375ac..d97aeea06d4 100644 --- a/examples/internal/clients/unannotatedecho/model_rpc_status.go +++ b/examples/internal/clients/unannotatedecho/model_rpc_status.go @@ -7,10 +7,11 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package unannotatedecho type RpcStatus struct { Code int32 `json:"code,omitempty"` Message string `json:"message,omitempty"` - Details []map[string]interface{} `json:"details,omitempty"` + Details []ProtobufAny `json:"details,omitempty"` } diff --git a/examples/internal/clients/unannotatedecho/response.go b/examples/internal/clients/unannotatedecho/response.go index 16e85b90cc3..16ded8dab1d 100644 --- a/examples/internal/clients/unannotatedecho/response.go +++ b/examples/internal/clients/unannotatedecho/response.go @@ -7,6 +7,7 @@ * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package unannotatedecho import ( From 3e3f2ebba7a9827e4e42ce935c20a5d61deb1763 Mon Sep 17 00:00:00 2001 From: iamrajiv Date: Wed, 23 Jul 2025 22:33:47 +0530 Subject: [PATCH 6/8] fix swagger --- examples/internal/integration/client_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/internal/integration/client_test.go b/examples/internal/integration/client_test.go index cb88b202af1..e35be923ae0 100644 --- a/examples/internal/integration/client_test.go +++ b/examples/internal/integration/client_test.go @@ -63,7 +63,7 @@ func TestEchoBody2Client(t *testing.T) { cl := echo.NewAPIClient(cfg) req := echo.ExamplepbEmbedded{Note: "note"} - resp, _, err := cl.EchoServiceApi.EchoServiceEchoBody2(context.Background(), req, "foo", nil) + resp, _, err := cl.EchoServiceApi.EchoServiceEchoBody2(context.Background(), "foo", req, nil) if err != nil { t.Errorf("cl.EchoBody(%#v) failed with %v; want success", req, err) } From 5b3ce35f727f50bdfe8065ce4f76391c356acc9f Mon Sep 17 00:00:00 2001 From: iamrajiv Date: Wed, 23 Jul 2025 22:40:21 +0530 Subject: [PATCH 7/8] fix swagger --- .../model_examplepb_a_bit_of_everything.go | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go index 2f6bb864046..4555304492c 100644 --- a/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go +++ b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything.go @@ -11,9 +11,37 @@ package abe import ( + "encoding/json" + "strconv" "time" ) +// FlexibleInt64 can unmarshal from both string and int64 +type FlexibleInt64 int64 + +func (f *FlexibleInt64) UnmarshalJSON(data []byte) error { + // Try to unmarshal as int64 first + var i int64 + if err := json.Unmarshal(data, &i); err == nil { + *f = FlexibleInt64(i) + return nil + } + + // If that fails, try to unmarshal as string and convert + var s string + if err := json.Unmarshal(data, &s); err != nil { + return err + } + + parsed, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return err + } + + *f = FlexibleInt64(parsed) + return nil +} + // Intentionally complicated message type to cover many features of Protobuf. type ExamplepbABitOfEverything struct { SingleNested *ABitOfEverythingNested `json:"singleNested,omitempty"` @@ -58,7 +86,7 @@ type ExamplepbABitOfEverything struct { RepeatedNestedAnnotation []ABitOfEverythingNested `json:"repeatedNestedAnnotation,omitempty"` // Nested object description. NestedAnnotation *ABitOfEverythingNested `json:"nestedAnnotation,omitempty"` - Int64OverrideType int64 `json:"int64OverrideType,omitempty"` + Int64OverrideType FlexibleInt64 `json:"int64OverrideType,omitempty"` RequiredStringViaFieldBehaviorAnnotation string `json:"requiredStringViaFieldBehaviorAnnotation"` OutputOnlyStringViaFieldBehaviorAnnotation string `json:"outputOnlyStringViaFieldBehaviorAnnotation,omitempty"` OptionalStringValue string `json:"optionalStringValue,omitempty"` From 08a48fd0c8d8b1a7ab506ce3d9115a3c24b2c9b1 Mon Sep 17 00:00:00 2001 From: iamrajiv Date: Wed, 23 Jul 2025 23:09:54 +0530 Subject: [PATCH 8/8] fix swagger --- examples/internal/clients/abe/client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/internal/clients/abe/client.go b/examples/internal/clients/abe/client.go index 203bba882fc..0a2a703900b 100644 --- a/examples/internal/clients/abe/client.go +++ b/examples/internal/clients/abe/client.go @@ -482,3 +482,4 @@ func (e GenericSwaggerError) Body() []byte { func (e GenericSwaggerError) Model() interface{} { return e.model } +