openapi: 3.1.0
info:
  title: Go Server Template
  version: 1.0.0
  description: The Example API specs for my go server template.
paths:
  /user:
    get:
      tags:
      - users
      summary: Get user
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
          description: The request was successful, and the server has returned the requested resource in the response body.
        '400':
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      required:
                      - message
                      properties:
                        message:
                          type: string
                  message:
                    type: string
          description: 400 Bad Request
        '404':
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  message:
                    type: string
          description: 404 not found
      parameters:
      - in: query
        name: user_id
        style: form
        schema:
          type: string
        explode: true
        required: true
        description: ''
        allowReserved: false
      operationId: getUser
    post:
      tags:
      - users
      summary: Create user
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
          description: The request was successful, and a new resource was created.
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerErrror'
      operationId: createUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreate'
        required: true
        description: ''
components:
  schemas:
    User:
      type: object
      required:
      - last_name
      - first_name
      - user_id
      - email
      properties:
        email:
          type: string
        user_id:
          type: string
        last_name:
          type: string
        first_name:
          type: string
      description: ''
    UserCreate:
      type: object
      required:
      - last_name
      - first_name
      - email
      properties:
        email:
          type: string
        last_name:
          type: string
        first_name:
          type: string
      description: Data transfer object for creating a new User.
      x-fiddle-dto-info:
        baseSchemaName: User
  responses:
    Conflict:
      content:
        application/json:
          schema:
            type: object
            required:
            - message
            properties:
              message:
                type: string
      description: The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again.
    BadRequest:
      content:
        application/json:
          schema:
            type: object
            required:
            - message
            properties:
              errors:
                type: array
                items:
                  type: object
                  required:
                  - message
                  properties:
                    message:
                      type: string
              message:
                type: string
      description: The server could not understand the request due to invalid syntax. The client should modify the request and try again.
    InternalServerErrror:
      content:
        application/json:
          schema:
            type: object
            required:
            - message
            properties:
              message:
                type: string
      description: The server encountered an unexpected condition that prevented it from fulfilling the request. Report the issue to the support team if it persists.
  securitySchemes: {}
tags:
- name: users
