openapi-client-axios
openapi-client-axios copied to clipboard
Wrong typing for object
The typing for "object" is wrong in latest release.
The key could be string | number or anything.
This has been changed in latest release.
@meabed can you be more specific?
Is this related to the openapi-client-axios-typegen package?
Thanks @anttiviljami, yes it's the typegen package.
Can you clarify?
What exactly changed? What is the desired/expected behaviour?
Sure, The previous behavior is swagger with property "object", for example:
"properties": {
"metadata": {
"description": "",
"type": "object"
}
}
it generate typing
metadata?: {}
After the last update, it generates types as:
metadata?: {
[key: string]: any;
};
Which is wrong because key could be number / undefined / null / string. I think it might be an issue with dtsgenerator?
Thanks!
Hey there,
you should report this error on https://github.com/horiuchi/dtsgenerator (used by : https://github.com/anttiviljami/dtsgenerator)
This is an upstream issue with dtsgenerator but I’ll leave this open for the time being to track
did someone report this already? / any updates?
in my case this happens, when defining: oneOf: [{ type: 'string' }, { type: 'number' }]