jskov / openapi-jaxrs-client

An OpenAPI JAX-RS client code generator
Apache License 2.0
1 stars 4 forks source link

Special UUID-type handling broken in some cases #553

Closed jskov-jyskebank-dk closed 7 months ago

jskov-jyskebank-dk commented 7 months ago

In the below API, the RoomId is handled as a DTO whereas UUID is handled as the java UUID type.

The parser logic handling this takes its cue from OpenApi schema type (UUIDSchema) not the type name. So it is unclear if this is a OpenApi problem, or mada parser jumping the gun somewhere else.

Check if it is because the pattern is missing (could trigger magic in OpenAPI).

  /api/uuid/query:
    get:
      tags:
      - Resource Dtos
      parameters:
        - in: query
          name: roomId
          schema:
            $ref: '#/components/schemas/RoomId'
...
    UUID:
      format: uuid
      pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"
      type: string
    RoomId:
      description: UUID of the room.
      example: e017e2ea-ff98-4516-9a56-bbd02e1f161a
      format: uuid
      type: string

(MM)

jskov-jyskebank-dk commented 7 months ago

Not due to extra properties

jskov-jyskebank-dk commented 7 months ago

Only properties remapped. Adding handling for DTOs

jskov-jyskebank-dk commented 7 months ago

Fixed by #554