[all] BUG: intentional underscore in front of fields getting removed on camelize
Created by: sruehl
Description
Currently if we have an spec where one field (e.g. _links) is defined the current StringUtils replaces the first underscore on camelize. This doesn't seem right so I fixed it in my branch. However there are couple of Tests that fail then:
org/openapitools/codegen/go/GoModelTest.java:282
org/openapitools/codegen/php/PhpModelTest.java:284
and so on.
The correct behavior should be IMHO {"_sample", "_Sample"},
instead of {"_sample", "Sample"},
openapi-generator version
master HEAD 774013c7
OpenAPI declaration file content or url
https://gist.github.com/sruehl/18b8b704586ad7b39e488018c17ef7e5
Command line used for generation
generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/default $@
Steps to reproduce
- Generate
- look at api.ts and see that
_links
has becomelinks
and therefore is undefined at runtime.
Related issues/PRs
#1634
Suggest a fix/enhancement
keep the first underscore on camelCase