quarkiverse / quarkus-github-app

Develop your GitHub Apps in Java with Quarkus.
https://docs.quarkiverse.io/quarkus-github-app/dev/index.html
Apache License 2.0
62 stars 29 forks source link

OpenApi output from /replay resource is invalid (version 1.17.* only) #537

Closed jskov-jyskebank-dk closed 9 months ago

jskov-jyskebank-dk commented 10 months ago

(or at least it does not look good to me or the swagger editor)

I am running with versions Quarkus 2.16.9 and quarkus-github-app 1.17.1 (I have not tried the 2+ version)

The q/openapi output contains:

  /replay/events:
    get:
      responses:
        "200":
          description: OK
          content:
            text/event-stream:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReplayEvent'
...
components:
  schemas:
...
    ReplayEvent:
      type: object
      properties:
        event:
          type: string
        gitHubEvent:
          $ref: '#/components/schemas/GitHubEvent'
    GitHubEvent:
      type: object
      properties:
        installationId:
          format: int64
          type: integer
        appName:
          type: string
          nullable: true
        deliveryId:
          type: string
        repository:
          type: string
          nullable: true
        event:
          type: string
        action:
          type: string
        payload:
          type: string
        parsedPayload:
          $ref: '#/components/schemas/JsonObject'
        replayed:
          type: boolean
        eventAction:
          type: string
    JsonObject:
      type: array

That last component definition is not good. Swagger editor says:

Semantic error at components.schemas.JsonObject
Schemas with 'type: array', require a sibling 'items: ' field
jskov-jyskebank-dk commented 10 months ago

Having upgraded to Quarkus 3.6.0 and quarkus-github-app:2.1.1 I now get the more appropriate:

    JsonObject:
      type: array
      items:
        type: object
        properties:
          key:
            type: string
          value: {}
gsmet commented 9 months ago

Hey there.

Yeah looks like the issue was fixed in a later version of SmallRye OpenAPI. I recommend to switch to the newest version, it should be easy with quarkus update.

Closing this as I don't think we will be able to push the SmallRye OpenAPI fix to earlier versions, thanks for the report anyway.

Feedback very welcome so don't hesitate to post here (positive feedback also welcome as it's nice to know what works well so that we don't break it!).

gsmet commented 9 months ago

I retired all the references to 1.x in the docs. (Deployment to follow)