Generate code on "/swagger/docs/v1" endpoint
See original GitHub issueGiven my backend service has a /swagger/docs/v1
endpoint:
When I try to generate the corresponding TS code, I get the following errors:
FATAL: swagger-document-override/md-override-loader - FAILED
FATAL: Error: Could not read 'https://localhost:44392/swagger/docs/v1'.
FATAL: swagger-document/loader - FAILED
FATAL: Error: Could not read 'https://localhost:44392/swagger/docs/v1'.
Process() cancelled due to exception : Could not read 'https://localhost:44392/swagger/docs/v1'.
The format is fine since I’m able to generate it if I run the tool on a local file with the same content as the one provided by the endpoint. The key difference probably resides in the fact that the endpoint uses the previous Swashbuckle endpoint that was modified in its .NET core associated project to /swagger/v1/swagger.json
(instead of swagger/docs/v1
without the .json
extension).
autorest --info
output:
Type Extension Name Version Location
core @microsoft.azure/autorest-core 2.0.4280 C:\Users\fpelletier\.autorest\@microsoft.azure_autorest-core@2.0.4280
extension @microsoft.azure/autorest.modeler 2.1.23 C:\Users\fpelletier\.autorest\@microsoft.azure_autorest.modeler@2.1.23
extension @microsoft.azure/autorest.typescript 2.0.304 C:\Users\fpelletier\.autorest\@microsoft.azure_autorest.typescript@2.0.304
extension @microsoft.azure/autorest.typescript 2.0.330 C:\Users\fpelletier\.autorest\@microsoft.azure_autorest.typescript@2.0.330
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Get started with Swashbuckle and ASP.NET Core
Launch the app, and navigate to http://localhost:<port>/swagger/v1/swagger.json . The generated document describing the endpoints appears as ...
Read more >Configuring and Using Swagger UI in ASP.NET Core Web API
SwaggerGen : A Swagger generator that builds SwaggerDocument objects directly from our routes, controllers, and models. Wanna join Code Maze ...
Read more >A clean way to add Swagger to ASP.NET Core application
NET Core application using extension methods to make startup.cs clean and ... SwaggerEndpoint( "/swagger/v1/swagger.json" , "My API V1" );.
Read more >How to generate OpenAPI document/SwaggerDoc for ...
Need a way to generate SwaggerDoc per controller per version. Example on end points: <cname>/v1/Employees, <cname>/v2/Employees, <cname>/v1/ ...
Read more >domaindrivendev/Swashbuckle.AspNetCore - GitHub
SwaggerEndpoint ("v1/swagger.json", "My API V1"); }); ... Getting Started) to provide beautiful API docs that are automatically generated from your code.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK-- so doing a simple HTTP GET does return you the Swagger document to use for generation, then? I will try to repro when I get a chance.
I will close this issue for now since the tool might not be in fault here and maybe we have to setup something on our end in order to have the endpoint available for code generation.