# openapi2-appengine.yaml
swagger: '2.0'
info:
  title: hello test-api to get hello
  description: Sample API on API Gateway with an App Engine backend
  version: 1.0.0
schemes:
  - https
consumes:
  - application/json
  - application/xml
produces:
  - application/json
  - application/xml
paths:
  /hello:
    get:
      summary: Greet a user
      operationId: hello
      x-google-backend:
        address: https://sumanthtest-336820.wl.r.appspot.com/
        jwt_audience: 567973065341-4k5ump3057b87cgsij5f51hqo0qef3se.apps.googleusercontent.com
      responses:
        '200':
          description: A successful response
          schema:
            type: string
      security:
        - api_key: []
  /name:
    post:
      tags:
        - name
      summary: Post the name of the user
      operationId: addName
      x-google-backend:
        address: https://sumanthtest-336820.wl.r.appspot.com/name
        jwt_audience: 567973065341-4k5ump3057b87cgsij5f51hqo0qef3se.apps.googleusercontent.com
      parameters:
        - in: body
          name: body
          description: Name that needs to be added
          required: true
          schema:
            $ref: '#/definitions/Request'
      responses:
        '200':
          description: A successful response
          schema:
            type: string

definitions:
  Request:
    type: object
    required:
      - name
    properties:
      name:
        type: string
        example: Sumanth
    xml:
      name: Request

securityDefinitions:
  api_key:
    type: "apiKey"
    name: "key"
    in: "query"
  bearer:
    authorizationUrl: ""
    flow: "implicit"
    type: "oauth2"
    x-google-issuer: "sumanthtest-336820@appspot.gserviceaccount.com"
    x-google-jwks_uri: "https://www.googleapis.com/robot/v1/metadata/x509/sumanthtest-336820@appspot.gserviceaccount.com"
    x-google-jwt-locations:
      - header: "Authorization"
        value_prefix: "Bearer "
