nomisRev / ktor-arrow-example

Real World implementation - "The mother of all demo apps". Written in Kotlin, with Ktor, Arrow, SqlDelight, KotlinX Serialization, etc.
Apache License 2.0
271 stars 34 forks source link

DELETE /articles/{slug}/comments/{id} #166

Open nomisRev opened 1 year ago

nomisRev commented 1 year ago

In order to fully support articles we need to implement a DELETE article comments for slug with comment id, according to following OpenAPI Spec.

  /articles/{slug}/comments/{id}:
    delete:
      tags:
        - Comments
      summary: Delete a comment for an article
      description: Delete a comment for an article. Auth is required
      operationId: DeleteArticleComment
      parameters:
        - name: slug
          in: path
          description: Slug of the article that you want to delete a comment for
          required: true
          schema:
            type: string
        - name: id
          in: path
          description: ID of the comment you want to delete
          required: true
          schema:
            type: integer
      responses:
        '200':
          $ref: '#/components/responses/EmptyOkResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/GenericError'
      security:
        - Token: []
  1. Create articles.kt in routes if does not exist, implement the DELETE route using ArticlePersistence
  2. Add test that verifies the behavior works

Please assign yourself to this ticket before starting, and if you run into any issues please raise a PR so I can provide help and support directly in the code.

Thank you in advance for your interest in the project! Happy hacktoberfest!