swagger: "2.0"
info:
  version: "0.1"
  title: Hello World App
# during dev, should point to your local machine
host: localhost
# basePath prefixes all resource paths 
basePath: /v1
# 
schemes:
  - https
# format of bodies a client can send (Content-Type)
consumes:
  - application/json
# format of the responses to the client (Accepts)
produces:
  - application/json
#duke security definitions
securityDefinitions:
  api_key: 
    description: Duke's required api_key
    type: apiKey
    name: api_key
    in: header
  duke_auth:
    type: oauth2
    description: Duke's optional oauth
    authorizationUrl: https://oauth.duke.edu/oauth/authorize.php
    flow: implicit
    scopes: 
      myApi:example:read: example api scope (naming schemes for scopes should be APINAME:OBJECT:READ/WRITE
      identity:netid:read: A real example.
#required no matter what
security: 
  - api_key: []
#rate limiting for the api. You can limit by total access, and by user (IP) and app. Here, total accesses have been limited, as have each app's. Users are not individually limited, but are still limited by the total
x-rate-limit:
  total:
    perSec: 2
    perMin: 20
    perHour: 800
    perDay: 5000
  perApp:
    perSec: 1
    perMin: 10
    perHour: 600
    perDay: 4000
  perUser: null
paths:
  /hello:
    # binds a127 app logic to a route
    x-swagger-router-controller: example_controller
    get:
      description: Returns 'Hello' to the caller
      # used as the method name of the controller
      parameters:
        - name: name
          in: query
          description: The name of the person to whom to say hello
          required: false
          type: string
      responses:
        "200":
          description: Success
          schema:
            # a pointer to a definition
            $ref: "#/definitions/HelloWorldResponse"
        # responses may fall through to errors
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
# complex objects have schema definitions
definitions:
  HelloWorldResponse:
    required:
      - message
    properties:
      message:
        type: string
  ErrorResponse:
    required:
      - message
    properties:
      message:
        type: string
