---
openapi: "3.1.0"
info:
  title: "Pet Store API"
  version: "1.0.0"
  x-kuadrant:
    route:
      name: "toystore"
      namespace: $devNS
      hostnames:
        - toystore.$rootDomain
      parentRefs:
        - name: $gatewayName
          namespace: $gatewayNS
servers:
  - url: https://toystore.$rootDomain/v1
paths:
  /toys:
    get:  # No sec requirements
      operationId: "getToy"
      responses:
        405:
          description: "invalid input"
    post:  # API key
      operationId: "postToy"
      security:
        - api_key: []
      responses:
        405:
          description: "invalid input"
    x-kuadrant:
      backendRefs:
      - name: toystore
        namespace: $devNS
        port: 80 
      rate_limit:
        rates:
          - limit: 1
            duration: 10
            unit: second
        counters:
          - request.headers.api_key
components:
  securitySchemes:
    api_key:
      type: apiKey
      name: api_key
      in: header
