-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Multiple asyncapi yaml files #108
Comments
Hi @alex-zywicki, This is not something that Asynction (or Flask-SocketIO) supports atm. Before going down the path of contemplating the addition of such a feature, I'd like to understand whether this multi-API setup would make sense in the Socket.IO world. In Connexion, each API is registered (via the add_api method) under a separate base path. However, this cannot be the case for Socket.IO, as by design, a Socket.IO server only supports a single path. As far as I can see, the only way to split a Socket.IO server into multiple API's is through namespaces. We could possibly have a multi spec setup, where each AsyncAPI file documents a unique subset of the namespaces of the server. IMHO, each AsyncAPI file should not depend on the rest, and should be sufficient to define a functional Socket.IO API, without needing to register any further spec. I would really like to avoid having incomplete specifications, and having to merge all specs into a mega spec. To re-iterate, for the multi-API feature:
What do you think? Would the above proposal fit your product requirements? If yes, happy to think/talk about design and implementation. |
Hi @dedoussis, I have questions in regards to item 4. From what I can gather in the current implementation, the server object in the spec is only used if you specify the I agree completely with items, 1 and 3, but wonder if item 2 is strictly necessary in that a separate API file could be used to extend a namespace with new (non conflicting) messages. Since the message handler bindings are provided on a per message level I don't see how that would conflict. (But this is not a requirement on my end, only a theoretical use case) Are you thinking that each yaml file would be loaded as a separate I'm, also wondering if allowing the |
This is correct, this problem arises only when the
How are we going to handle the namespace handlers though, such as
Correct. Each YAML file should hold a valid and complete AsyncAPI specification, that can be deserialised into an
This will lead to incomplete spec files. I feel that we should stick to the principle of each API being complete and able to spin up a stand alone Socket.IO server by itself (point 3). Also, AFAIK connexion does not support such a feature. However, I do believe that Asynction should support modularity, but probably would be better to do it via Jinja2 rendering: https://github.com/zalando/connexion#dynamic-rendering-of-your-specification. See this comment from the relevant Connexion issue |
@dedoussis Since the issue with the servers only arises when the With the additional factors regarding namespaces, I think your original point of having each file document a separate namespace makes sense. As for the YAML file rendering/linkage, I think that for the sake of stating on topic on this issue that I will drop that topic for now and open another issue later if I need the feature. All of that said, I believe that means your original summary stands. Is this something you would be able to add? Or would you prefer a PR be provided? |
@alex-zywicki Unfortunately, I won't be able to pick this up until late November. If that's bit late for you, a PR would be more than welcome! |
Hi,
Connexion offers the ability to mount multiple API yaml files onto a single server. Is this a capability that asynction has or that could be added in the future? I would like to use asynction for a product I am starting on that also uses connexion, and the ability to modularize features into plugins with separate yaml files is a must for me.
Is this something you would be willing to add or willing to merge if someone were to develop it?
The text was updated successfully, but these errors were encountered: