path confusions

This commit is contained in:
Wolfgang Hottgenroth 2021-12-06 13:12:14 +01:00
parent c6fb7b498f
commit ebc5018b22
Signed by: wn
GPG Key ID: E49AF3B9EF6DD469
3 changed files with 10 additions and 3 deletions

4
ENV
View File

@ -1,7 +1,7 @@
PACKAGE_NAME=de.hottis.genericdatabaseapiservice
PACKAGE_NAME=com.krohne.genericdatabaseapiservice
export PACKAGE_NAME
ROUTE_PREFIX="pdb/v2/api"
ROUTE_PREFIX="pdb/v2"
export ROUTE_PREFIX
# DO NOT USE IN CI/CD ENVIRONMENT, ONLY FOR MANUAL BUILDS AND RUNS

View File

@ -91,9 +91,15 @@ if [ "$STAGE2" = "1" ]; then
sed -i output/src/$PACKAGE_NAME/Startup.cs \
-e 's#\(using '$PACKAGE_NAME'.OpenApi;\)#\1\n\n// added by post-processor\nusing '$PACKAGE_NAME'.Services;\n#' \
-e 's#^\([[:space:]]*\)\(// Add framework services.\)#\1// added by post-processor\n\1services.AddTransient<IDbService, DbService>();\n\n\1\2#' \
-e 's#\(c.RoutePrefix = "\)openapi\(";\)#\1'$ROUTE_PREFIX'/doc\2#' \
-e 's#\(c.RoutePrefix = "\)openapi\(";\)#\1'$ROUTE_PREFIX'/api/doc\2#' \
-e 's#\(c.SwaggerEndpoint("\)/openapi/2.0.0/openapi.json\(", "Generic Database API Service");\)#\1'$ROUTE_PREFIX'/api/openapi/JSON\2#' \
-e 's#\(c.RouteTemplate = "\)openapi/{documentName}/openapi.json\(";\)#\1'$ROUTE_PREFIX'/api/openapi/JSON\2#' \
-e 's#\(app.UseHttpsRedirection();\)#// \1#'
echo "fix root redirect in index.html"
sed -i output/src/$PACKAGE_NAME/wwwroot/index.html \
-e 's#openapi#'$ROUTE_PREFIX'/api/doc#'
echo "disable documentation warnings in generated code"
sed -i output/src/$PACKAGE_NAME/$PACKAGE_NAME.csproj \
-e 's#\(</PropertyGroup>\)#<NoWarn>1591</NoWarn>\n\1#'

View File

@ -4,6 +4,7 @@ info:
title: Generic Database API Service
version: "2.0.0"
paths:
# /pdb/v2/test1:
# post: