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

Issue in generation of C# classes with inheritance fixed #1319

Merged
merged 3 commits into from
Feb 25, 2021

Conversation

twodogmbh
Copy link
Contributor

Issue in the JsonSchemaAppender for the generation of classes fixed when the definitions reference the root schema. When the passed schema is already the root schema the method returns immediately instead of throwing an exception. In this case the definitions are already known and there is no reason to throw an exception.

Issue in the CSharpTypeResolver for the generation of base classes without properties fixed. When classes don't contain properties but contain the "discriminator" attribute they should still be generated. Otherwise it's not possible to define a class hierarchy where the parent class does not contain any property.
My assumption is that when "discriminator" is defined there is at least one derived class which is interested in this specific type, so it would be wrong to just replace it with AnyType (object)

Egli, Florian {DMMA~Rotkreuz-Tro} added 3 commits February 17, 2021 16:14
…hen the definitions reference the root schema. When the passed schema is already the root schema the method returns immediately instead of throwing an exception.

Issue in the CSharpTypeResolver for the generation of base classes without properties fixed. When classes don't contain properties but contain the "descriminator" attribute they should still be generated.
@twodogmbh
Copy link
Contributor Author

@RicoSuter Please can you review and merge the changes, if you agree with them. Thank you

@RicoSuter
Copy link
Owner

Lgtm, thanks for the PR.
Your description makes sense but I'm still a bit afraid :-)

@RicoSuter RicoSuter merged commit d8f5302 into RicoSuter:master Feb 25, 2021
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.

2 participants