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
  • #14706
Closed
Open
Issue created Feb 15, 2023 by Administrator@rootContributor

Override default special chars replacement

Created by: deimosfr

Is your feature request related to a problem? Please describe.

I'm using openapi generator to generate a Rust library from Scaleway Cloud provider OpenAPI spec (https://github.com/Qovery/scaleway-api-rs). When I generate the API, the naming does not respect the spec because of replaced chars.

Example, the spec starts with:

...
components:
  schemas:
    google.protobuf.UInt32Value:
      type: integer
      nullable: true
    scaleway.k8s.v1.CNI:
      type: string
      enum:
      - unknown_cni
      - cilium
      - calico
      - weave
      - flannel
      - kilo
      default: unknown_cni
    scaleway.k8s.v1.Cluster:
...

Here scaleway.k8s.v1.CNI, when generated becomes:

pub use self::scaleway_period_k8s_period_v1_period_cni::ScalewayPeriodK8sPeriodV1PeriodCni;

As you can see Period and _period_ are replacing the dots everywhere https://docs.rs/scaleway_api_rs/latest/scaleway_api_rs/models/index.html

Describe the solution you'd like

It would be great to have a way to override default special chars override https://github.com/OpenAPITools/openapi-generator/blob/68b944e6e62fa69669e97a8c2041a7eb7ed3314a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L1820 to avoid this behavior.

I may have missed something, and there is something simple to achieve this, so feel free to tell me.

What do you think?

Thanks

Assignee
Assign to
Time tracking