From 80c0c547164348e24ef692a69210e3caabb98772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mien=20Kocher?= Date: Tue, 19 Dec 2023 15:06:50 +0100 Subject: [PATCH] chore: regenerate protos --- examples/internal/clients/abe/BUILD.bazel | 3 + .../internal/clients/abe/api/swagger.yaml | 711 +++-------- .../abe/api_a_bit_of_everything_service.go | 25 +- examples/internal/clients/abe/api_echo_rpc.go | 2 +- .../clients/abe/model_a_bit_of_everything.go | 16 +- ...thing_service_post_with_empty_body_body.go | 14 + ...it_of_everything_service_update_v2_body.go | 2 +- ...a_bit_of_everything_service_update_body.go | 78 ++ ...examplepb_required_message_type_request.go | 2 +- .../clients/abe/model_protoexamplepb_foo.go | 15 + .../internal/clients/echo/api/swagger.yaml | 9 +- .../internal/clients/echo/api_echo_service.go | 6 +- .../a_bit_of_everything.swagger.json | 1110 +++++------------ .../proto/examplepb/echo_service.swagger.json | 12 +- .../examplepb/flow_combination.swagger.json | 40 +- .../examplepb/non_standard_names.swagger.json | 8 +- .../examplepb/non_standard_names.swagger.json | 8 +- 17 files changed, 611 insertions(+), 1450 deletions(-) create mode 100644 examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go create mode 100644 examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go create mode 100644 examples/internal/clients/abe/model_protoexamplepb_foo.go diff --git a/examples/internal/clients/abe/BUILD.bazel b/examples/internal/clients/abe/BUILD.bazel index 8002a2de4a3..761d6337d3e 100644 --- a/examples/internal/clients/abe/BUILD.bazel +++ b/examples/internal/clients/abe/BUILD.bazel @@ -24,11 +24,13 @@ go_library( "model_a_bit_of_everything_nested.go", "model_a_bit_of_everything_service_deep_path_echo_body.go", "model_a_bit_of_everything_service_deep_path_echo_body_single_nested.go", + "model_a_bit_of_everything_service_post_with_empty_body_body.go", "model_a_bit_of_everything_service_update_body.go", "model_a_bit_of_everything_service_update_v2_body.go", "model_book.go", "model_examplepb_a_bit_of_everything.go", "model_examplepb_a_bit_of_everything_repeated.go", + "model_examplepb_a_bit_of_everything_service_update_body.go", "model_examplepb_bar.go", "model_examplepb_body.go", "model_examplepb_book.go", @@ -47,6 +49,7 @@ go_library( "model_pathenum_path_enum.go", "model_pathenumsnake_case_for_import.go", "model_protobuf_any.go", + "model_protoexamplepb_foo.go", "model_rpc_status.go", "model_sub_string_message.go", "model_the_book_to_update_.go", diff --git a/examples/internal/clients/abe/api/swagger.yaml b/examples/internal/clients/abe/api/swagger.yaml index 251ca10ee90..76bd4d07fc5 100644 --- a/examples/internal/clients/abe/api/swagger.yaml +++ b/examples/internal/clients/abe/api/swagger.yaml @@ -996,8 +996,7 @@ paths: - in: "body" name: "singleNested" required: true - schema: - $ref: "#/definitions/ABitOfEverythingNested" + schema: {} x-exportParamName: "SingleNested" - name: "uuid" in: "query" @@ -2692,7 +2691,7 @@ paths: name: "body" required: true schema: - $ref: "#/definitions/ABitOfEverythingServiceUpdateBody" + $ref: "#/definitions/examplepbABitOfEverythingServiceUpdateBody" x-exportParamName: "Body" responses: 200: @@ -4368,8 +4367,7 @@ paths: - in: "body" name: "exampleEnum" required: true - schema: - $ref: "#/definitions/oneofenumExampleEnum" + schema: {} x-exportParamName: "ExampleEnum" responses: 200: @@ -4510,8 +4508,7 @@ paths: 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." + schema: {} x-exportParamName: "Book" - name: "allowMissing" in: "query" @@ -4566,8 +4563,7 @@ paths: name: "book" description: "The book to create." required: true - schema: - $ref: "#/definitions/examplepbBook" + schema: {} x-exportParamName: "Book" - name: "bookId" in: "query" @@ -4618,9 +4614,10 @@ paths: 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" + schema: {} x-exportParamName: "Abe" - name: "updateMask" in: "query" @@ -4669,9 +4666,10 @@ paths: 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" + schema: {} x-exportParamName: "Abe" responses: 200: @@ -4759,8 +4757,7 @@ paths: - in: "body" name: "value" required: true - schema: - type: "string" + schema: {} x-exportParamName: "Value" responses: 200: @@ -4947,6 +4944,12 @@ paths: required: true type: "string" x-exportParamName: "Name" + - in: "body" + name: "body" + required: true + schema: + $ref: "#/definitions/ABitOfEverythingServicePostWithEmptyBodyBody" + x-exportParamName: "Body" responses: 200: description: "A successful response." @@ -5019,8 +5022,7 @@ paths: - in: "body" name: "data" required: true - schema: - $ref: "#/definitions/examplepbBody" + schema: {} x-exportParamName: "Data" responses: 200: @@ -5407,7 +5409,36 @@ definitions: int64_value: 12 double_value: 12.3 x-a-bit-of-everything-foo: "bar" - ABitOfEverythingServiceUpdateBody: + ABitOfEverythingServicePostWithEmptyBodyBody: + type: "object" + ABitOfEverythingServiceUpdateV2Body: + type: "object" + properties: + abe: + $ref: "#/definitions/A bit of everything" + 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" @@ -5418,9 +5449,16 @@ definitions: - "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: @@ -5598,34 +5636,100 @@ definitions: int64_value: 12 double_value: 12.3 x-a-bit-of-everything-foo: "bar" - ABitOfEverythingServiceUpdateV2Body: + examplepbABitOfEverythingRepeated: 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" + 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}=)?$" + 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: - 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: + path_repeated_bool_value: + - true + - true + - false + - true + path_repeated_int32_value: + - 1 + - 2 + - 3 + examplepbABitOfEverythingServiceUpdateBody: type: "object" required: - "doubleValue" @@ -5636,16 +5740,9 @@ definitions: - "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: @@ -5823,103 +5920,10 @@ definitions: int64_value: 12 double_value: 12.3 x-a-bit-of-everything-foo: "bar" - examplepbABitOfEverythingRepeated: + examplepbBar: 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}=)?$" - 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 - examplepbBar: - type: "object" - required: - - "id" + required: + - "id" properties: id: type: "string" @@ -5987,13 +5991,6 @@ definitions: 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" - examplepbFoo: - type: "object" - required: - - "bar" - properties: - bar: - $ref: "#/definitions/examplepbBar" examplepbNumericEnum: type: "string" description: "NumericEnum is one or zero.\n\n - ZERO: ZERO means 0\n - ONE: ONE\ @@ -6011,7 +6008,7 @@ definitions: id: type: "string" foo: - $ref: "#/definitions/examplepbFoo" + $ref: "#/definitions/protoexamplepbFoo" title: "Required message type -> OpenAPI\nhttps://github.com/grpc-ecosystem/grpc-gateway/issues/2837" examplepbSnakeEnumResponse: type: "object" @@ -6112,6 +6109,13 @@ definitions: example: '@type': "@type" additionalProperties: {} + protoexamplepbFoo: + type: "object" + required: + - "bar" + properties: + bar: + $ref: "#/definitions/examplepbBar" rpcStatus: type: "object" properties: @@ -6147,403 +6151,6 @@ definitions: 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" - additionalProperties: - $ref: "#/definitions/examplepbNumericEnum" - mappedStringValue: - type: "object" - 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" - additionalProperties: - $ref: "#/definitions/examplepbNumericEnum" - mappedStringValue: - type: "object" - 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: @@ -6554,7 +6161,7 @@ definitions: $ref: "#/definitions/NestedDeepEnum" description: "Nested is nested type." example: "{\"ok\":\"TRUE\"}" - A bit of everything_2: + A bit of everything: properties: singleNested: $ref: "#/definitions/ABitOfEverythingNested" diff --git a/examples/internal/clients/abe/api_a_bit_of_everything_service.go b/examples/internal/clients/abe/api_a_bit_of_everything_service.go index daa051759fe..aebbfb3f6b5 100644 --- a/examples/internal/clients/abe/api_a_bit_of_everything_service.go +++ b/examples/internal/clients/abe/api_a_bit_of_everything_service.go @@ -1207,7 +1207,7 @@ type ABitOfEverythingServiceCheckPostQueryParamsOpts struct { Uuids optional.Interface } -func (a *ABitOfEverythingServiceApiService) 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 *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCheckPostQueryParams(ctx context.Context, stringValue string, singleNested interface{}, uuid string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, localVarOptionals *ABitOfEverythingServiceCheckPostQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -2155,7 +2155,7 @@ type ABitOfEverythingServiceCreateBookOpts struct { BookId optional.String } -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCreateBook(ctx context.Context, parent string, book ExamplepbBook, localVarOptionals *ABitOfEverythingServiceCreateBookOpts) (ExamplepbBook, *http.Response, error) { +func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCreateBook(ctx context.Context, parent string, book interface{}, localVarOptionals *ABitOfEverythingServiceCreateBookOpts) (ExamplepbBook, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -4266,7 +4266,7 @@ ABitOfEverythingServiceApiService @return interface{} */ -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetMessageWithBody(ctx context.Context, id string, data ExamplepbBody) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetMessageWithBody(ctx context.Context, id string, data interface{}) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -5504,7 +5504,7 @@ ABitOfEverythingServiceApiService @return interface{} */ -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServicePostOneofEnum(ctx context.Context, exampleEnum OneofenumExampleEnum) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServicePostOneofEnum(ctx context.Context, exampleEnum interface{}) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -5815,10 +5815,11 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServicePostRequiredM ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param name + * @param body @return interface{} */ -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServicePostWithEmptyBody(ctx context.Context, name string) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServicePostWithEmptyBody(ctx context.Context, name string, body ABitOfEverythingServicePostWithEmptyBodyBody) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -5852,6 +5853,8 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServicePostWithEmpty if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } + // body params + localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -6129,7 +6132,7 @@ ABitOfEverythingServiceApiService @return interface{} */ -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdate(ctx context.Context, uuidName string, body ABitOfEverythingServiceUpdateBody) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdate(ctx context.Context, uuidName string, body ExamplepbABitOfEverythingServiceUpdateBody) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -6295,7 +6298,7 @@ type ABitOfEverythingServiceUpdateBookOpts struct { AllowMissing optional.Bool } -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateBook(ctx context.Context, bookName string, book TheBookToUpdate_, localVarOptionals *ABitOfEverythingServiceUpdateBookOpts) (ExamplepbBook, *http.Response, error) { +func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateBook(ctx context.Context, bookName string, book interface{}, localVarOptionals *ABitOfEverythingServiceUpdateBookOpts) (ExamplepbBook, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -6453,7 +6456,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateBook(ct ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuidName - * @param abe + * @param abe A bit of everything Intentionally complicated message type to cover many features of Protobuf. * @param optional nil or *ABitOfEverythingServiceUpdateV2Opts - Optional Parameters: * @param "UpdateMask" (optional.String) - The paths to update. @@ -6464,7 +6467,7 @@ type ABitOfEverythingServiceUpdateV2Opts struct { UpdateMask optional.String } -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV2(ctx context.Context, uuidName string, abe ABitOfEverything, localVarOptionals *ABitOfEverythingServiceUpdateV2Opts) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV2(ctx context.Context, uuidName string, abe interface{}, localVarOptionals *ABitOfEverythingServiceUpdateV2Opts) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -6622,11 +6625,11 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV2(ctx ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuidName - * @param abe + * @param abe A bit of everything Intentionally complicated message type to cover many features of Protobuf. @return interface{} */ -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV22(ctx context.Context, uuidName string, abe ABitOfEverything1) (interface{}, *http.Response, error) { +func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV22(ctx context.Context, uuidName string, abe interface{}) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} diff --git a/examples/internal/clients/abe/api_echo_rpc.go b/examples/internal/clients/abe/api_echo_rpc.go index 1578fbff89b..40aa83f1bb2 100644 --- a/examples/internal/clients/abe/api_echo_rpc.go +++ b/examples/internal/clients/abe/api_echo_rpc.go @@ -203,7 +203,7 @@ Description Echo @return SubStringMessage */ -func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, value string) (SubStringMessage, *http.Response, error) { +func (a *EchoRpcApiService) ABitOfEverythingServiceEcho2(ctx context.Context, value interface{}) (SubStringMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} 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 9e0bb55c1e0..24930d34d48 100644 --- a/examples/internal/clients/abe/model_a_bit_of_everything.go +++ b/examples/internal/clients/abe/model_a_bit_of_everything.go @@ -19,9 +19,9 @@ type ABitOfEverything 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"` @@ -57,16 +57,16 @@ type ABitOfEverything struct { // 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_service_post_with_empty_body_body.go b/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go new file mode 100644 index 00000000000..8bdd7165a2d --- /dev/null +++ b/examples/internal/clients/abe/model_a_bit_of_everything_service_post_with_empty_body_body.go @@ -0,0 +1,14 @@ +/* + * 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 + +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..a7b9c7db8d0 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 @@ -11,7 +11,7 @@ package abe type ABitOfEverythingServiceUpdateV2Body struct { - Abe *ABitOfEverything2 `json:"abe,omitempty"` + Abe *ABitOfEverything `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_service_update_body.go b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go new file mode 100644 index 00000000000..8d7078e7249 --- /dev/null +++ b/examples/internal/clients/abe/model_examplepb_a_bit_of_everything_service_update_body.go @@ -0,0 +1,78 @@ +/* + * 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" +) + +// Intentionally complicated message type to cover many features of Protobuf. +type ExamplepbABitOfEverythingServiceUpdateBody 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"` + Uint64Value string `json:"uint64Value,omitempty"` + Int32Value int32 `json:"int32Value,omitempty"` + Fixed64Value string `json:"fixed64Value,omitempty"` + Fixed32Value int64 `json:"fixed32Value,omitempty"` + BoolValue bool `json:"boolValue,omitempty"` + StringValue string `json:"stringValue,omitempty"` + BytesValue string `json:"bytesValue,omitempty"` + Uint32Value int64 `json:"uint32Value,omitempty"` + EnumValue *ExamplepbNumericEnum `json:"enumValue,omitempty"` + PathEnumValue *PathenumPathEnum `json:"pathEnumValue,omitempty"` + NestedPathEnumValue *MessagePathEnumNestedPathEnum `json:"nestedPathEnumValue,omitempty"` + Sfixed32Value int32 `json:"sfixed32Value,omitempty"` + Sfixed64Value string `json:"sfixed64Value,omitempty"` + Sint32Value int32 `json:"sint32Value,omitempty"` + Sint64Value string `json:"sint64Value,omitempty"` + RepeatedStringValue []string `json:"repeatedStringValue,omitempty"` + OneofEmpty *interface{} `json:"oneofEmpty,omitempty"` + OneofString string `json:"oneofString,omitempty"` + MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"` + MappedStringValue map[string]string `json:"mappedStringValue,omitempty"` + MappedNestedValue map[string]ABitOfEverythingNested `json:"mappedNestedValue,omitempty"` + NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"` + TimestampValue time.Time `json:"timestampValue,omitempty"` + 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"` + 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"` + TrailingOnly string `json:"trailingOnly,omitempty"` + // Trailing only dot. + TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"` + // Trailing both. + TrailingBoth string `json:"trailingBoth,omitempty"` + // This is an example of a multi-line comment. Trailing multiline. + TrailingMultiline string `json:"trailingMultiline,omitempty"` + Uuids []string `json:"uuids,omitempty"` +} 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 a64035f141c..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 @@ -12,5 +12,5 @@ package abe type ExamplepbRequiredMessageTypeRequest struct { Id string `json:"id"` - Foo *ExamplepbFoo `json:"foo"` + Foo *ProtoexamplepbFoo `json:"foo"` } diff --git a/examples/internal/clients/abe/model_protoexamplepb_foo.go b/examples/internal/clients/abe/model_protoexamplepb_foo.go new file mode 100644 index 00000000000..343c0d93cc4 --- /dev/null +++ b/examples/internal/clients/abe/model_protoexamplepb_foo.go @@ -0,0 +1,15 @@ +/* + * 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 + +type ProtoexamplepbFoo struct { + Bar *ExamplepbBar `json:"bar"` +} diff --git a/examples/internal/clients/echo/api/swagger.yaml b/examples/internal/clients/echo/api/swagger.yaml index 03e677324a5..4a0328795ee 100644 --- a/examples/internal/clients/echo/api/swagger.yaml +++ b/examples/internal/clients/echo/api/swagger.yaml @@ -525,8 +525,7 @@ paths: - in: "body" name: "no" required: true - schema: - $ref: "#/definitions/examplepbEmbedded" + schema: {} x-exportParamName: "No" - name: "num" in: "query" @@ -599,8 +598,7 @@ paths: - in: "body" name: "resourceId" required: true - schema: - type: "string" + schema: {} x-exportParamName: "ResourceId" - name: "num" in: "query" @@ -756,8 +754,7 @@ paths: - in: "body" name: "body" required: true - schema: - $ref: "#/definitions/examplepbDynamicMessage" + schema: {} x-exportParamName: "Body" responses: 200: diff --git a/examples/internal/clients/echo/api_echo_service.go b/examples/internal/clients/echo/api_echo_service.go index 2c0241e359c..78cd1ce0ee0 100644 --- a/examples/internal/clients/echo/api_echo_service.go +++ b/examples/internal/clients/echo/api_echo_service.go @@ -1028,7 +1028,7 @@ type EchoServiceEchoBody2Opts struct { ResourceId 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, id string, no interface{}, localVarOptionals *EchoServiceEchoBody2Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -1172,7 +1172,7 @@ type EchoServiceEchoBody3Opts struct { NoNote optional.String } -func (a *EchoServiceApiService) EchoServiceEchoBody3(ctx context.Context, id string, resourceId string, localVarOptionals *EchoServiceEchoBody3Opts) (ExamplepbSimpleMessage, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEchoBody3(ctx context.Context, id string, resourceId interface{}, localVarOptionals *EchoServiceEchoBody3Opts) (ExamplepbSimpleMessage, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -1449,7 +1449,7 @@ EchoServiceApiService EchoPatch method receives a NonStandardUpdateRequest and r @return ExamplepbDynamicMessageUpdate */ -func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body ExamplepbDynamicMessage) (ExamplepbDynamicMessageUpdate, *http.Response, error) { +func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body interface{}) (ExamplepbDynamicMessageUpdate, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} 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 b3e78195669..648a43e73e3 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json +++ b/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json @@ -1142,9 +1142,7 @@ "name": "singleNested", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/ABitOfEverythingNested" - } + "schema": {} }, { "name": "uuid", @@ -2533,7 +2531,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ABitOfEverythingServiceUpdateBody" + "$ref": "#/definitions/examplepbABitOfEverythingServiceUpdateBody" } } ], @@ -4867,9 +4865,7 @@ "name": "exampleEnum", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/oneofenumExampleEnum" - } + "schema": {} } ], "tags": [ @@ -5064,24 +5060,7 @@ "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}", "in": "body", "required": true, - "schema": { - "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": "The book's `name` field is used to identify the book to be updated.\nFormat: publishers/{publisher}/books/{book}", - "title": "The book to update." - } + "schema": {} }, { "name": "allowMissing", @@ -5151,9 +5130,7 @@ "description": "The book to create.", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/examplepbBook" - } + "schema": {} }, { "name": "bookId", @@ -5220,263 +5197,10 @@ }, { "name": "abe", + "description": "A bit of everything\n\nIntentionally complicated message type to cover many features of Protobuf.", "in": "body", "required": true, - "schema": { - "type": "object", - "example": { - "int64_value": 12, - "double_value": 12.3 - }, - "properties": { - "singleNested": { - "$ref": "#/definitions/ABitOfEverythingNested" - }, - "nested": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/ABitOfEverythingNested" - } - }, - "floatValue": { - "type": "number", - "format": "float", - "default": "0.2", - "description": "Float value field" - }, - "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" - }, - "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", - "additionalProperties": { - "$ref": "#/definitions/examplepbNumericEnum" - } - }, - "mappedStringValue": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mappedNestedValue": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ABitOfEverythingNested" - } - }, - "nonConventionalNameValue": { - "type": "string" - }, - "timestampValue": { - "type": "string", - "format": "date-time" - }, - "repeatedEnumValue": { - "type": "array", - "items": { - "$ref": "#/definitions/examplepbNumericEnum" - }, - "title": "repeated enum value. it is comma-separated in query" - }, - "repeatedEnumAnnotation": { - "type": "array", - "items": { - "$ref": "#/definitions/examplepbNumericEnum" - }, - "description": "Repeated numeric enum description.", - "title": "Repeated numeric enum title" - }, - "enumValueAnnotation": { - "$ref": "#/definitions/examplepbNumericEnum", - "description": "Numeric enum description.", - "title": "Numeric enum title" - }, - "repeatedStringAnnotation": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Repeated string description.", - "title": "Repeated string title" - }, - "repeatedNestedAnnotation": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/ABitOfEverythingNested" - }, - "description": "Repeated nested object description.", - "title": "Repeated nested object title" - }, - "nestedAnnotation": { - "$ref": "#/definitions/ABitOfEverythingNested", - "description": "Nested object description.", - "title": "Nested object title" - }, - "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", - "items": { - "type": "string", - "maxLength": 19, - "minLength": 1, - "pattern": "^[0-9]+$" - }, - "description": "Only digits are allowed.", - "title": "Test openapiv2 generation of repeated fields" - }, - "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", - "items": { - "type": "string", - "format": "uuid" - }, - "title": "Specify a custom format of repeated field items" - } - }, - "description": "Intentionally complicated message type to cover many features of Protobuf.", - "title": "A bit of everything", - "externalDocs": { - "description": "Find out more about ABitOfEverything", - "url": "https://github.com/grpc-ecosystem/grpc-gateway" - }, - "required": [ - "int64Value", - "doubleValue", - "required_field_schema_json_name_custom", - "floatValue", - "requiredStringViaFieldBehaviorAnnotation", - "requiredStringField1", - "requiredStringField2", - "required_field_behavior_json_name_custom" - ], - "x-a-bit-of-everything-foo": "bar" - } + "schema": {} }, { "name": "updateMask", @@ -5541,263 +5265,10 @@ }, { "name": "abe", + "description": "A bit of everything\n\nIntentionally complicated message type to cover many features of Protobuf.", "in": "body", "required": true, - "schema": { - "type": "object", - "example": { - "int64_value": 12, - "double_value": 12.3 - }, - "properties": { - "singleNested": { - "$ref": "#/definitions/ABitOfEverythingNested" - }, - "nested": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/ABitOfEverythingNested" - } - }, - "floatValue": { - "type": "number", - "format": "float", - "default": "0.2", - "description": "Float value field" - }, - "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" - }, - "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", - "additionalProperties": { - "$ref": "#/definitions/examplepbNumericEnum" - } - }, - "mappedStringValue": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mappedNestedValue": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ABitOfEverythingNested" - } - }, - "nonConventionalNameValue": { - "type": "string" - }, - "timestampValue": { - "type": "string", - "format": "date-time" - }, - "repeatedEnumValue": { - "type": "array", - "items": { - "$ref": "#/definitions/examplepbNumericEnum" - }, - "title": "repeated enum value. it is comma-separated in query" - }, - "repeatedEnumAnnotation": { - "type": "array", - "items": { - "$ref": "#/definitions/examplepbNumericEnum" - }, - "description": "Repeated numeric enum description.", - "title": "Repeated numeric enum title" - }, - "enumValueAnnotation": { - "$ref": "#/definitions/examplepbNumericEnum", - "description": "Numeric enum description.", - "title": "Numeric enum title" - }, - "repeatedStringAnnotation": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Repeated string description.", - "title": "Repeated string title" - }, - "repeatedNestedAnnotation": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/ABitOfEverythingNested" - }, - "description": "Repeated nested object description.", - "title": "Repeated nested object title" - }, - "nestedAnnotation": { - "$ref": "#/definitions/ABitOfEverythingNested", - "description": "Nested object description.", - "title": "Nested object title" - }, - "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", - "items": { - "type": "string", - "maxLength": 19, - "minLength": 1, - "pattern": "^[0-9]+$" - }, - "description": "Only digits are allowed.", - "title": "Test openapiv2 generation of repeated fields" - }, - "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", - "items": { - "type": "string", - "format": "uuid" - }, - "title": "Specify a custom format of repeated field items" - } - }, - "description": "Intentionally complicated message type to cover many features of Protobuf.", - "title": "A bit of everything", - "externalDocs": { - "description": "Find out more about ABitOfEverything", - "url": "https://github.com/grpc-ecosystem/grpc-gateway" - }, - "required": [ - "int64Value", - "doubleValue", - "required_field_schema_json_name_custom", - "floatValue", - "requiredStringViaFieldBehaviorAnnotation", - "requiredStringField1", - "requiredStringField2", - "required_field_behavior_json_name_custom" - ], - "x-a-bit-of-everything-foo": "bar" - } + "schema": {} } ], "tags": [ @@ -5929,9 +5400,7 @@ "name": "value", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} } ], "tags": [ @@ -6189,6 +5658,14 @@ "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ABitOfEverythingServicePostWithEmptyBodyBody" + } } ], "tags": [ @@ -6294,9 +5771,7 @@ "name": "data", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/examplepbBody" - } + "schema": {} } ], "tags": [ @@ -6784,269 +6259,17 @@ ], "x-a-bit-of-everything-foo": "bar" }, - "ABitOfEverythingServiceUpdateBody": { + "ABitOfEverythingServicePostWithEmptyBodyBody": { + "type": "object" + }, + "ABitOfEverythingServiceUpdateV2Body": { "type": "object", - "example": { - "int64_value": 12, - "double_value": 12.3 - }, "properties": { - "singleNested": { - "$ref": "#/definitions/ABitOfEverythingNested" - }, - "nested": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/ABitOfEverythingNested" - } - }, - "floatValue": { - "type": "number", - "format": "float", - "default": "0.2", - "description": "Float value field" - }, - "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" - }, - "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", - "additionalProperties": { - "$ref": "#/definitions/examplepbNumericEnum" - } - }, - "mappedStringValue": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mappedNestedValue": { + "abe": { "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ABitOfEverythingNested" - } - }, - "nonConventionalNameValue": { - "type": "string" - }, - "timestampValue": { - "type": "string", - "format": "date-time" - }, - "repeatedEnumValue": { - "type": "array", - "items": { - "$ref": "#/definitions/examplepbNumericEnum" - }, - "title": "repeated enum value. it is comma-separated in query" - }, - "repeatedEnumAnnotation": { - "type": "array", - "items": { - "$ref": "#/definitions/examplepbNumericEnum" - }, - "description": "Repeated numeric enum description.", - "title": "Repeated numeric enum title" - }, - "enumValueAnnotation": { - "$ref": "#/definitions/examplepbNumericEnum", - "description": "Numeric enum description.", - "title": "Numeric enum title" - }, - "repeatedStringAnnotation": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Repeated string description.", - "title": "Repeated string title" - }, - "repeatedNestedAnnotation": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/ABitOfEverythingNested" - }, - "description": "Repeated nested object description.", - "title": "Repeated nested object title" - }, - "nestedAnnotation": { - "$ref": "#/definitions/ABitOfEverythingNested", - "description": "Nested object description.", - "title": "Nested object title" - }, - "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", - "items": { - "type": "string", - "maxLength": 19, - "minLength": 1, - "pattern": "^[0-9]+$" - }, - "description": "Only digits are allowed.", - "title": "Test openapiv2 generation of repeated fields" - }, - "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", - "items": { - "type": "string", - "format": "uuid" - }, - "title": "Specify a custom format of repeated field items" - } - }, - "description": "Intentionally complicated message type to cover many features of Protobuf.", - "title": "A bit of everything", - "externalDocs": { - "description": "Find out more about ABitOfEverything", - "url": "https://github.com/grpc-ecosystem/grpc-gateway" - }, - "required": [ - "int64Value", - "doubleValue", - "required_field_schema_json_name_custom", - "floatValue", - "requiredStringViaFieldBehaviorAnnotation", - "requiredStringField1", - "requiredStringField2", - "required_field_behavior_json_name_custom" - ], - "x-a-bit-of-everything-foo": "bar" - }, - "ABitOfEverythingServiceUpdateV2Body": { - "type": "object", - "properties": { - "abe": { - "type": "object", - "example": { - "int64_value": 12, - "double_value": 12.3 + "example": { + "int64_value": 12, + "double_value": 12.3 }, "properties": { "singleNested": { @@ -7713,6 +6936,261 @@ }, "title": "ABitOfEverythingRepeated is used to validate repeated path parameter functionality" }, + "examplepbABitOfEverythingServiceUpdateBody": { + "type": "object", + "example": { + "int64_value": 12, + "double_value": 12.3 + }, + "properties": { + "singleNested": { + "$ref": "#/definitions/ABitOfEverythingNested" + }, + "nested": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/ABitOfEverythingNested" + } + }, + "floatValue": { + "type": "number", + "format": "float", + "default": "0.2", + "description": "Float value field" + }, + "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" + }, + "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", + "additionalProperties": { + "$ref": "#/definitions/examplepbNumericEnum" + } + }, + "mappedStringValue": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mappedNestedValue": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ABitOfEverythingNested" + } + }, + "nonConventionalNameValue": { + "type": "string" + }, + "timestampValue": { + "type": "string", + "format": "date-time" + }, + "repeatedEnumValue": { + "type": "array", + "items": { + "$ref": "#/definitions/examplepbNumericEnum" + }, + "title": "repeated enum value. it is comma-separated in query" + }, + "repeatedEnumAnnotation": { + "type": "array", + "items": { + "$ref": "#/definitions/examplepbNumericEnum" + }, + "description": "Repeated numeric enum description.", + "title": "Repeated numeric enum title" + }, + "enumValueAnnotation": { + "$ref": "#/definitions/examplepbNumericEnum", + "description": "Numeric enum description.", + "title": "Numeric enum title" + }, + "repeatedStringAnnotation": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Repeated string description.", + "title": "Repeated string title" + }, + "repeatedNestedAnnotation": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/ABitOfEverythingNested" + }, + "description": "Repeated nested object description.", + "title": "Repeated nested object title" + }, + "nestedAnnotation": { + "$ref": "#/definitions/ABitOfEverythingNested", + "description": "Nested object description.", + "title": "Nested object title" + }, + "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", + "items": { + "type": "string", + "maxLength": 19, + "minLength": 1, + "pattern": "^[0-9]+$" + }, + "description": "Only digits are allowed.", + "title": "Test openapiv2 generation of repeated fields" + }, + "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", + "items": { + "type": "string", + "format": "uuid" + }, + "title": "Specify a custom format of repeated field items" + } + }, + "description": "Intentionally complicated message type to cover many features of Protobuf.", + "title": "A bit of everything", + "externalDocs": { + "description": "Find out more about ABitOfEverything", + "url": "https://github.com/grpc-ecosystem/grpc-gateway" + }, + "required": [ + "int64Value", + "doubleValue", + "required_field_schema_json_name_custom", + "floatValue", + "requiredStringViaFieldBehaviorAnnotation", + "requiredStringField1", + "requiredStringField2", + "required_field_behavior_json_name_custom" + ], + "x-a-bit-of-everything-foo": "bar" + }, "examplepbBar": { "type": "object", "properties": { @@ -7795,17 +7273,6 @@ } } }, - "examplepbFoo": { - "type": "object", - "properties": { - "bar": { - "$ref": "#/definitions/examplepbBar" - } - }, - "required": [ - "bar" - ] - }, "examplepbNumericEnum": { "type": "string", "enum": [ @@ -7822,7 +7289,7 @@ "type": "string" }, "foo": { - "$ref": "#/definitions/examplepbFoo" + "$ref": "#/definitions/protoexamplepbFoo" } }, "title": "Required message type -\u003e OpenAPI\nhttps://github.com/grpc-ecosystem/grpc-gateway/issues/2837", @@ -7891,6 +7358,17 @@ "additionalProperties": {}, "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(\u0026foo)) {\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\nExample 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\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.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\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional 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\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\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 }" }, + "protoexamplepbFoo": { + "type": "object", + "properties": { + "bar": { + "$ref": "#/definitions/examplepbBar" + } + }, + "required": [ + "bar" + ] + }, "rpcStatus": { "type": "object", "properties": { diff --git a/examples/internal/proto/examplepb/echo_service.swagger.json b/examples/internal/proto/examplepb/echo_service.swagger.json index 63ada7660f3..281d7daffd1 100644 --- a/examples/internal/proto/examplepb/echo_service.swagger.json +++ b/examples/internal/proto/examplepb/echo_service.swagger.json @@ -621,9 +621,7 @@ "name": "no", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/examplepbEmbedded" - } + "schema": {} }, { "name": "num", @@ -707,9 +705,7 @@ "name": "resourceId", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} }, { "name": "num", @@ -884,9 +880,7 @@ "name": "body", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/examplepbDynamicMessage" - } + "schema": {} } ], "tags": [ diff --git a/examples/internal/proto/examplepb/flow_combination.swagger.json b/examples/internal/proto/examplepb/flow_combination.swagger.json index ba73e272d21..00e005a9a58 100644 --- a/examples/internal/proto/examplepb/flow_combination.swagger.json +++ b/examples/internal/proto/examplepb/flow_combination.swagger.json @@ -44,9 +44,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} }, { "name": "b", @@ -97,9 +95,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} }, { "name": "b", @@ -147,9 +143,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} } ], "tags": [ @@ -200,9 +194,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} } ], "tags": [ @@ -232,9 +224,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} }, { "name": "a", @@ -285,9 +275,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} }, { "name": "a", @@ -536,9 +524,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} } ], "tags": [ @@ -589,9 +575,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} } ], "tags": [ @@ -720,9 +704,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} }, { "name": "b", @@ -773,9 +755,7 @@ "name": "c", "in": "body", "required": true, - "schema": { - "type": "string" - } + "schema": {} }, { "name": "b", diff --git a/examples/internal/proto/examplepb/non_standard_names.swagger.json b/examples/internal/proto/examplepb/non_standard_names.swagger.json index b86a36024a5..9241280df83 100644 --- a/examples/internal/proto/examplepb/non_standard_names.swagger.json +++ b/examples/internal/proto/examplepb/non_standard_names.swagger.json @@ -39,9 +39,7 @@ "name": "body", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/examplepbNonStandardMessage" - } + "schema": {} } ], "tags": [ @@ -72,9 +70,7 @@ "name": "body", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/examplepbNonStandardMessageWithJSONNames" - } + "schema": {} } ], "tags": [ diff --git a/runtime/internal/examplepb/non_standard_names.swagger.json b/runtime/internal/examplepb/non_standard_names.swagger.json index 56c2a7511f5..4e570286730 100644 --- a/runtime/internal/examplepb/non_standard_names.swagger.json +++ b/runtime/internal/examplepb/non_standard_names.swagger.json @@ -39,9 +39,7 @@ "name": "body", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/examplepbNonStandardMessage" - } + "schema": {} } ], "tags": [ @@ -72,9 +70,7 @@ "name": "body", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/examplepbNonStandardMessageWithJSONNames" - } + "schema": {} } ], "tags": [