Skip to content

Instantly share code, notes, and snippets.

@your-diary
Last active April 17, 2023 11:33
Show Gist options
  • Save your-diary/ef55aa12122accb8d554af8590b0f099 to your computer and use it in GitHub Desktop.
Save your-diary/ef55aa12122accb8d554af8590b0f099 to your computer and use it in GitHub Desktop.
openapi: 3.0.3
info:
title: "uploadCloudStorage"
description: "creates and uploads a text file to Cloud Storage"
version: "1.0"
paths:
/:
post:
summary: "creates and uploads a text file to Cloud Storage"
description: ""
x-google-backend:
address: "hello"
requestBody:
content:
application/json:
schema:
type: object
required:
- content
properties:
content:
type: string
description: "the content of a text file uploaded to Cloud Storage"
example: "Hello, world!"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"500":
description: Internal Server Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
components:
schemas:
SuccessResponse:
type: object
properties:
status:
type: string
example: "success"
content:
type: string
description: a signed URL (i.e. public, read-only, with expiration date) to access the uploaded text file
example: "https://..."
ErrorResponse:
type: object
properties:
status:
type: string
example: "error"
content:
type: string
example: "<reason>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment