OpenAPITools / OpenAPITools/openapi-generator

[BUG] scala-cask generates reference to UUIDData class but does not generate it

Open
#20,215 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

I realise that UUIDs are not properly supported by scala-cask yet, but it should generate invalid code.

In a routes file in which there is a reference there is the following for comprehension:-

    val result = for {
      uUID <- Parsed
        .fromTry(UUIDData.manyFromJsonStringValidated(request.bodyAsString))
        .mapError(e =>
          s"Error parsing json as an array of UUID from >${request.bodyAsString}< : ${e}"
        ) /* array */
      resultTry <- Parsed.eval(service.v1TimesheetsToggleDeferredPost(uUID))
      result    <- Parsed.fromTry(resultTry)
    } yield result

and UUIDData is flagged as not found. manyFromJsonStringValidated seems to be the only method on this class that is called.

It would be really helpful BTW if UUID support was added for type: "string" format: "uuid" objects. Where in the code am I likely to find the right place to intercept this and add support either by adding an import of a given implicit Conversion or explicitly converting the String value to a UUID using UUID.fromString on each use?

openapi-generator version

7.10.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the scala-cask generator output shown in the issue and trace the handling of an OpenAPI string with format uuid, focusing on the generated UUIDData.manyFromJsonStringValidated call. Done means the generated routes no longer reference an undefined UUIDData class for this case; determine separately whether broader UUID support is in scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, scala
Domain
backend-api-design, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.