OpenAPI Documents Empty

I upgraded my project to .NET 9, added the OpenAPI services on lines 6 and 16. Then when I go to https://localhost:<port>/openapi/v1.json I get a blank page. The port seems fine since none of the other ports connect to a page, this one does but there's nothing. I don't know what's wrong here. The only thing off I see in my output is 'Middleware: The WebRootPath was not found: C:<project directory>\wwwroot. Static files may be unavailable'
No description
No description
5 Replies
whatsinaname
whatsinaname2mo ago
it should work, did u f12 and see the api response for the request?
LA PÀSSION🔥🔥🔥
i got this
No description
LA PÀSSION🔥🔥🔥
404 means it cant find the document? i think OpenAPI wasnt set up correctly but idk what exactly went wrong
LA PÀSSION🔥🔥🔥
moving the app.MapOpenApi out seemed to fix it
No description
whatsinaname
whatsinaname2mo ago
It means it doesn't find the document

Did you find this page helpful?