documentation
This commit is contained in:
parent
73005d9657
commit
df3284fe71
48
readme.md
48
readme.md
@ -1,38 +1,24 @@
|
|||||||
Details on OpenAPI spec: https://swagger.io/specification/
|
Details on OpenAPI spec: https://swagger.io/specification/
|
||||||
|
|
||||||
|
|
||||||
Generate server stubs:
|
To build, use the script generateAll.sh. Before running this script, load the ENV file with
|
||||||
|
the PACKAGE_NAME variable.
|
||||||
|
|
||||||
|
Options of the script are:
|
||||||
|
|
||||||
|
r ... Remove stall output directory
|
||||||
|
1 ... generate implementation code
|
||||||
|
2 ... generate OpenAPI server stub code, patch required files and copy implementation code
|
||||||
|
into the generated source tree
|
||||||
|
b ... build the while service
|
||||||
|
x ... execute the service
|
||||||
|
|
||||||
|
|
||||||
docker run -it --rm -v $PWD:/work -u $UID openapitools/openapi-generator:cli-v5.1.0 \
|
Configuration for the service is injected using environment variables:
|
||||||
generate -i /work/openapi.yaml -g aspnetcore -o /work/output \
|
|
||||||
--package-name $PACKAGE_NAME \
|
Database__Host
|
||||||
--additional-properties="packageVersion=0.0.1,aspnetCoreVersion=5.0,operationIsAsync=true,modelPropertyNaming=camelCase,\
|
Database__User
|
||||||
generateBody=false,classModifier=abstract,operationModifier=abstract"
|
Database__Password
|
||||||
|
Database__Name
|
||||||
|
|
||||||
|
|
||||||
Configuration details for generator: https://openapi-generator.tech/docs/generators/aspnetcore/
|
|
||||||
|
|
||||||
Build and run the stub webservice:
|
|
||||||
|
|
||||||
docker run -it --rm -p 8080:8080 -v $PWD:/work \
|
|
||||||
registry.hottis.de/dockerized/dotnetcore5sdk:1.0.0 \
|
|
||||||
bash
|
|
||||||
|
|
||||||
ATTENTION: This won't work with a set UID
|
|
||||||
|
|
||||||
Build:
|
|
||||||
|
|
||||||
sh build.sh
|
|
||||||
|
|
||||||
Run:
|
|
||||||
|
|
||||||
dotnet run -p src/$PACKAGE_NAME/$PACKAGE_NAME.csproj
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
From output/src/$PACKAGE_NAME:
|
|
||||||
* dotnet add package MySqlConnector --version 2.0.0
|
|
||||||
* make implementations directory
|
|
||||||
* copy generate endpoint implementation code to implementations directory
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user