openapi: 3.0.3
info:
  title: DummyJSON (login)
  version: 1.0.0
servers:
  - url: https://dummyjson.com
paths:
  /auth/login:
    post:
      operationId: login
      summary: Log in and get a token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [username, password]
              properties:
                username: { type: string, example: emilys }
                password: { type: string, example: emilyspass }
      responses:
        '200':
          description: Logged in
          content:
            application/json:
              schema:
                type: object
                properties:
                  id: { type: integer, example: 1 }
                  username: { type: string, example: emilys }
                  accessToken: { type: string }
        '400':
          description: Invalid credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  message: { type: string, example: Invalid credentials }
