ferdikoomen / openapi-typescript-codegen

NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
MIT License
2.89k stars 519 forks source link

Add possibility to switch case for filenames #966

Open smarlhens opened 2 years ago

smarlhens commented 2 years ago

Hi @ferdikoomen 👋🏻

Describe the solution you'd like Add the possibility to change the case of the file names. I personally use kebab-case + dot.case and I would like my files to have a consistency in their filenames.

Examples:

Case Core Service (with postfix) Model
PascalCase (current) BaseHttpRequest.ts FooBarService.ts FooBar.ts
PascalCase + dot.case* BaseHttpRequest.ts FooBar.Service.ts FooBar.ts
kebab-case base-http-request.ts foo-bar-service.ts foo-bar.ts
kebab-case + dot.case* base-http-request.ts foo-bar.service.ts foo-bar.ts
camelCase baseHttpRequest.ts fooBarService.ts fooBar.ts
camelCase + dot.case* baseHttpRequest.ts fooBar.service.ts fooBar.ts
snake_case base_http_request.ts foo_bar_service.ts foo_bar.ts
snake_case + dot.case* base_http_request.ts foo_bar.service.ts foo_bar.ts

*: using additional dot.case as auto-generated-name[dot]postfix[dot]extension

What do you think ?

Wish you a great day 🌞.

Pangamma commented 1 year ago

Pleeeeease make this a thing. Esp since the naming convention for typescript and javascript is usually camel case.

zhoub commented 4 months ago

Bump, this would be helpful.

mrlubos commented 4 months ago

@zhoub what do you think about the output in https://github.com/hey-api/openapi-ts? We don't do one file per export + you can configure type names if you want, though only to pascalcase for now

zhoub commented 4 months ago

@zhoub what do you think about the output in https://github.com/hey-api/openapi-ts? We don't do one file per export + you can configure type names if you want, though only to pascalcase for now

Yes, this is much better !