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

ODataRoutingSample openAPI #1399

Open
swurzinger opened this issue Jan 29, 2025 · 0 comments
Open

ODataRoutingSample openAPI #1399

swurzinger opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@swurzinger
Copy link

Describe the bug
The openAPI reference implementation in ODataRoutingSample seems to have issues:

  1. there seem to be two different implementations. One as middleware (ODataOpenApiMiddleware) and one as controller (ODataOpenApiController). Not sure if latter is even used?
  2. The middleware implementation seems faulty/incomplete. v2 and v3 models do work, but v1 doesn't.

Reproduce steps
perform a GET request http://localhost:5000/v1/$openapi (other versions work)

Request/Response

System.NotSupportedException: Specified method is not supported.
   at ODataRoutingSample.OpenApi.ODataPathTranslater.Translate(ODataPathTemplate pathTemplate, IEdmModel model) in sample\ODataRoutingSample\OpenApi\ODataPathTranslater.cs:line 107
   at ODataRoutingSample.OpenApi.OpenApiDocumentExtensions.CreateDocument(HttpContext context, String prefixName) in sample\ODataRoutingSample\OpenApi\OpenApiDocumentExtensions.cs:line 70
   at ODataRoutingSample.OpenApi.ODataOpenApiMiddleware.ProcessOpenApiAsync(HttpContext context, String prefixName) in sample\ODataRoutingSample\OpenApi\ODataOpenApiMiddleware.cs:line 82
   at ODataRoutingSample.OpenApi.ODataOpenApiMiddleware.Invoke(HttpContext context) in sample\ODataRoutingSample\OpenApi\ODataOpenApiMiddleware.cs:line 66
   at Microsoft.AspNetCore.OData.Routing.ODataRouteDebugMiddleware.Invoke(HttpContext context) in src\Microsoft.AspNetCore.OData\Routing\ODataRouteDebugMiddleware.cs:line 80
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Expected behavior
OpenAPI json

some explanation of the OpenAPI implementation would also be nice (e.g.: why do we use a custom IODataPathProvider and what does it do)

@swurzinger swurzinger added the bug Something isn't working label Jan 29, 2025
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

No branches or pull requests

1 participant