-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG][Csharp][GenericHost] OpenApi 3.1: Model property of type map/ad…
…ditionalproperties gets generated as object (#18772) * Fix the bug + add test case * Add sample output * Update version number in new sample output --------- Co-authored-by: Gerwin Jansen <[email protected]>
- Loading branch information
1 parent
4ae4bc5
commit c08afa3
Showing
68 changed files
with
5,221 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# for csharp generichost | ||
generatorName: csharp | ||
outputDir: samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0 | ||
inputSpec: modules/openapi-generator/src/test/resources/3_1/csharp/oneOfDiscriminator.yaml | ||
library: generichost | ||
templateDir: modules/openapi-generator/src/main/resources/csharp | ||
additionalProperties: | ||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' | ||
useCompareNetObjects: true | ||
disallowAdditionalPropertiesIfNotPresent: false | ||
nullableReferenceTypes: true | ||
equatable: true | ||
targetFramework: net8.0 | ||
useOneOfDiscriminatorLookup: true |
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
60 changes: 60 additions & 0 deletions
60
modules/openapi-generator/src/test/resources/3_1/csharp/oneOfDiscriminator.yaml
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,60 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: oneof | ||
version: 0.0.1 | ||
paths: | ||
/: | ||
get: | ||
responses: | ||
'200': | ||
description: Key-value pairs with results | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Response' | ||
components: | ||
schemas: | ||
|
||
Result: | ||
properties: | ||
type: | ||
type: string | ||
checksum: | ||
type: string | ||
required: | ||
- type | ||
- checksum | ||
discriminator: | ||
propertyName: type | ||
|
||
FileResult: | ||
allOf: | ||
- $ref: '#/components/schemas/Result' | ||
properties: | ||
downloadUrl: | ||
type: string | ||
required: | ||
- downloadUrl | ||
|
||
StringResult: | ||
allOf: | ||
- $ref: '#/components/schemas/Result' | ||
properties: | ||
data: | ||
type: string | ||
required: | ||
- data | ||
|
||
Response: | ||
type: object | ||
properties: | ||
success: | ||
type: boolean | ||
results: | ||
additionalProperties: #key-value map | ||
oneOf: | ||
- $ref: '#/components/schemas/FileResult' | ||
- $ref: '#/components/schemas/StringResult' | ||
required: | ||
- success | ||
- results |
Oops, something went wrong.