Skip to content
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

[BUG] Missing import in generated DTO #19324

Open
alapierre opened this issue Aug 8, 2024 · 1 comment
Open

[BUG] Missing import in generated DTO #19324

alapierre opened this issue Aug 8, 2024 · 1 comment

Comments

@alapierre
Copy link

alapierre commented Aug 8, 2024

Bug Report Checklist

there is missing java.util.function.Function import for:

public final static Map<String, ProfileEnum> VALUE_MAPPING = Map.copyOf(Arrays.stream(values())
                .collect(Collectors.toMap(v -> v.value, Function.identity())));

it happened in CustomerCreateDTO when I use allOf in that way:

    CustomerCreateDTO:
      type: object
      required:
        - profile
        - nip
      allOf:
        - $ref: '#/components/schemas/CustomerUpdateDTO'
        - type: object
      properties:
        profile:
          type: string
          enum:
            - individual
            - corporate
        nip:
          type: string
          maxLength: 128
          minLength: 8
    CustomerUpdateDTO:
      type: object
      required:
        - street
        - buildingNumber
        - postalCode
        - city
        - email
        - parking
        - licensePlate
      properties:
        firstName:
          type: string
          maxLength: 128
        lastName:
          type: string
          maxLength: 128
        companyName:
          type: string
          maxLength: 256
        street:
          type: string
          maxLength: 512
        buildingNumber:
          type: string
          maxLength: 64
        apartmentNumber:
          type: string
          maxLength: 32
        postalCode:
          type: string
          maxLength: 16
        city:
          type: string
          maxLength: 256
        email:
          type: string
          maxLength: 256
          format: email
        licensePlate:
          type: string
          maxLength: 64
        notes:
          type: string
          maxLength: 512

but similar structure, without enum works with no problem:

    CustomerDTO:
      allOf:
        - $ref: '#/components/schemas/CustomerCreateDTO'
        - type: object
          required:
            - id
            - version
          properties:
            id:
              type: string
              format: uuid
            version:
              type: integer
            cyclicalInvoicing:
              type: boolean
            individual:
              type: boolean
@altro3
Copy link

altro3 commented Aug 25, 2024

@alapierre I think, this bug in this project: https://github.com/micronaut-projects/micronaut-openapi

I fixed it here: micronaut-projects/micronaut-openapi#1731

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants