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

GET /articles/{slug} #161

Closed nomisRev closed 1 year ago

nomisRev commented 1 year ago

In order to fully support tags we need to implement a GET article by slug, according to following OpenAPI Spec.

  /articles/{slug}:
    get:
      tags:
        - Articles
      summary: Get an article
      description: Get an article. Auth not required
      operationId: GetArticle
      parameters:
        - name: slug
          in: path
          description: Slug of the article to get
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/SingleArticleResponse'
        '422':
          $ref: '#/components/responses/GenericError'
  1. Add missing domain object SingleArticleResponse if it doesn't exist.
  2. Create articles.kt in routes if does not exist, and implement the route using getArticleBySlug using ArticlePersistence.
  3. 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!

javimartinez commented 1 year ago

Hi @nomisRev, I want to learn Kotlin, Can I work on this ?

nomisRev commented 1 year ago

Hey @javimartinez, Of course! If you have any questions, or doubts please raise a PR and we can discuss there ☺️

Thank you for the interest in the project, and have fun with learning Kotlin! Happy hacktoberfest 👻