swagger: "2.0"
info:
    version: 1.0.1
    title: "{{ packageJson('name') }}"
    description: A sample API
    contact:
        name: Swagger API Team
        email: 'john@boats.io'
        url: https://github.com/johndcarmichael/boats/
    license:
        name: Apache 2.0
        url: https://www.apache.org/licenses/LICENSE-2.0.html

schemes:
    - https
    - http
host: api.example.com

securityDefinitions:
  jwtToken:
      type: apiKey
      in: header
      name: authorization
  apiKey:
      type: apiKey
      in: header
      name: x-api-key

paths:
    $ref: paths/index.yml
parameters:
    $ref: parameters/index.yml
definitions:
    $ref: definitions/index.yml

{{
  inject([{
    toAllOperations: {
      excludePaths: ['/health'],
      content: {
        security: [{
          jwtToken: []
        }]
      }
    }
  }, {
    toAllOperations: {
      content: {
        tags: [ '{{ autoTag() }}' ],
        summary: '{{ autoSummary() }}',
        operationId: '{{ uniqueOpId() }}',
        responses: {
          '200': {
            description: 'OK'
          }
        }
      }
    }
  }])
}}
