Skip to content

[REQ][CSharp] Set EmitDefaultValue to true #3274

@B14m3m3

Description

@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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions