Closed who closed 9 years ago
@who agree with you that codegen should sanitize or throw an error for invalid value in the JSON.
Personally I prefer sanitization on the input. Let me know if you've cycle to submit a PR or I'll spend some time next week to work on it.
@wing328 I'd be happy to put a PR together
I am working with a pipeline that generates the swagger-codegen config json file. Sometimes, a json file is generated that contains dashes in the apiPackage parameter. Dashes are not valid values in java package names, so it would be nice if swagger-codegen would sanitize this or throw an error.
Here is an example/repro (requires mvn, java) :
1. Make a temporary working directory
2. Download swagger-codegen-cli.jar
3. Create a config with invalid values Note that there is a dash in the
apiPackage
4. Invoke swagger-codegen-cli.jar
5. Compile the generated output
Result: