From af39c70483df96869fff5f58cabe5b831a6042ad Mon Sep 17 00:00:00 2001 From: Detlef Runde Date: Thu, 19 May 2022 09:27:54 +0200 Subject: [PATCH] changed reference in Startup.cs to use the original OpenAPI contract that's included in the static files (instead of using generated from C# classes) to get the provided sample requests --- readme.md | 5 ++++- server/src/Org.OpenAPITools/Startup.cs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 46a84cd..d8e60a6 100644 --- a/readme.md +++ b/readme.md @@ -32,7 +32,7 @@ change version number in all files if a new version is provided ### folder `Controllers`: change "`public class`" to "`public abstract class`" -compare files in "`ControllersImpl`" with the corresponding files in "`Controllers`" and adapt if necessary +compare files folder in "`ControllersImpl`" with the corresponding files in "`Controllers`" and adapt if necessary methods should be the same with "`override`" instead of "`virtual`" @@ -77,6 +77,9 @@ the folder `Services` should contain one common class with the DatabaseSettings the naming in the DatabaseSettings is the same as defined in `appsettings.json`, which you have to extend when creating new classes in this folder. changed `appsettings.json` in the folder `docker` accordingly. Make sure that the ConnectionString for the database contains the correct IP address as specified in `docker-compose.yml`. +### folder `wwwroot` +add in `openapi-original.json` in section `servers` the urls of the servers you want to use with swagger-ui + # MongoDB if you don't have a MongoDB, follow the instructions in `readme.md` in `server/programs/MongoDB` diff --git a/server/src/Org.OpenAPITools/Startup.cs b/server/src/Org.OpenAPITools/Startup.cs index 718268b..c9e1470 100644 --- a/server/src/Org.OpenAPITools/Startup.cs +++ b/server/src/Org.OpenAPITools/Startup.cs @@ -145,10 +145,10 @@ namespace Org.OpenAPITools // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html c.RoutePrefix = "openapi"; //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) - c.SwaggerEndpoint("/openapi/0.0.6/openapi.json", "World Storage API"); + //c.SwaggerEndpoint("/openapi/0.0.6/openapi.json", "World Storage API"); //TODO: Or alternatively use the original OpenAPI contract that's included in the static files - //c.SwaggerEndpoint("/openapi-original.json", "World Storage API Original"); + c.SwaggerEndpoint("/openapi-original.json", "World Storage API Original"); }); app.UseRouting(); app.UseEndpoints(endpoints => -- GitLab