-
-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue in generation of C# classes with inheritance fixed (#1319)
* Bug in JsonReferenceResolver fixed which prevented the referencing of definitions in other files. * 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. 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. Co-authored-by: Egli, Florian {DMMA~Rotkreuz-Tro} <[email protected]>
- Loading branch information
Showing
5 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/NJsonSchema.CodeGeneration.CSharp.Tests/References/Animal.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"title": "Animal", | ||
"type": "object", | ||
"x-abstract": true, | ||
"discriminator": "discriminator", | ||
|
||
"definitions": { | ||
"Cat": { | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "Animal.json" | ||
} | ||
] | ||
}, | ||
"PersianCat": { | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/Cat" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters