39 lines
1.1 KiB
Markdown
39 lines
1.1 KiB
Markdown
Details on OpenAPI spec: https://swagger.io/specification/
|
|
|
|
|
|
Generate server stubs:
|
|
|
|
|
|
docker run -it --rm -v $PWD:/work -u $UID openapitools/openapi-generator:cli-v5.1.0 \
|
|
generate -i /work/openapi.yaml -g aspnetcore -o /work/output \
|
|
--package-name $PACKAGE_NAME \
|
|
--additional-properties="packageVersion=0.0.1,aspnetCoreVersion=5.0,operationIsAsync=true,modelPropertyNaming=camelCase,\
|
|
generateBody=false,classModifier=abstract,operationModifier=abstract"
|
|
|
|
|
|
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
|
|
|