Commit af39c704 authored by Detlef Runde's avatar Detlef Runde
Browse files

changed reference in Startup.cs to use the original OpenAPI contract that's...

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
parent 15861cad
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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` 

+2 −2
Original line number Diff line number Diff line
@@ -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 =>