docker run --rm --volume "$(CURDIR):/app/publish" nswag \
--file "/app/publish/my.oas.yaml" \
--namespace "My.Namespace" \
--generator "controller"docker run --rm --volume "$(CURDIR):/app/publish" nswag \
--file "publish/my.oas.yaml" \
--namespace "My.Namespace" \
--generator "client" \
--suffix "Contract" \
--inject-http-client true--file: (Required) The path to the OpenAPI specification file.--namespace: (Required) The namespace for the generated code.--generator: (Required) Select whether to generate aClientor aController.--suffix: The suffix for the generated classes.--inject-http-client: Whether to inject an HttpClient into the generated client (default:false).--output: The output path for the generated file. If not specified, the input file path with.csextension will be used.
The following example shows how to use the --output option~~~~ to specify a custom path for the generated file.
generate-test-client:
docker run --rm --volume '$(CURDIR):/app/publish' nswag \
--file 'publish/my.oas.yaml' \
--namespace 'My.Other.Namespace' \
--generator 'client' \
--suffix 'Dto' \
--output 'publish/My.Other.Namespace/Rest/my.oas.yaml.cs'