Skip to content

Allow schemas with additionalProperties to generate AdditionalData prop#6454

Merged
baywet merged 5 commits intomicrosoft:mainfrom
iskandersierra:main
May 13, 2025
Merged

Allow schemas with additionalProperties to generate AdditionalData prop#6454
baywet merged 5 commits intomicrosoft:mainfrom
iskandersierra:main

Conversation

@iskandersierra
Copy link
Contributor

@iskandersierra iskandersierra commented Apr 12, 2025

When generating from a schema with additionalProperties set to a schema instead of true, no AdditionalData property is generated (only using the OpenApiSchema model because reading it from serialized format the AdditionalPropertiesAllowed is true by default).

This PR addresses parts of this comment, asking for this fix.

However it doesn't address the whole Issue yet. The type of the AdditionalData property should use the proper type indicated in the additionalProperties, but that needs to be discussed further on whether that could break client's code.

fixes #6443

…llowed or AdditionalProperties from the schema in KiotaBuilder
@iskandersierra iskandersierra requested a review from a team as a code owner April 12, 2025 16:25
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

Can you also add an entry to the changelog please? (unreleased, changed)

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes!
Thank you for your patience.

@baywet baywet enabled auto-merge (squash) May 13, 2025 17:51
@baywet baywet merged commit 279a8d8 into microsoft:main May 13, 2025
438 of 444 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants