Repository navigation
⚠️ Behaviour changes
Swagger2 schema output changes with default settings (#1931). Properties that are both required and nullable now emit x-nullable: true instead of silently losing their declared nullability. This applies when generating SchemaType.Swagger2 documents and the property is marked required by a presence-only marker — the C# required keyword, [JsonRequired], [DataMember(IsRequired = true)], or Newtonsoft Required.AllowNull. Properties marked with [Required] from DataAnnotations are unaffected. Downstream, C# clients generated from such documents may now produce nullable types where they previously produced non-nullable ones.
Generated C# changes when UseRequiredKeyword = true (#1926). Previously this setting suppressed default-value and = default! initializers on all properties. It now suppresses them only on properties that actually receive the required keyword, so optional properties regain their initializers. The required keyword itself is still emitted on exactly the same properties. Users on the default (UseRequiredKeyword = false) see no change.
New settings
CSharpGeneratorSettings.IntegerType(default"int") — maps unformatted integer properties to a custom .NET type. Explicit formats (byte,int32,int64/long,uint64/ulong) and min/max-drivenlongwidening still take precedence. (#1889)CSharpGeneratorSettings.AdditionalPropertiesValueType(default"object") — controls the value type of the generated extension-data dictionary. (#1936)CSharpGeneratorSettings.PropertyAttributeFactoryand the newIPropertyAttributeFactoryinterface (defaultnull) — renders custom attributes on generated properties. (#1938)
What's Changed
- Add IntegerType setting to CSharpGeneratorSettings by @lahma with @Copilot in #1889
- chore: Clarify required-marker logic and strengthen MinLength assertions by @RicoSuter in #1923
- Only skip default value initialization for required properties when UseRequiredKeyword is enabled by @BenHewins in #1926
- docs: add general pull request template by @RicoSuter in #1940
- Add CSharp generator param for extensions data value type by @zaigr in #1936
- Add IPropertyAttributeFactory to allow custom attributes on generated C# properties by @mingyaulee in #1938
- Emit x-nullable for required nullable properties in Swagger2 by @raeffs in #1931
New Contributors
- @BenHewins made their first contribution in #1926
- @zaigr made their first contribution in #1936
- @mingyaulee made their first contribution in #1938
- @raeffs made their first contribution in #1931
Full Changelog: v11.6.1...v11.6.2