Open rcebrian opened 2 years ago
@rcebrian thanks for reporting the issue. I wonder if you can file a PR with the suggested fix and we'll review accordingly.
Hi @wing328, you can see the suggested fix on this PR: https://github.com/OpenAPITools/openapi-generator/pull/13934
Bug Report Checklist
Description
If you want to close the response with no body, the generated code sends
null
as body. For example, you need to create a new user withname
andfirstname
, if everything is ok, the user is created and the api wants to return201 - Created
with no body.The current output is:
The expected output would be:
openapi-generator version
Tool:
@openapitools/openapi-generator-cli@2.5.2
OpenAPI declaration file content or url
Generation Details
Configuration file (
config.yaml
):export GO_POST_PROCESS_FILE="goimports -w" openapi-generator-cli generate --generator-name go-server \ --input-spec $SPECS_FILE \ --config $CONFIG_FILE \ --global-property apiDocs=true \ --global-property verbose=false \ --model-name-suffix dto \ --enable-post-process-file \ -o $OUTPUT_DIR