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

Setup + reflection issues #12

Open
kiropowered opened this issue Jan 26, 2024 · 2 comments
Open

Setup + reflection issues #12

kiropowered opened this issue Jan 26, 2024 · 2 comments
Assignees

Comments

@kiropowered
Copy link

kiropowered commented Jan 26, 2024

Hello,
Firstable I would like to thank you for the project.
It can potentially help me a lot by automatizing the generation of events schema and providing a clear documentation.
I actually use swagger as well to document my api so the idea of this package is straight forward and clear to implement.

So I tried your bundle following the setup guide, here is some feedbacks:

  • you mention asyncapi_version in config/packages/asyncapi_doc_bundle.yaml but it does not exist in the config, so I had to delete it

  • in the events config, you provide an exemple with a FQCN event, I tried to provide just a namespace but it does not seems to work therefore do we have to list all events in the config file ? Can it scans all the src(App namespace) folder for exemple ?

  • I created an event class with the Message attribute and constructor properties but without attributes.
    it does not seems to use reflection by default to detect type and name leading to error like :
    Property attribute for {variableName} not found when going to the live documentation
    So I tried with the second exemple using Property attribute and it works.
    Did I miss something to enable reflection ?

  • the config parameter servers seems required otherwise it leads to the error : undefined./servers should be object when going to the live documentation.(not mention in the setup)

  • the live documentation styles seems to be broken in dev mode

Maybe all these are just some misconfiguration I made

@Ferror
Copy link
Owner

Ferror commented Jan 27, 2024

Hey! Thank you for the feedback! ❤️ I will comment on each point, and I think we could start working on fixes/improvements.

you mention asyncapi_version in config/packages/asyncapi_doc_bundle.yaml but it does not exist in the config, so I had to delete it

  1. The asyncapi_version parameter is something new I added a couple of days ago because I want also to provide support for the 3.0 version. I think I didn't yet create a release, and that's why you got the issue. 😄

in the events config, you provide an exemple with a FQCN event, I tried to provide just a namespace but it does not seems to work therefore do we have to list all events in the config file ? Can it scans all the src(App namespace) folder for exemple ?

  1. Yeah, the events parameter requires you to provide classes with the namespaces. I understand that it is a problem when you have like 20 or more events. To add this functionality, we would need to add an extra dependency that enables fetching/searching namespaces. Fortunately, there is an interface for ClassFinder. I would be open for contribution 🚀

https://github.com/Ferror/asyncapi-doc-bundle/blob/master/src/ClassFinder/ClassFinderInterface.php

Reflection issue

  1. The reflection strategy should be enabled out of the box if somehow it doesn't work.. would you be so kind as to create a new issue just for this one and attach some example?

servers cannot be empty

  1. That's definitely a bug! 🐛

the live documentation styles seems to be broken in dev mode

  1. For this I would need more information. Would you be able to check out or compare it with this repo example? https://github.com/Ferror/asyncapi-doc-bundle/tree/master/example

@Ferror Ferror self-assigned this Jan 28, 2024
@Ferror
Copy link
Owner

Ferror commented Jan 29, 2024

@kiropowered, check out the latest version of the library. I managed to do some extra work around the documentation strategy and combined reflection and attributes. I also fixed the issue with empty servers.

https://github.com/Ferror/asyncapi-doc-bundle/releases/tag/0.1.0-alpha.6

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

No branches or pull requests

2 participants