openapi: 3.0.2
paths:

  /app/{module-name}:
    post:
      summary: Create a new {module name}
      tags:
        - {Module Name}

      security:
        - bearerAuth: []

      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Create{ModuleName}'

      responses:
        201:
          description: {Module Name} created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: {Module Name} created successfully
                  {moduleName}:
                    $ref: '#/components/schemas/{ModuleName}Response'

        400:
          $ref: '#/components/responses/BadRequest'

        401:
          $ref: '#/components/responses/Unauthorized'

        500:
          $ref: '#/components/responses/InternalServerError'

    get:
      summary: Retrieve a list of all {module name}s
      tags:
        - {Module Name}

      responses:
        200:
          description: A list of {module name}s
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/{ModuleName}Response'

        500:
          $ref: '#/components/responses/InternalServerError'

  /app/{module-name}/{id}:
    get:
      summary: Retrieve a {module name} by ID
      tags:
        - {Module Name}

      parameters:
        - $ref: '#/components/parameters/IdParameter'

      responses:
        200:
          description: A single {module name} object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/{ModuleName}Response'

        400:
          $ref: '#/components/responses/BadRequest'

        404:
          $ref: '#/components/responses/NotFoundError'

        500:
          $ref: '#/components/responses/InternalServerError'

    put:
      summary: Update a {module name}'s information by ID
      tags:
        - {Module Name}

      security:
        - bearerAuth: []

      parameters:
        - $ref: '#/components/parameters/IdParameter'

      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Update{ModuleName}'

      responses:
        200:
          description: {Module Name} updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: {Module Name} updated successfully
                  {moduleName}:
                    $ref: '#/components/schemas/{ModuleName}Response'

        400:
          $ref: '#/components/responses/BadRequest'

        401:
          $ref: '#/components/responses/Unauthorized'

        404:
          $ref: '#/components/responses/NotFoundError'

        500:
          $ref: '#/components/responses/InternalServerError'

    delete:
      summary: Delete a {module name} by ID
      tags:
        - {Module Name}

      security:
        - bearerAuth: []

      parameters:
        - $ref: '#/components/parameters/IdParameter'

      responses:
        200:
          description: {Module Name} deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: {Module Name} deleted successfully
                  {moduleName}:
                    $ref: '#/components/schemas/{ModuleName}Response'

        400:
          $ref: '#/components/responses/BadRequest'

        401:
          $ref: '#/components/responses/Unauthorized'

        404:
          $ref: '#/components/responses/NotFoundError'

        500:
          $ref: '#/components/responses/InternalServerError'
