swagger-api / swagger-api/swagger-codegen-generators

[typescript] Incorrect `extends null<...>` declaration for map/dictionary-like schema definitions with `additionalProperties`

Open
#1,297 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

OpenApi Schema
    "MyDictionary": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
Generated TypeScript
/**
 * 
 * @export
 * @interface ProviderIdDictionary
 */
export interface ProviderIdDictionary extends null<String, string> {
    [key: string]: string;
}

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

The issue names no source file or test; start by locating the TypeScript generator path for schemas using additionalProperties, then reproduce the shown map-like schema. Done means the generated declaration is valid TypeScript without the incorrect null generic and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.