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

[REQ][CSharp] Set EmitDefaultValue to true

Created by: B14m3m3

Is your feature request related to a problem? Please describe.

CSharp generated files have "EmitDefaultValue=false".

[DataContract]
    public partial class MyClass: IEquatable<MyClass>
    { 
        /// <summary>
        /// Gets or Sets MyVal
        /// </summary>
        [DataMember(Name="Unrealized",  EmitDefaultValue=false)]
        public double MyVal{ get; set; }`
        ...
    }

Describe the solution you'd like

There should be an option to not set this value (The default is true). It looks like there is a option on https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/csharp-refactor.md. But i was unable to generate models with that generator.

So something like --additional-properties optionalEmitDefaultValues=true

Describe alternatives you've considered

None?

Assignee
Assign to
Time tracking