【问题标题】:How to Edit Extensible Service Proxy configuration file如何编辑可扩展服务代理配置文件
【发布时间】:2017-04-21 07:26:59
【问题描述】:
【问题讨论】:
标签:
java
google-app-engine
oauth-2.0
【解决方案1】:
我发现这个问题正在寻找同样的东西。我正在使用云端点 v2 和 GAE。我的后端是python。
对我来说,在 2017 年 6 月,它位于 [yournameandversion]openapi.json,而不是 yaml 文件中,但当您关注 this tutorial 时,它会自动包含在其中
【解决方案2】:
您需要将此配置添加到openapi.yaml(以前的swagger.yaml):
swagger: '2.0'
info:
version: 1.0.0
title: "My Endpoints"
host: my-backend-api.YOUR-PROJECT-ID.appspot.com
basePath: "/_ah/api"
schemes:
- "https"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/testAPI/v1/echo:
get:
operationId: TestAPIEcho
responses:
200:
description: A successful response
schema:
$ref: "#/definitions/echoMessage"
parameters:
- name: message
in: query
required: true
type: string
x-security:
- firebase
definitions:
echoMessage:
properties:
message:
type: "string"
security:
- api_key: []
securityDefinitions:
firebase:
flow: "implicit"
type: "oauth2"
# Replace YOUR-PROJECT-ID with your project ID
x-issuer: "https://securetoken.google.com/YOUR-PROJECT-ID"
x-jwks_uri: "https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com"