You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
736 lines
18 KiB
736 lines
18 KiB
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "examples/examplepb/a_bit_of_everything.proto",
|
|
"version": "version not set"
|
|
},
|
|
"schemes": [
|
|
"http",
|
|
"https"
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"paths": {
|
|
"/v1/example/a_bit_of_everything": {
|
|
"post": {
|
|
"operationId": "CreateBody",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/examplepbABitOfEverything"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/examplepbABitOfEverything"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
}
|
|
},
|
|
"/v1/example/a_bit_of_everything/echo/{value}": {
|
|
"get": {
|
|
"operationId": "Echo",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/subStringMessage"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "value",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
}
|
|
},
|
|
"/v1/example/a_bit_of_everything/query/{uuid}": {
|
|
"get": {
|
|
"operationId": "GetQuery",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/protobufEmpty"
|
|
}
|
|
}
|
|
},
|
|
"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": " - FALSE: FALSE is false.\n - TRUE: TRUE is true.",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"enum": [
|
|
"FALSE",
|
|
"TRUE"
|
|
],
|
|
"default": "FALSE"
|
|
},
|
|
{
|
|
"name": "float_value",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "number",
|
|
"format": "float"
|
|
},
|
|
{
|
|
"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": "uint32_value",
|
|
"description": "TODO(yugui) add bytes_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": "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"
|
|
}
|
|
},
|
|
{
|
|
"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"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
}
|
|
},
|
|
"/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}": {
|
|
"post": {
|
|
"operationId": "Create",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/examplepbABitOfEverything"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "float_value",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "number",
|
|
"format": "float"
|
|
},
|
|
{
|
|
"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"
|
|
}
|
|
],
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
}
|
|
},
|
|
"/v1/example/a_bit_of_everything/{single_nested.name}": {
|
|
"post": {
|
|
"operationId": "DeepPathEcho",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/examplepbABitOfEverything"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "single_nested.name",
|
|
"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": "Lookup",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/examplepbABitOfEverything"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "uuid",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
},
|
|
"delete": {
|
|
"operationId": "Delete",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/protobufEmpty"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "uuid",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
},
|
|
"put": {
|
|
"operationId": "Update",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/protobufEmpty"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "uuid",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/examplepbABitOfEverything"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
}
|
|
},
|
|
"/v2/example/echo": {
|
|
"get": {
|
|
"operationId": "Echo",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/subStringMessage"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "value",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
},
|
|
"post": {
|
|
"operationId": "Echo",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/subStringMessage"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
}
|
|
},
|
|
"/v2/example/timeout": {
|
|
"get": {
|
|
"operationId": "Timeout",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/protobufEmpty"
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"ABitOfEverythingService"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"ABitOfEverythingNested": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "name is nested field."
|
|
},
|
|
"amount": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"ok": {
|
|
"$ref": "#/definitions/NestedDeepEnum"
|
|
}
|
|
},
|
|
"description": "Nested is nested type."
|
|
},
|
|
"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",
|
|
"properties": {
|
|
"single_nested": {
|
|
"$ref": "#/definitions/ABitOfEverythingNested"
|
|
},
|
|
"uuid": {
|
|
"type": "string"
|
|
},
|
|
"nested": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/ABitOfEverythingNested"
|
|
}
|
|
},
|
|
"float_value": {
|
|
"type": "number",
|
|
"format": "float"
|
|
},
|
|
"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"
|
|
},
|
|
"uint32_value": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"title": "TODO(yugui) add bytes_value"
|
|
},
|
|
"enum_value": {
|
|
"$ref": "#/definitions/examplepbNumericEnum"
|
|
},
|
|
"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": {
|
|
"$ref": "#/definitions/protobufEmpty"
|
|
},
|
|
"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"
|
|
}
|
|
},
|
|
"title": "Intentionaly complicated message type to cover much features of Protobuf.\nNEXT ID: 27"
|
|
},
|
|
"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"
|
|
},
|
|
"protobufEmpty": {
|
|
"type": "object",
|
|
"description": "service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.",
|
|
"title": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:"
|
|
},
|
|
"subStringMessage": {
|
|
"type": "object",
|
|
"properties": {
|
|
"value": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|