Skip to content

Generate AdditionalData (C#), even when --additional-data is false, if the schema has additionalProperties #6443

@iskandersierra

Description

@iskandersierra

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

Csharp

Describe the bug

When I set --additional-data true, there are no models with AdditionalData generated, even if additionalProperties is set to something other than false

Expected behavior

I expected that AdditionalData wouldn't be generated for any model, except for those with additionalProperties in the schema, like dictionaries and the like (coming from C#).

Right now I'm forced to generate the AdditionalData for all models if I use something like ValidationProblemDetails, which have Extensions and Errors, or properties of type Dictionary

How to reproduce

Just use a simple schema and add a type: object with additionalProperties: { type: string }, and generate using --additional-data false.

Open API description file

Do not have an example, but can provide one if necessary (current sample is too long)

Kiota Version

1.24.3+cc67ec460c8dc51cdd6df7782dfb8e0925e97205

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

It's a all or nothing situation. I cannot disable additional data generation if I have a model with additionalProperties in the schema.

Configuration

  • OS: Windows 11
  • Arch: x64

Debug output

Click to expand log ```
</details>


### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Attention 👋enhancementNew feature or requestgeneratorIssues or improvements relater to generation capabilities.type:enhancementEnhancement request targeting an existing experience

    Projects

    Status

    Done ✔️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions