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

Composed type regression AsyncAPI 2.6.0 since v0.35.1 #185

Closed
stefan-scheidewig opened this issue Apr 5, 2024 · 5 comments · Fixed by #194
Closed

Composed type regression AsyncAPI 2.6.0 since v0.35.1 #185

stefan-scheidewig opened this issue Apr 5, 2024 · 5 comments · Fixed by #194
Assignees
Labels
bug Something isn't working

Comments

@stefan-scheidewig
Copy link

Bonjour Monsieur Fradin,

first of all thanks for that asyncapi library. It is very valuable for us 🙏

I wanted to point out, that there might be a regression in the generator since pr #168 and therefore since version v0.35.1 of the lib.

Context: we have asyncapi 2.6.0 event types based from different subtypes combined via the allOf attribute:

components:
  schemas:
    BaseEvent:
      type: object
      properties:
        time:
          type: string
          format: dateTime
      required:
        - time
    BaseEventInfo:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ContentData'
      required:
        - data
    ContentData:
      type: object
      properties:
        contentId:
          type: string
      required:
        - contentId
    EventPayload:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - $ref: '#/components/schemas/BaseEventInfo'
        - type: object
          properties:
            id:
              type: string
          required:
            - id

the generated type for EventPayload contained the attributes data and time in version v0.35.0 but in version v.0.35.1 these are missing but the base types are still generated. i assume it should not behave like that, right?

@lerenn
Copy link
Owner

lerenn commented Apr 7, 2024

Hallo Herr Scheidewig !

Thanks for your interest in this project, happy that it can help other developers ☺️

Sorry about that, I'll correct that !

In fact, that's why I have introduced the test/<version>/issuers<nb>, so I'll avoid reproducing the same mistakes.
I'll make a test from the yaml you provided, fix it and then it should not happen again.

I'll let you know when the fix is merged :)

@lerenn lerenn added the bug Something isn't working label Apr 7, 2024
@lerenn lerenn self-assigned this Apr 7, 2024
@stefan-scheidewig
Copy link
Author

you don't have to apologize. i have to apologize that i didn't make a valid pr you can work with but instead mentioning that issue only. there is simply not enough time on my side to do it like that. but who am i telling that, right? ;)

@stefan-scheidewig
Copy link
Author

stefan-scheidewig commented Apr 9, 2024

it is fixed in version v0.35.7. thank you very much 🙏

@stefan-scheidewig
Copy link
Author

I'm sorry for that noise. I was too fast here. Unfortunately the issue still exists.

@lerenn lerenn linked a pull request Apr 12, 2024 that will close this issue
@stefan-scheidewig
Copy link
Author

thank you, mr fradin. it is fixed in v0.36.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants