-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AllOf with one
$ref
generates code with a base class.
- Loading branch information
Showing
8 changed files
with
142 additions
and
49 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
specs/Qowaiv.CodeGeneration.Specs/Generated/AllOfExamples/SomeBaseClass.generated.cs
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,20 @@ | ||
// ------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
// ------------------------------------------------------------------------------ | ||
|
||
#nullable enable | ||
|
||
namespace AllOfExamples; | ||
|
||
[System.Text.Json.Serialization.JsonDerivedType(typeof(AllOfExamples.SomeChildClass))] | ||
public partial record SomeBaseClass | ||
{ | ||
[System.Text.Json.Serialization.JsonPropertyName("id")] | ||
[Qowaiv.Validation.DataAnnotations.Optional] | ||
public long Id { get; init; } | ||
} |
19 changes: 19 additions & 0 deletions
19
specs/Qowaiv.CodeGeneration.Specs/Generated/AllOfExamples/SomeChildClass.generated.cs
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,19 @@ | ||
// ------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
// ------------------------------------------------------------------------------ | ||
|
||
#nullable enable | ||
|
||
namespace AllOfExamples; | ||
|
||
public sealed partial record SomeChildClass : AllOfExamples.SomeBaseClass | ||
{ | ||
[System.Text.Json.Serialization.JsonPropertyName("email")] | ||
[Qowaiv.Validation.DataAnnotations.Optional] | ||
public Qowaiv.EmailAddress Email { get; init; } | ||
} |
38 changes: 38 additions & 0 deletions
38
specs/Qowaiv.CodeGeneration.Specs/OpenApi/Definitions/all-of.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,38 @@ | ||
{ | ||
"openapi": "3.0.2", | ||
"info": { | ||
"title": "All Of example", | ||
"version": "1.0.0" | ||
}, | ||
"paths": {}, | ||
"components": { | ||
"schemas": { | ||
"SomeBaseClass": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64", | ||
"example": 1 | ||
} | ||
} | ||
}, | ||
"SomeChildClass": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/components/schemas/SomeBaseClass" | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"email": { | ||
"type": "string", | ||
"format": "email" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
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
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
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