Closed pjmagee closed 2 months ago
Thanks for raising this @pjmagee
It looks like this issue only affect python at the moment as the other languages do not seem to exhibit this behaviour.
The cause here looks be that python properties are written by the CodeMethodWriter
rather than the property writer(not exactly sure of the reason why here) which expects the presence of the CodeMethodKind.Constructor
method in order to write the types.
When the additionalproperties are not present, the constructor is not added as the model does not have any property with a default value(additionalData).
To fix this we probably need to either have the python refiner have the constuctor forceAdd
the constructor for model types by passing the Boolean parameter here as well as the Class kinds that may not need the default constructor.
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Nuget tool
Client library/SDK language
None
Describe the bug
The generated Python code with
--additional-data false
breaks the generated pythonExpected behavior
To not remove the fields... see example of running the generator a 2nd time with Git history showing the changes...
How to reproduce
Generate with the flag set to true and then generate again with it set to false.
Open API description file
Seems to be any openapi specification, as it occurs with all 3 openapi documents I am dealing with.
Kiota Version
1.14.0
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
Unknown, will have to ensure the flag is still set to true for Python only.
Configuration
Win11 running docker
mcr.microsoft.com/openapi/kiota:1.14.0
Debug output
Click to expand log
```Other information
No response