jskov / openapi-jaxrs-client

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

Support http response 425 and ref support (timestamp definition) #412

Closed ghost closed 1 year ago

ghost commented 1 year ago

DTO generation fails with dk.mada.jaxrs:openapi-jaxrs-client:0.9.20

Cause of error is the presence of a "http response 425"

Caused by: java.lang.IllegalArgumentException: Unknown HTTP status code: '425'

    at dk.mada.jaxrs.model.api.StatusCode.of(StatusCode.java:136)

If you remove the http 425 it will parse the yaml without errors

`responses: 200: description: Validerer at kro sagen er klar til dannelse af beslutningsgrundlaget content: application/json: schema: $ref: '#/components/schemas/klarTilBeslutningsGrundlagResponse'

    409:
      $ref: '#/components/responses/409'
    425:
      description: >-
        Indikerer at sagen endnu ikke er klar til beslutning.
        Se fejlmeddelse for detaljer.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorMessage'
    400:
      $ref: '#/components/responses/400'
    401:
      $ref: '#/components/responses/401'`

Another issue is parsing timestamp definitions that uses ref

It will be generated as private <UNKNOWN> senestOpdat;

Which wont compile. It should propably have been type String instead of UNKNOWN


  klarTilBeslutningsGrundlagResponse:
      type: object
      required:
        - senestOpdat
      properties:
        senestOpdat:
          $ref: '#/components/schemas/senest-opdat'

  senest-opdat:
      $ref: '#/components/schemas/bdws-timestamp'

  bdws-timestamp:
      type: string
      example: "2022-02-18-09.18.12.788990"
      pattern: '^(\d{4}-\d{2}-\d{2}-\d{2}.\d{2}.\d{2}.\d{6})$'
jskov-jyskebank-dk commented 1 year ago

Example:

{"senestOpdat":"2023-09-19-09.35.42.931048"}
jskov commented 1 year ago

Fixed by #425

jskov commented 1 year ago

@bjjujyske available in version 0.9.22

jskov commented 1 year ago

@bjjujyske The changes in 0.9.22 included a regression, now fixed via #427 Please let me know if you have problems with missing DTOs - if so, I can cut a new release.