OpenAPITools / OpenAPITools/openapi-generator

[BUG] Handling whitespaces in Type Names

Open
#11,512 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

In my swagger definition, I have models with whitespaces in their names (like Start page).
I want to generate the swagger.json using typescript-angular language, but the models that are generated have error like this:

export interface Start page { 

I didn't find any option to change the name to resolve this whitespace conflict. I tried the config option

{
  "modelPropertyNaming": "PascalCase"
}

but had no effect

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the typescript-angular generator using a model named "Start page" and review how model names are handled alongside the modelPropertyNaming option. Done means the generated swagger.json produces a valid TypeScript interface name without whitespace and the naming option behaves consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, openapi, typescript
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.