-
Notifications
You must be signed in to change notification settings - Fork 19
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
Provide public API for introspecting the MqttRouteTable #7
Comments
I did some research and it looks like the way to accomplish this in AspNet Core is via ActionDescriptors. See: https://stackoverflow.com/questions/41908957/get-all-registered-routes-in-asp-net-core I'm leaning towards creating a readonly collection similar to ActionDescriptionCollectionProvider. I'll try a few things over the next week to see what makes the most sense. Probably goes without saying, but I would not recommend the reflection route because there is no guarantee that will work into the future (though I have no plans to rewrite the internals on the roadmap right now). |
Thanks @avishnyak ! We will not proceed with the reflection-based approach - this was just a proof of concept to see if we had enough information provided by MQTTnet.AspNetCore.AttributeRouting :) |
Hi again @avishnyak Thanks |
Absolutely. My only request would be to ensure that you don't expose the internal routetable implementation. Rather, I would propose that we create a ReadOnly collection with a customer-friendly API. When thinking about your usecase, my concern was you are asking for me to expose the pointer to the actual action as well as the metadata. In the customer-friendly API, I would propose that we only surface a property which will use reflection to return a MethodImpl and let the consumer take it from there rather than exposing our internal plumbing. |
Hello everyone,
I am the maintainer of Saunter (https://github.com/tehmantra/saunter) - an AsyncAPI documentation generator (https://www.asyncapi.com/).
Saunter works similarly to MQTTnet.AspNetCore.AttributeRouting, the user adds attributes to their code which describe the publishing or subscribing behavior which the code will implement.
I'd like to be able to provide an integration between Saunter and MQTTnet.AspNetCore.AttributeRouting so that we can re-use the attributes provided by MQTTnet.AspNetCore.AttributeRouting to produce the AsyncAPI document. This will allow the user to simply add Saunter to their project and have documentation produced without having to duplicate attributes like
[MqttController]
and[MqttRoute]
.To do this I need
public
access to theMqttRouteTable
(or some public interface on top of the implementation).I've currently implemented a proof-of-concept of this feature using reflection and, while ugly, it works.
Please see this issue for details: asyncapi/saunter#101 (comment)
Is this something you would consider adding to the project?
/cc @Rikj000
The text was updated successfully, but these errors were encountered: