Skip to content

Instantly share code, notes, and snippets.

@pfisher
Created May 12, 2024 06:17
Show Gist options
  • Save pfisher/114800f92364d8d87562430e81cee692 to your computer and use it in GitHub Desktop.
Save pfisher/114800f92364d8d87562430e81cee692 to your computer and use it in GitHub Desktop.
{
"swagger": "2.0",
"info": {
"title": "blog.proto",
"version": "version not set"
},
"tags": [
{
"name": "BlogService"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/posts": {
"get": {
"operationId": "BlogService_ListPosts",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/blogListPostsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "pageSize",
"description": "The maximum number of items to return. If empty, the default size is used.",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "pageToken",
"description": "The next_page_token value returned from a previous List request, if any.",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"BlogService"
]
},
"post": {
"operationId": "BlogService_CreatePost",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/blogPost"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "post",
"description": "Required. The post resource to create.",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/blogPost"
}
}
],
"tags": [
"BlogService"
]
}
},
"/posts/{name}": {
"get": {
"operationId": "BlogService_GetPost",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/blogPost"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "name",
"description": "Required. The field will contain name of the resource requested.\nIt must follow pattern: \"posts/{post_id}\"",
"in": "path",
"required": true,
"type": "string",
"pattern": "[^/]+"
}
],
"tags": [
"BlogService"
]
},
"delete": {
"operationId": "BlogService_DeletePost",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"type": "object",
"properties": {}
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "name",
"description": "The resource name of the post to be deleted.",
"in": "path",
"required": true,
"type": "string",
"pattern": "[^/]+"
}
],
"tags": [
"BlogService"
]
}
},
"/posts/{post.name}": {
"patch": {
"operationId": "BlogService_UpdatePost",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/blogPost"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "post.name",
"description": "Required. It must have less than 255 characters.",
"in": "path",
"required": true,
"type": "string",
"pattern": "[^/]+"
},
{
"name": "post",
"description": "The post resource with updated fields.",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "Required."
},
"contents": {
"type": "string"
},
"createTime": {
"type": "string",
"description": "Output only. Time when post was added to the blog, ISO 8601 format.",
"readOnly": true
}
},
"title": "The post resource with updated fields."
}
}
],
"tags": [
"BlogService"
]
}
}
},
"definitions": {
"blogListPostsResponse": {
"type": "object",
"properties": {
"posts": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/blogPost"
}
},
"nextPageToken": {
"type": "string",
"description": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list."
}
}
},
"blogPost": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Required. It must have less than 255 characters."
},
"title": {
"type": "string",
"description": "Required."
},
"contents": {
"type": "string"
},
"createTime": {
"type": "string",
"description": "Output only. Time when post was added to the blog, ISO 8601 format.",
"readOnly": true
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment