Open pimfm opened 2 years ago
Hello, actually it is mainly here: https://github.com/vojtechhabarta/typescript-generator/blob/219c67120d92d6ca0da38955d6a2d86d41bd9703/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/TsType.java#L172-L187
This TypeScript feature is called Index Signatures (it was called Indexed Array in the past, I think) - https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures. That's why there is usually index
. But I agree that for many people key
would be more clear.
It would be easy change but I am not sure.
There is also suggestion that Java Map
should be generated as TypeScript Record
(#706).
Good day, really enjoying your generator, thanks for the ease of use of this project. My colleagues found a small thing that could be improved: This map
is generated into this:
It would be really nice if this index name was actually 'key' to show the key/value relation.
I suspect this code has something to do with it, but am not familiar enough to offer you a pull reqest. https://github.com/vojtechhabarta/typescript-generator/blob/1d533d9466bfc1a79f31c5105408e5900281d96a/typescript-generator-core/src/main/resources/helpers/jsonDeserialization.ts#L10
Hope you find the space to do this name adjustment. Thanks in advance