Skip to content

Transform case for generated types #558

@robdodson

Description

@robdodson

Description

On the old openapi-typescript-codegen repo, I opened a PR to add a --transformCase flag which seemed pretty popular. Would y'all be willing to accept a similar PR?

Much like the original requester in ferdikoomen/openapi-typescript-codegen#1252, our company has a large API that returns keys in snake case, but we convert them to camel case on the frontend using a bit of middleware in our fetch functions. The types generated from our OpenAPI specs are in snake case, which means we can't use them.

For example, if the original file was in snake case:

type MyModel {
  foo_bar: string;  
}

Using --transformCase camel would convert it to:

type MyModel {
  fooBar: string;  
}

Metadata

Metadata

Assignees

Labels

RSVP 👍👎Explicit request for reactions to gauge interest in resolving this issuefeature 🚀New feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions