Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #9442
Closed
Open
Issue created May 10, 2021 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[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

API Specification

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 :(

Assignee
Assign to
Time tracking