Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only generate additional properties at base class level #1512

Conversation

sdecoodt
Copy link
Contributor

Fixes #1488

The JsonExtensionData attribute is only allowed once on a class.
A previous fix to make sure it's only generated once (#1447) did not cover deep hiarachies of inheritance.

  • Included a unit test to reproduce the multilevel inheritance issue
  • Extended the model so that there is a sepperation of logic
    • Indication if the class has addtional properties
    • Indication if the additional properties actually need to be generated

Related Issues:
#2818 on the NSwag repo

@RicoSuter RicoSuter merged commit c66ffc8 into RicoSuter:master May 8, 2022
@RicoSuter
Copy link
Owner

Thanks for the PR.

@sdecoodt sdecoodt deleted the patches/fix-additional-properties-repeated branch May 16, 2022 19:14
@sdecoodt
Copy link
Contributor Author

Thanks for the PR.

You're welcome. Thanks for the merge.
I realize it was a bit of a selfish contribution :)
I'm willing to help tackle something else if you have suggestions.

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.

AdditionalProperties in multiple places
3 participants