2016-12-06 54 views

回答

0

您需要添加這個配置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/[email protected]" 
1

我發現這個問題尋找同樣的事情。我正在使用雲端點v2和GAE。我的後端是在Python中。

對於我來說,在六月2017年,它是在[yournameandversion]openapi.json,不是yaml文件,但是當你按照this tutorial

+0

評論刪除它會自動包含在內。感謝您指出。 – nop77svk