swagger-codegen-generators icon indicating copy to clipboard operation
swagger-codegen-generators copied to clipboard

[Typescript] Set parent for additional properties to Record<string, Child>

Open Lukas-Kullmann opened this issue 4 years ago • 3 comments

This fixes #691

The gist of the issue is that currently, the typescript generators generate additional properties to have a parent of null<String, Child>. This is wrong in two dimensions.

  1. The parent type should not be null. I chose Record in this PR as a default.
  2. The parameter of the key is in upper case. This is wrong in Typescript and has to be lower case. This actually comes hard-coded from the DefaultCodegenConfig class. I guess this is a bug here, but I did not dare touching it since it affects all languages.

Lukas-Kullmann avatar Mar 12 '21 08:03 Lukas-Kullmann

Seems resonable to me. At the very least map=Record should be default. Workaround while waiting for this PR is adding --instantiation-types map=Record to the CLI. However, this still generates Record<String, instead of Record<string, .

filiplindqvist-netlight avatar Mar 31 '21 08:03 filiplindqvist-netlight

@Lukas-Kullmann Any update on this PR? Why is it not merged?

magua-io avatar Nov 17 '22 21:11 magua-io

Are there any updates on this? This fix would help me very much too

Paku580 avatar Apr 26 '23 18:04 Paku580