Skip to content

[Scala] Add enums to scala-http4s-server #21320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KatyaValik
Copy link

@KatyaValik KatyaValik commented May 23, 2025

There is an example of correct openAPI specification:

info:
  title: TestApi
  version: latest

components:
  schemas:
    EnumType:
      type: string
      enum:
        - Fix
        - Max
paths:
  /test/method:
    post:
      responses:
        '200':
          description: "success answer"
          content:
            application/json:
              schema:
                type: object
                required:
                  - constraint
                properties:
                  constraint:
                    $ref: '#/components/schemas/EnumType'

For given OpenAPI specification generated not valid type for enum EnumType - empty case class:

case class EnumType()

I added enum handling for scala-http4s-server.
Trying to fix #9987 for scala-http4s-server.

@KatyaValik KatyaValik marked this pull request as draft May 23, 2025 13:45
@KatyaValik KatyaValik force-pushed the scala-http4s-server-enums-fix branch from 47c1ab8 to 1cb9c2f Compare May 26, 2025 06:59
@KatyaValik KatyaValik marked this pull request as ready for review May 26, 2025 07:01
@KatyaValik KatyaValik changed the title [Scala] Add enums to scala-htt4s-server [Scala] Add enums to scala-http4s-server May 26, 2025
@KatyaValik KatyaValik force-pushed the scala-http4s-server-enums-fix branch from 1cb9c2f to 3e46ec6 Compare May 27, 2025 13:04
@wing328
Copy link
Member

wing328 commented May 27, 2025

thanks for the PR

cc
@clasnake (2017/07), @shijinkui (2018/01), @ramzimaalej (2018/03), @chameleon82 (2020/03), @Bouillie (2020/04) @Fish86 (2023/06)

@wing328
Copy link
Member

wing328 commented May 27, 2025

https://github.com/OpenAPITools/openapi-generator/actions/runs/15276044149/job/42973797933?pr=21320

please follow step 3 to update the samples so that the CI can verify the change

@KatyaValik KatyaValik force-pushed the scala-http4s-server-enums-fix branch from 3e46ec6 to 393f94d Compare May 28, 2025 12:11
@KatyaValik KatyaValik force-pushed the scala-http4s-server-enums-fix branch from 393f94d to de1c5c3 Compare May 28, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG][SCALA-AKKA] Fix scala-akka enum generation
2 participants