Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #1633
Closed
Open
Issue created Dec 07, 2018 by Administrator@rootContributor

[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
  1. Generate
  2. look at api.ts and see that _links has become links and therefore is undefined at runtime.
Related issues/PRs

#1634

Suggest a fix/enhancement

keep the first underscore on camelCase

Assignee
Assign to
Time tracking