Skip to content

Instantly share code, notes, and snippets.

@mikepietruszka
Created May 5, 2022 15:32
Show Gist options
  • Save mikepietruszka/50e5b7269edf26c08a55c7febc05713a to your computer and use it in GitHub Desktop.
Save mikepietruszka/50e5b7269edf26c08a55c7febc05713a to your computer and use it in GitHub Desktop.
OpenAPI2 example
# openapi2-functions.yaml
# This API once created will be found in APIs & Services console
swagger: '2.0'
info:
title: api-name description-goes-here
description: description-goes-here
version: 1.0.0
schemes:
- https
produces:
- application/json
paths:
/some_function:
get:
summary: Greet a user
operationId: hello
x-google-backend:
address: https://$region-$project_id.cloudfunctions.net/function_name
responses:
'200':
description: A successful response
schema:
type: string
security:
- api_key: []
securityDefinitions:
api_key:
type: "apiKey"
name: "key"
in: "query"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment