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

Expose ApiDescriptionProvider types and methods (so other projects can use it) #39459

Open
jkone27 opened this issue Jan 12, 2022 · 6 comments
Open
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi Needs: Design This issue requires design work before implementating. Priority:1 Work that is critical for the release, but we could probably ship without
Milestone

Comments

@jkone27
Copy link

jkone27 commented Jan 12, 2022

Endpoint Metadata Parsing methods are not accessible

Many third parties might be interested in retrieving metadata from endpoints for e.g. openapi spec generation

https://github.dev/dotnet/aspnetcore/blob/94ffe0356177368d73f98021da53456fc658fcd4/src/Mvc/Mvc.ApiExplorer/src/EndpointMetadataApiDescriptionProvider.cs#L28

Describe the solution you'd like

It would be appreciated if metadata from endpoint could be easilly navigated and extracted (e.g. Expression of invoked lambda/delegate, main properties of lambda/delegate, return type, parameters type, HTTP method name, etc....)

that way endpoints could be inspected at runtime just checking

IEnumerable<EndpointDataSource>

but right now it's hard and very tough to do especially for NON MVC projects (even requires quite elaborated reflection to access endpoint info...)

Additional context

pimbrouwers/Falco#49
giraffe-fsharp/Giraffe#488 (comment)
giraffe-fsharp/Giraffe#428
giraffe-fsharp/Giraffe#488
SaturnFramework/Saturn#30

@javiercn javiercn added the area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Jan 12, 2022
@rafikiassumani-msft rafikiassumani-msft added this to the .NET 7 Planning milestone Jan 13, 2022
@ghost
Copy link

ghost commented Jan 13, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@rafikiassumani-msft rafikiassumani-msft added Priority:1 Work that is critical for the release, but we could probably ship without Cost:M labels Jan 13, 2022
@rafikiassumani-msft
Copy link
Contributor

Similar issue: #33644

@rafikiassumani-msft rafikiassumani-msft added Needs: Design This issue requires design work before implementating. Cost:XL and removed Cost:M labels Jan 13, 2022
@ghost
Copy link

ghost commented Jun 14, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@captainsafia captainsafia added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates and removed area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Jun 20, 2023
@jkone27
Copy link
Author

jkone27 commented Oct 11, 2024

Any updates on this for 2024 NET9 release? cc @captainsafia , thanks for tracking this

@captainsafia
Copy link
Member

@jkone27 Hey -- sorry I hadn't seen this issue before. 😅

With regard to solving the issues that you referenced in the original bug report, does the guidance that I recommended in giraffe-fsharp/Giraffe#488 (comment)?

If so, it would be good to get a sense of what specific APIs need to be consumed. How is making EndpointMetadataApIDescriptionProvider public different from the current situation of being able to consume it's outputs via the public ApiDescription types?

@jkone27
Copy link
Author

jkone27 commented Oct 15, 2024

I see in Oxpecker and Falco the maintainers managed to implement something for openapi descriptors, they are both F# FP wrappers on top of AspNet core, some discussions there I can link them here if u are interested, sorry for the late reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi Needs: Design This issue requires design work before implementating. Priority:1 Work that is critical for the release, but we could probably ship without
Projects
None yet
Development

No branches or pull requests

4 participants