{ "swagger": "2.0", "info": { "title": "A Bit of Everything", "version": "1.0", "contact": { "name": "gRPC-Gateway project", "url": "https://github.com/grpc-ecosystem/grpc-gateway", "email": "none@example.com" }, "license": { "name": "BSD 3-Clause License", "url": "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt" }, "x-something-something": "yadda" }, "schemes": [ "http", "https", "wss" ], "consumes": [ "application/json", "application/x-foo-mime" ], "produces": [ "application/json", "application/x-foo-mime" ], "paths": { "/v1/example/a_bit_of_everything": { "post": { "operationId": "ABitOfEverythingService_CreateBody", "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/examplepbABitOfEverything" } } ], "tags": [ "ABitOfEverythingService" ] } }, "/v1/example/a_bit_of_everything/echo/{value}": { "get": { "summary": "Summary: Echo rpc", "description": "Description Echo", "operationId": "ABitOfEverythingService_Echo", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/subStringMessage" }, "examples": { "application/json": { "value": "the input value" } } }, "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" } }, "503": { "description": "Returned when the resource is temporarily unavailable.", "schema": {}, "x-number": 100 }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "value", "in": "path", "required": true, "type": "string" } ], "tags": [ "echo rpc" ], "externalDocs": { "description": "Find out more Echo", "url": "https://github.com/grpc-ecosystem/grpc-gateway" } } }, "/v1/example/a_bit_of_everything/params/get/nested_enum/{single_nested.ok}": { "get": { "operationId": "ABitOfEverythingService_CheckNestedEnumGetQueryParams", "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "single_nested.ok", "description": "DeepEnum description.", "in": "path", "required": true, "type": "string", "enum": [ "FALSE", "TRUE" ] }, { "name": "single_nested.name", "description": "name is nested field.", "in": "query", "required": false, "type": "string" }, { "name": "single_nested.amount", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "uuid", "in": "query", "required": false, "type": "string" }, { "name": "float_value", "description": "Float value field", "in": "query", "required": true, "type": "number", "format": "float", "default": "0.2" }, { "name": "double_value", "in": "query", "required": false, "type": "number", "format": "double" }, { "name": "int64_value", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "uint64_value", "in": "query", "required": false, "type": "string", "format": "uint64" }, { "name": "int32_value", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "fixed64_value", "in": "query", "required": false, "type": "string", "format": "uint64" }, { "name": "fixed32_value", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "bool_value", "in": "query", "required": false, "type": "boolean", "format": "boolean" }, { "name": "string_value", "in": "query", "required": false, "type": "string" }, { "name": "bytes_value", "in": "query", "required": false, "type": "string", "format": "byte" }, { "name": "uint32_value", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "enum_value", "description": " - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "string", "enum": [ "ZERO", "ONE" ], "default": "ZERO" }, { "name": "path_enum_value", "in": "query", "required": false, "type": "string", "enum": [ "ABC", "DEF" ], "default": "ABC" }, { "name": "nested_path_enum_value", "in": "query", "required": false, "type": "string", "enum": [ "GHI", "JKL" ], "default": "GHI" }, { "name": "sfixed32_value", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "sfixed64_value", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "sint32_value", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "sint64_value", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "repeated_string_value", "in": "query", "required": false, "type": "array", "items": { "type": "string" }, "collectionFormat": "multi" }, { "name": "oneof_string", "in": "query", "required": false, "type": "string" }, { "name": "nonConventionalNameValue", "in": "query", "required": false, "type": "string" }, { "name": "timestamp_value", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "repeated_enum_value", "description": "repeated enum value. it is comma-separated in query.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ "ZERO", "ONE" ] }, "collectionFormat": "multi" }, { "name": "repeated_enum_annotation", "description": "Repeated numeric enum title. Repeated numeric enum description.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ "ZERO", "ONE" ] }, "collectionFormat": "multi" }, { "name": "enum_value_annotation", "description": "Numeric enum title. Numeric enum description.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "string", "enum": [ "ZERO", "ONE" ], "default": "ZERO" }, { "name": "repeated_string_annotation", "description": "Repeated string title. Repeated string description.", "in": "query", "required": false, "type": "array", "items": { "type": "string" }, "collectionFormat": "multi" }, { "name": "nested_annotation.name", "description": "name is nested field.", "in": "query", "required": false, "type": "string" }, { "name": "nested_annotation.amount", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "int64_override_type", "in": "query", "required": false, "type": "integer", "format": "int64" } ], "tags": [ "ABitOfEverythingService" ] } }, "/v1/example/a_bit_of_everything/params/get/{single_nested.name}": { "get": { "operationId": "ABitOfEverythingService_CheckGetQueryParams", "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "single_nested.name", "description": "name is nested field.", "in": "path", "required": true, "type": "string" }, { "name": "single_nested.amount", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "single_nested.ok", "description": "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE: TRUE is true.", "in": "query", "required": false, "type": "string", "enum": [ "FALSE", "TRUE" ], "default": "FALSE" }, { "name": "uuid", "in": "query", "required": false, "type": "string" }, { "name": "float_value", "description": "Float value field", "in": "query", "required": true, "type": "number", "format": "float", "default": "0.2" }, { "name": "double_value", "in": "query", "required": false, "type": "number", "format": "double" }, { "name": "int64_value", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "uint64_value", "in": "query", "required": false, "type": "string", "format": "uint64" }, { "name": "int32_value", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "fixed64_value", "in": "query", "required": false, "type": "string", "format": "uint64" }, { "name": "fixed32_value", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "bool_value", "in": "query", "required": false, "type": "boolean", "format": "boolean" }, { "name": "string_value", "in": "query", "required": false, "type": "string" }, { "name": "bytes_value", "in": "query", "required": false, "type": "string", "format": "byte" }, { "name": "uint32_value", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "enum_value", "description": " - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "string", "enum": [ "ZERO", "ONE" ], "default": "ZERO" }, { "name": "path_enum_value", "in": "query", "required": false, "type": "string", "enum": [ "ABC", "DEF" ], "default": "ABC" }, { "name": "nested_path_enum_value", "in": "query", "required": false, "type": "string", "enum": [ "GHI", "JKL" ], "default": "GHI" }, { "name": "sfixed32_value", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "sfixed64_value", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "sint32_value", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "sint64_value", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "repeated_string_value", "in": "query", "required": false, "type": "array", "items": { "type": "string" }, "collectionFormat": "multi" }, { "name": "oneof_string", "in": "query", "required": false, "type": "string" }, { "name": "nonConventionalNameValue", "in": "query", "required": false, "type": "string" }, { "name": "timestamp_value", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "repeated_enum_value", "description": "repeated enum value. it is comma-separated in query.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ "ZERO", "ONE" ] }, "collectionFormat": "multi" }, { "name": "repeated_enum_annotation", "description": "Repeated numeric enum title. Repeated numeric enum description.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ "ZERO", "ONE" ] }, "collectionFormat": "multi" }, { "name": "enum_value_annotation", "description": "Numeric enum title. Numeric enum description.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "string", "enum": [ "ZERO", "ONE" ], "default": "ZERO" }, { "name": "repeated_string_annotation", "description": "Repeated string title. Repeated string description.", "in": "query", "required": false, "type": "array", "items": { "type": "string" }, "collectionFormat": "multi" }, { "name": "nested_annotation.amount", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "nested_annotation.ok", "description": "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE: TRUE is true.", "in": "query", "required": false, "type": "string", "enum": [ "FALSE", "TRUE" ], "default": "FALSE" }, { "name": "int64_override_type", "in": "query", "required": false, "type": "integer", "format": "int64" } ], "tags": [ "ABitOfEverythingService" ] } }, "/v1/example/a_bit_of_everything/params/post/{string_value}": { "post": { "operationId": "ABitOfEverythingService_CheckPostQueryParams", "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "string_value", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ABitOfEverythingNested" } } ], "tags": [ "ABitOfEverythingService" ] } }, "/v1/example/a_bit_of_everything/query/{uuid}": { "get": { "operationId": "ABitOfEverythingService_GetQuery", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "uuid", "in": "path", "required": true, "type": "string" }, { "name": "single_nested.name", "description": "name is nested field.", "in": "query", "required": false, "type": "string" }, { "name": "single_nested.amount", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "single_nested.ok", "description": "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE: TRUE is true.", "in": "query", "required": false, "type": "string", "enum": [ "FALSE", "TRUE" ], "default": "FALSE" }, { "name": "float_value", "description": "Float value field", "in": "query", "required": true, "type": "number", "format": "float", "default": "0.2" }, { "name": "double_value", "in": "query", "required": false, "type": "number", "format": "double" }, { "name": "int64_value", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "uint64_value", "in": "query", "required": false, "type": "string", "format": "uint64" }, { "name": "int32_value", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "fixed64_value", "in": "query", "required": false, "type": "string", "format": "uint64" }, { "name": "fixed32_value", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "bool_value", "in": "query", "required": false, "type": "boolean", "format": "boolean" }, { "name": "string_value", "in": "query", "required": false, "type": "string" }, { "name": "bytes_value", "in": "query", "required": false, "type": "string", "format": "byte" }, { "name": "uint32_value", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "enum_value", "description": " - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "string", "enum": [ "ZERO", "ONE" ], "default": "ZERO" }, { "name": "path_enum_value", "in": "query", "required": false, "type": "string", "enum": [ "ABC", "DEF" ], "default": "ABC" }, { "name": "nested_path_enum_value", "in": "query", "required": false, "type": "string", "enum": [ "GHI", "JKL" ], "default": "GHI" }, { "name": "sfixed32_value", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "sfixed64_value", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "sint32_value", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "sint64_value", "in": "query", "required": false, "type": "string", "format": "int64" }, { "name": "repeated_string_value", "in": "query", "required": false, "type": "array", "items": { "type": "string" }, "collectionFormat": "multi" }, { "name": "oneof_string", "in": "query", "required": false, "type": "string" }, { "name": "nonConventionalNameValue", "in": "query", "required": false, "type": "string" }, { "name": "timestamp_value", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "repeated_enum_value", "description": "repeated enum value. it is comma-separated in query.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ "ZERO", "ONE" ] }, "collectionFormat": "multi" }, { "name": "repeated_enum_annotation", "description": "Repeated numeric enum title. Repeated numeric enum description.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ "ZERO", "ONE" ] }, "collectionFormat": "multi" }, { "name": "enum_value_annotation", "description": "Numeric enum title. Numeric enum description.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1", "in": "query", "required": false, "type": "string", "enum": [ "ZERO", "ONE" ], "default": "ZERO" }, { "name": "repeated_string_annotation", "description": "Repeated string title. Repeated string description.", "in": "query", "required": false, "type": "array", "items": { "type": "string" }, "collectionFormat": "multi" }, { "name": "nested_annotation.name", "description": "name is nested field.", "in": "query", "required": false, "type": "string" }, { "name": "nested_annotation.amount", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "nested_annotation.ok", "description": "DeepEnum description.\n\n - FALSE: FALSE is false.\n - TRUE: TRUE is true.", "in": "query", "required": false, "type": "string", "enum": [ "FALSE", "TRUE" ], "default": "FALSE" }, { "name": "int64_override_type", "in": "query", "required": false, "type": "integer", "format": "int64" } ], "tags": [ "ABitOfEverythingService" ], "deprecated": true, "security": [], "externalDocs": { "description": "Find out more about GetQuery", "url": "https://github.com/grpc-ecosystem/grpc-gateway" } } }, "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}/{enum_value}/{path_enum_value}/{nested_path_enum_value}/{enum_value_annotation}": { "post": { "summary": "Create a new ABitOfEverything", "description": "This API creates a new ABitOfEverything", "operationId": "ABitOfEverythingService_Create", "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "float_value", "description": "Float value field", "in": "path", "required": true, "type": "number", "format": "float", "default": "0.2" }, { "name": "double_value", "in": "path", "required": true, "type": "number", "format": "double" }, { "name": "int64_value", "in": "path", "required": true, "type": "string", "format": "int64" }, { "name": "uint64_value", "in": "path", "required": true, "type": "string", "format": "uint64" }, { "name": "int32_value", "in": "path", "required": true, "type": "integer", "format": "int32" }, { "name": "fixed64_value", "in": "path", "required": true, "type": "string", "format": "uint64" }, { "name": "fixed32_value", "in": "path", "required": true, "type": "integer", "format": "int64" }, { "name": "bool_value", "in": "path", "required": true, "type": "boolean", "format": "boolean" }, { "name": "string_value", "in": "path", "required": true, "type": "string" }, { "name": "uint32_value", "in": "path", "required": true, "type": "integer", "format": "int64" }, { "name": "sfixed32_value", "in": "path", "required": true, "type": "integer", "format": "int32" }, { "name": "sfixed64_value", "in": "path", "required": true, "type": "string", "format": "int64" }, { "name": "sint32_value", "in": "path", "required": true, "type": "integer", "format": "int32" }, { "name": "sint64_value", "in": "path", "required": true, "type": "string", "format": "int64" }, { "name": "nonConventionalNameValue", "in": "path", "required": true, "type": "string" }, { "name": "enum_value", "in": "path", "required": true, "type": "string", "enum": [ "ZERO", "ONE" ] }, { "name": "path_enum_value", "in": "path", "required": true, "type": "string", "enum": [ "ABC", "DEF" ] }, { "name": "nested_path_enum_value", "in": "path", "required": true, "type": "string", "enum": [ "GHI", "JKL" ] }, { "name": "enum_value_annotation", "description": "Numeric enum description.", "in": "path", "required": true, "type": "string", "enum": [ "ZERO", "ONE" ] } ], "tags": [ "ABitOfEverythingService" ] } }, "/v1/example/a_bit_of_everything/{single_nested.name}": { "post": { "operationId": "ABitOfEverythingService_DeepPathEcho", "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "single_nested.name", "description": "name is nested field.", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/examplepbABitOfEverything" } } ], "tags": [ "ABitOfEverythingService" ] } }, "/v1/example/a_bit_of_everything/{uuid}": { "get": { "operationId": "ABitOfEverythingService_Lookup", "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "uuid", "in": "path", "required": true, "type": "string" } ], "tags": [ "ABitOfEverythingService" ] }, "delete": { "operationId": "ABitOfEverythingService_Delete", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "uuid", "in": "path", "required": true, "type": "string" } ], "tags": [ "ABitOfEverythingService" ], "security": [ { "ApiKeyAuth": [], "OAuth2": [ "read", "write" ] } ], "x-irreversible": true }, "put": { "operationId": "ABitOfEverythingService_Update", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "uuid", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/examplepbABitOfEverything" } } ], "tags": [ "ABitOfEverythingService" ] } }, "/v1/example/a_bit_of_everything_repeated/{path_repeated_float_value}/{path_repeated_double_value}/{path_repeated_int64_value}/{path_repeated_uint64_value}/{path_repeated_int32_value}/{path_repeated_fixed64_value}/{path_repeated_fixed32_value}/{path_repeated_bool_value}/{path_repeated_string_value}/{path_repeated_bytes_value}/{path_repeated_uint32_value}/{path_repeated_enum_value}/{path_repeated_sfixed32_value}/{path_repeated_sfixed64_value}/{path_repeated_sint32_value}/{path_repeated_sint64_value}": { "get": { "operationId": "ABitOfEverythingService_GetRepeatedQuery", "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "path_repeated_float_value", "description": "repeated values. they are comma-separated in path", "in": "path", "required": true, "type": "array", "items": { "type": "number", "format": "float" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_double_value", "in": "path", "required": true, "type": "array", "items": { "type": "number", "format": "double" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_int64_value", "in": "path", "required": true, "type": "array", "items": { "type": "string", "format": "int64" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_uint64_value", "in": "path", "required": true, "type": "array", "items": { "type": "string", "format": "uint64" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_int32_value", "in": "path", "required": true, "type": "array", "items": { "type": "integer", "format": "int32" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_fixed64_value", "in": "path", "required": true, "type": "array", "items": { "type": "string", "format": "uint64" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_fixed32_value", "in": "path", "required": true, "type": "array", "items": { "type": "integer", "format": "int64" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_bool_value", "in": "path", "required": true, "type": "array", "items": { "type": "boolean", "format": "boolean" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_string_value", "in": "path", "required": true, "type": "array", "items": { "type": "string" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_bytes_value", "in": "path", "required": true, "type": "array", "items": { "type": "string", "format": "byte" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_uint32_value", "in": "path", "required": true, "type": "array", "items": { "type": "integer", "format": "int64" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_enum_value", "in": "path", "required": true, "type": "array", "items": { "type": "string", "enum": [ "ZERO", "ONE" ] }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_sfixed32_value", "in": "path", "required": true, "type": "array", "items": { "type": "integer", "format": "int32" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_sfixed64_value", "in": "path", "required": true, "type": "array", "items": { "type": "string", "format": "int64" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_sint32_value", "in": "path", "required": true, "type": "array", "items": { "type": "integer", "format": "int32" }, "collectionFormat": "csv", "minItems": 1 }, { "name": "path_repeated_sint64_value", "in": "path", "required": true, "type": "array", "items": { "type": "string", "format": "int64" }, "collectionFormat": "csv", "minItems": 1 } ], "tags": [ "ABitOfEverythingService" ] } }, "/v2/example/a_bit_of_everything/{abe.uuid}": { "put": { "operationId": "ABitOfEverythingService_UpdateV2", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "abe.uuid", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/examplepbABitOfEverything" } } ], "tags": [ "ABitOfEverythingService" ] }, "patch": { "operationId": "ABitOfEverythingService_UpdateV22", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "abe.uuid", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/examplepbABitOfEverything" } } ], "tags": [ "ABitOfEverythingService" ] } }, "/v2/example/echo": { "get": { "summary": "Summary: Echo rpc", "description": "Description Echo", "operationId": "ABitOfEverythingService_Echo3", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/subStringMessage" }, "examples": { "application/json": { "value": "the input value" } } }, "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" } }, "503": { "description": "Returned when the resource is temporarily unavailable.", "schema": {}, "x-number": 100 }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "value", "in": "query", "required": false, "type": "string" } ], "tags": [ "echo rpc" ], "externalDocs": { "description": "Find out more Echo", "url": "https://github.com/grpc-ecosystem/grpc-gateway" } }, "post": { "summary": "Summary: Echo rpc", "description": "Description Echo", "operationId": "ABitOfEverythingService_Echo2", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/subStringMessage" }, "examples": { "application/json": { "value": "the input value" } } }, "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" } }, "503": { "description": "Returned when the resource is temporarily unavailable.", "schema": {}, "x-number": 100 }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "type": "string" } } ], "tags": [ "echo rpc" ], "externalDocs": { "description": "Find out more Echo", "url": "https://github.com/grpc-ecosystem/grpc-gateway" } } }, "/v2/example/empty": { "get": { "operationId": "camelCaseServiceName_Empty", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "tags": [ "camelCaseServiceName" ] } }, "/v2/example/errorwithdetails": { "get": { "operationId": "ABitOfEverythingService_ErrorWithDetails", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "tags": [ "ABitOfEverythingService" ] } }, "/v2/example/overwriteresponsecontenttype": { "get": { "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "tags": [ "ABitOfEverythingService" ], "produces": [ "application/text" ] } }, "/v2/example/postwithemptybody/{name}": { "post": { "operationId": "ABitOfEverythingService_PostWithEmptyBody", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "name", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/examplepbBody" } } ], "tags": [ "ABitOfEverythingService" ] } }, "/v2/example/timeout": { "get": { "operationId": "ABitOfEverythingService_Timeout", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "tags": [ "ABitOfEverythingService" ] } }, "/v2/example/withbody/{id}": { "post": { "operationId": "ABitOfEverythingService_GetMessageWithBody", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "id", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/examplepbBody" } } ], "tags": [ "ABitOfEverythingService" ] } }, "/v2a/example/a_bit_of_everything/{abe.uuid}": { "patch": { "operationId": "ABitOfEverythingService_UpdateV23", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "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" } }, "default": { "description": "An unexpected error response", "schema": { "$ref": "#/definitions/runtimeError" } } }, "parameters": [ { "name": "abe.uuid", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/examplepbUpdateV2Request" } } ], "tags": [ "ABitOfEverythingService" ] } } }, "definitions": { "ABitOfEverythingNested": { "type": "object", "example": { "ok": "TRUE" }, "properties": { "name": { "type": "string", "description": "name is nested field." }, "amount": { "type": "integer", "format": "int64" }, "ok": { "$ref": "#/definitions/NestedDeepEnum", "description": "DeepEnum description." } }, "description": "Nested is nested type." }, "MessagePathEnumNestedPathEnum": { "type": "string", "enum": [ "GHI", "JKL" ], "default": "GHI" }, "NestedDeepEnum": { "type": "string", "enum": [ "FALSE", "TRUE" ], "default": "FALSE", "description": "DeepEnum is one or zero.\n\n - FALSE: FALSE is false.\n - TRUE: TRUE is true." }, "examplepbABitOfEverything": { "type": "object", "example": { "uuid": "0cf361e1-4b44-483d-a159-54dabdf7e814" }, "properties": { "single_nested": { "$ref": "#/definitions/ABitOfEverythingNested" }, "uuid": { "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}" }, "nested": { "type": "array", "items": { "$ref": "#/definitions/ABitOfEverythingNested" } }, "float_value": { "type": "number", "format": "float", "default": "0.2", "description": "Float value field", "required": [ "float_value" ] }, "double_value": { "type": "number", "format": "double" }, "int64_value": { "type": "string", "format": "int64" }, "uint64_value": { "type": "string", "format": "uint64" }, "int32_value": { "type": "integer", "format": "int32" }, "fixed64_value": { "type": "string", "format": "uint64" }, "fixed32_value": { "type": "integer", "format": "int64" }, "bool_value": { "type": "boolean", "format": "boolean" }, "string_value": { "type": "string" }, "bytes_value": { "type": "string", "format": "byte" }, "uint32_value": { "type": "integer", "format": "int64" }, "enum_value": { "$ref": "#/definitions/examplepbNumericEnum" }, "path_enum_value": { "$ref": "#/definitions/pathenumPathEnum" }, "nested_path_enum_value": { "$ref": "#/definitions/MessagePathEnumNestedPathEnum" }, "sfixed32_value": { "type": "integer", "format": "int32" }, "sfixed64_value": { "type": "string", "format": "int64" }, "sint32_value": { "type": "integer", "format": "int32" }, "sint64_value": { "type": "string", "format": "int64" }, "repeated_string_value": { "type": "array", "items": { "type": "string" } }, "oneof_empty": { "properties": {} }, "oneof_string": { "type": "string" }, "map_value": { "type": "object", "additionalProperties": { "$ref": "#/definitions/examplepbNumericEnum" } }, "mapped_string_value": { "type": "object", "additionalProperties": { "type": "string" } }, "mapped_nested_value": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ABitOfEverythingNested" } }, "nonConventionalNameValue": { "type": "string" }, "timestamp_value": { "type": "string", "format": "date-time" }, "repeated_enum_value": { "type": "array", "items": { "$ref": "#/definitions/examplepbNumericEnum" }, "title": "repeated enum value. it is comma-separated in query" }, "repeated_enum_annotation": { "type": "array", "items": { "$ref": "#/definitions/examplepbNumericEnum" }, "description": "Repeated numeric enum description.", "title": "Repeated numeric enum title" }, "enum_value_annotation": { "$ref": "#/definitions/examplepbNumericEnum", "description": "Numeric enum description.", "title": "Numeric enum title" }, "repeated_string_annotation": { "type": "array", "items": { "type": "string" }, "description": "Repeated string description.", "title": "Repeated string title" }, "repeated_nested_annotation": { "type": "array", "items": { "$ref": "#/definitions/ABitOfEverythingNested" }, "description": "Repeated nested object description.", "title": "Repeated nested object title" }, "nested_annotation": { "$ref": "#/definitions/ABitOfEverythingNested", "description": "Nested object description.", "title": "Nested object title" }, "int64_override_type": { "type": "integer", "format": "int64" } }, "description": "Intentionaly 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": [ "uuid", "int64_value", "double_value" ] }, "examplepbABitOfEverythingRepeated": { "type": "object", "example": { "path_repeated_bool_value": [ true, true, false, true ], "path_repeated_int32_value": [ 1, 2, 3 ] }, "properties": { "path_repeated_float_value": { "type": "array", "items": { "type": "number", "format": "float" }, "title": "repeated values. they are comma-separated in path" }, "path_repeated_double_value": { "type": "array", "items": { "type": "number", "format": "double" } }, "path_repeated_int64_value": { "type": "array", "items": { "type": "string", "format": "int64" } }, "path_repeated_uint64_value": { "type": "array", "items": { "type": "string", "format": "uint64" } }, "path_repeated_int32_value": { "type": "array", "items": { "type": "integer", "format": "int32" } }, "path_repeated_fixed64_value": { "type": "array", "items": { "type": "string", "format": "uint64" } }, "path_repeated_fixed32_value": { "type": "array", "items": { "type": "integer", "format": "int64" } }, "path_repeated_bool_value": { "type": "array", "items": { "type": "boolean", "format": "boolean" } }, "path_repeated_string_value": { "type": "array", "items": { "type": "string" } }, "path_repeated_bytes_value": { "type": "array", "items": { "type": "string", "format": "byte" } }, "path_repeated_uint32_value": { "type": "array", "items": { "type": "integer", "format": "int64" } }, "path_repeated_enum_value": { "type": "array", "items": { "$ref": "#/definitions/examplepbNumericEnum" } }, "path_repeated_sfixed32_value": { "type": "array", "items": { "type": "integer", "format": "int32" } }, "path_repeated_sfixed64_value": { "type": "array", "items": { "type": "string", "format": "int64" } }, "path_repeated_sint32_value": { "type": "array", "items": { "type": "integer", "format": "int32" } }, "path_repeated_sint64_value": { "type": "array", "items": { "type": "string", "format": "int64" } } }, "title": "ABitOfEverythingRepeated is used to validate repeated path parameter functionality" }, "examplepbBody": { "type": "object", "properties": { "name": { "type": "string" } } }, "examplepbNumericEnum": { "type": "string", "enum": [ "ZERO", "ONE" ], "default": "ZERO", "description": "NumericEnum is one or zero.\n\n - ZERO: ZERO means 0\n - ONE: ONE means 1" }, "examplepbUpdateV2Request": { "type": "object", "properties": { "abe": { "$ref": "#/definitions/examplepbABitOfEverything" }, "update_mask": { "$ref": "#/definitions/protobufFieldMask" } }, "title": "UpdateV2Request request for update includes the message and the update mask" }, "pathenumPathEnum": { "type": "string", "enum": [ "ABC", "DEF" ], "default": "ABC" }, "protobufAny": { "type": "object", "properties": { "type_url": { "type": "string", "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe 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\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver 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.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", "format": "byte", "description": "Must be a valid serialized protocol buffer of the above specified type." } }, "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\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 := \u0026pb.Foo{...}\n any, err := ptypes.MarshalAny(foo)\n ...\n foo := \u0026pb.Foo{}\n if err := ptypes.UnmarshalAny(any, 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 }" }, "protobufFieldMask": { "type": "object", "properties": { "paths": { "type": "array", "items": { "type": "string" }, "description": "The set of field mask paths." } }, "description": "paths: \"f.a\"\n paths: \"f.b.d\"\n\nHere `f` represents a field in some root message, `a` and `b`\nfields in the message found in `f`, and `d` a field found in the\nmessage in `f.b`.\n\nField masks are used to specify a subset of fields that should be\nreturned by a get operation or modified by an update operation.\nField masks also have a custom JSON encoding (see below).\n\n# Field Masks in Projections\n\nWhen used in the context of a projection, a response message or\nsub-message is filtered by the API to only contain those fields as\nspecified in the mask. For example, if the mask in the previous\nexample is applied to a response message as follows:\n\n f {\n a : 22\n b {\n d : 1\n x : 2\n }\n y : 13\n }\n z: 8\n\nThe result will not contain specific values for fields x,y and z\n(their value will be set to the default, and omitted in proto text\noutput):\n\n\n f {\n a : 22\n b {\n d : 1\n }\n }\n\nA repeated field is not allowed except at the last position of a\npaths string.\n\nIf a FieldMask object is not present in a get operation, the\noperation applies to all fields (as if a FieldMask of all fields\nhad been specified).\n\nNote that a field mask does not necessarily apply to the\ntop-level response message. In case of a REST get operation, the\nfield mask applies directly to the response, but in case of a REST\nlist operation, the mask instead applies to each individual message\nin the returned resource list. In case of a REST custom method,\nother definitions may be used. Where the mask applies will be\nclearly documented together with its declaration in the API. In\nany case, the effect on the returned resource/resources is required\nbehavior for APIs.\n\n# Field Masks in Update Operations\n\nA field mask in update operations specifies which fields of the\ntargeted resource are going to be updated. The API is required\nto only change the values of the fields as specified in the mask\nand leave the others untouched. If a resource is passed in to\ndescribe the updated values, the API ignores the values of all\nfields not covered by the mask.\n\nIf a repeated field is specified for an update operation, new values will\nbe appended to the existing repeated field in the target resource. Note that\na repeated field is only allowed in the last position of a `paths` string.\n\nIf a sub-message is specified in the last position of the field mask for an\nupdate operation, then new value will be merged into the existing sub-message\nin the target resource.\n\nFor example, given the target message:\n\n f {\n b {\n d: 1\n x: 2\n }\n c: [1]\n }\n\nAnd an update message:\n\n f {\n b {\n d: 10\n }\n c: [2]\n }\n\nthen if the field mask is:\n\n paths: [\"f.b\", \"f.c\"]\n\nthen the result will be:\n\n f {\n b {\n d: 10\n x: 2\n }\n c: [1, 2]\n }\n\nAn implementation may provide options to override this default behavior for\nrepeated and message fields.\n\nIn order to reset a field's value to the default, the field must\nbe in the mask and set to the default value in the provided resource.\nHence, in order to reset all fields of a resource, provide a default\ninstance of the resource and set all fields in the mask, or do\nnot provide a mask as described below.\n\nIf a field mask is not present on update, the operation applies to\nall fields (as if a field mask of all fields has been specified).\nNote that in the presence of schema evolution, this may mean that\nfields the client does not know and has therefore not filled into\nthe request will be reset to their default. If this is unwanted\nbehavior, a specific service may require a client to always specify\na field mask, producing an error if not.\n\nAs with get operations, the location of the resource which\ndescribes the updated values in the request message depends on the\noperation kind. In any case, the effect of the field mask is\nrequired to be honored by the API.\n\n## Considerations for HTTP REST\n\nThe HTTP kind of an update operation which uses a field mask must\nbe set to PATCH instead of PUT in order to satisfy HTTP semantics\n(PUT must only be used for full updates).\n\n# JSON Encoding of Field Masks\n\nIn JSON, a field mask is encoded as a single string where paths are\nseparated by a comma. Fields name in each path are converted\nto/from lower-camel naming conventions.\n\nAs an example, consider the following message declarations:\n\n message Profile {\n User user = 1;\n Photo photo = 2;\n }\n message User {\n string display_name = 1;\n string address = 2;\n }\n\nIn proto a field mask for `Profile` may look as such:\n\n mask {\n paths: \"user.display_name\"\n paths: \"photo\"\n }\n\nIn JSON, the same mask is represented as below:\n\n {\n mask: \"user.displayName,photo\"\n }\n\n# Field Masks and Oneof Fields\n\nField masks treat fields in oneofs just as regular fields. Consider the\nfollowing message:\n\n message SampleMessage {\n oneof test_oneof {\n string name = 4;\n SubMessage sub_message = 9;\n }\n }\n\nThe field mask can be:\n\n mask {\n paths: \"name\"\n }\n\nOr:\n\n mask {\n paths: \"sub_message\"\n }\n\nNote that oneof type names (\"test_oneof\" in this case) cannot be used in\npaths.\n\n## Field Mask Verification\n\nThe implementation of any API method which has a FieldMask type field in the\nrequest should verify the included field paths, and return an\n`INVALID_ARGUMENT` error if any path is duplicated or unmappable.", "title": "`FieldMask` represents a set of symbolic field paths, for example:" }, "runtimeError": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" }, "details": { "type": "array", "items": { "$ref": "#/definitions/protobufAny" } } } }, "subStringMessage": { "type": "object", "properties": { "value": { "type": "string" } } } }, "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", "flow": "accessCode", "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" } } }, "security": [ { "ApiKeyAuth": [], "BasicAuth": [] }, { "ApiKeyAuth": [], "OAuth2": [ "read", "write" ] } ], "externalDocs": { "description": "More about gRPC-Gateway", "url": "https://github.com/grpc-ecosystem/grpc-gateway" }, "x-grpc-gateway-baz-list": [ "one", true ], "x-grpc-gateway-foo": "bar" }