[BUG] csharp-netcore generates invalid code
Created by: aeneasr
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Generating code with discriminators leads the dotnet generator to fail
/Users/foobar/workspace/go/src/github.com/ory/sdk/clients/kratos/dotnet/src/Ory.Keto.Client/Model/KratosUiNodeInputAttributesValue.cs(46,35): error CS0019: Operator '??' cannot be applied to operands of type 'bool' and '<throw expression>' [/Users/foobar/workspace/go/src/github.com/ory/sdk/clients/kratos/dotnet/src/Ory.Keto.Client/Ory.Keto.Client.csproj]
/Users/foobar/workspace/go/src/github.com/ory/sdk/clients/kratos/dotnet/src/Ory.Keto.Client/Model/KratosUiNodeInputAttributesValue.cs(58,35): error CS0019: Operator '??' cannot be applied to operands of type 'decimal' and '<throw expression>' [/Users/foobar/workspace/go/src/github.com/ory/sdk/clients/kratos/dotnet/src/Ory.Keto.Client/Ory.Keto.Client.csproj]
openapi-generator version
5.1.1
OpenAPI declaration file content or url
Generation Details
$ openapi-generator-cli generate -i "${SPEC_FILE}" \
-g csharp-netcore \
-o "$dir" \
--model-name-prefix ${PROJECT_UCF} \
--git-user-id ory \
--git-repo-id sdk \
--git-host github.com \
-c ./config/client/dotnet.yml.proc.yml
# ./config/client/dotnet.yml.proc.yml
licenseId: Apache-2.0
packageName: "Ory.Keto.Client"
packageVersion: 0.0.0-alpha.55
packageAuthors: ORY
packageCompany: ORY GmbH
netCoreProjectFile: true
infoUrl: https://www.ory.sh
targetFramework: net5.0
disallowAdditionalPropertiesIfNotPresent: false
Steps to reproduce
See above
Related issues/PRs
None
Suggest a fix
I would love to have an idea but I am not a dotnet developer :(