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
  • #3473
Closed
Open
Issue created Jul 26, 2019 by Administrator@rootContributor

[C#][csharp-netcore] Error responses do not correctly deserialise

Created by: rizwansaeed

Description

If an API returns a response in the 400 range e.g. 404 along with a body, it attempts to deserialise into the target model object rather than ApiException resulting in a deserialisation error and loses the body of the response

openapi-generator version

4.0.3

OpenAPI declaration file content or url

https://fbn-prd.lusid.com/api/swagger/v0/swagger.json

Command line used for generation

java -jar openapi-generator-cli.jar generate -g csharp-netcore -c config.json

{
  "packageName": "Lusid.Sdk",
  "sourceFolder": ".",
  "targetFramework": "netcoreapp2.0",
  "useDateTimeOffset": true,
  "netCoreProjectFile": true,
  "returnICollection": true,
  "packageVersion": "0.10.482"
}
Suggest a fix

The issue looks related to https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache#L126 but an ApiException would needed to be propagated back up the cll chain

Assignee
Assign to
Time tracking