openapi: 3.0.0
info:
  title: AuthService
  version: "0.1"

paths:
  /auth:
    post:
      tags: [ "JWT" ]
      summary: Return JWT token
      operationId: auth.generateToken
      requestBody:
        content:
          'application/json':
            schema:
              $ref: '#/components/schemas/User'
      responses:
        '200':
          description: JWT token
          content:
            'text/plain':
              schema:
                type: string
  /secret:
    get:
      tags: [ "JWT" ]
      summary: Return secret string
      operationId: test.getSecret
      responses:
        '200':
          description: secret response
          content:
            'text/plain':
              schema:
                type: string
      security:
      - jwt: ['secret']

components:
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      x-bearerInfoFunc: test.decodeToken
  schemas:
    User:
      description: Application/Login/Password tuple
      type: object
      properties:
        application:
          type: string
        login: 
          type: string
        password: 
          type: string