Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use the new CSharpJsonPolymorphicSerializationStyle.NJsonSchema optio…
…n name
  • Loading branch information
mac-michael committed Apr 28, 2025
commit e4cd5bbe3f4d369b3cd27a69262d795944828c6c
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ public CSharpJsonLibrary JsonLibrary
set => Settings.JsonLibrary = value;
}

[Argument(Name = "JsonPolymorphicSerializationStyle", IsRequired = false, Description = "The CSharp JSON polymorphic serialization style, 'NSwag' or 'SystemTextJson' (default: 'NSwag', 'SystemTextJson' is experimental).")]
[Argument(Name = "JsonPolymorphicSerializationStyle", IsRequired = false, Description = "The CSharp JSON polymorphic serialization style, 'NJsonSchema' or 'SystemTextJson' (default: 'NJsonSchema', 'SystemTextJson' is experimental).")]
public CSharpJsonPolymorphicSerializationStyle JsonPolymorphicSerializationStyle
{
get { return Settings.JsonPolymorphicSerializationStyle; }
set { Settings.JsonPolymorphicSerializationStyle = value; }
get => Settings.JsonPolymorphicSerializationStyle;
set => Settings.JsonPolymorphicSerializationStyle = value;
}

[Argument(Name = "GenerateDefaultValues", IsRequired = false, Description = "Specifies whether to generate default values for properties (may generate CSharp 6 code, default: true).")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ public CSharpJsonLibrary JsonLibrary
set => Settings.CSharpGeneratorSettings.JsonLibrary = value;
}

[Argument(Name = "JsonPolymorphicSerializationStyle", IsRequired = false, Description = "The CSharp JSON polymorphic serialization style, 'NSwag' or 'SystemTextJson' (default: 'NSwag', 'SystemTextJson' is experimental).")]
[Argument(Name = "JsonPolymorphicSerializationStyle", IsRequired = false, Description = "The CSharp JSON polymorphic serialization style, 'NJsonSchema' or 'SystemTextJson' (default: 'NJsonSchema', 'SystemTextJson' is experimental).")]
public CSharpJsonPolymorphicSerializationStyle JsonPolymorphicSerializationStyle
{
get { return Settings.CSharpGeneratorSettings.JsonPolymorphicSerializationStyle; }
set { Settings.CSharpGeneratorSettings.JsonPolymorphicSerializationStyle = value; }
get => Settings.CSharpGeneratorSettings.JsonPolymorphicSerializationStyle;
set => Settings.CSharpGeneratorSettings.JsonPolymorphicSerializationStyle = value;
}

[Argument(Name = "GenerateDefaultValues", IsRequired = false, Description = "Specifies whether to generate default values for properties (may generate CSharp 6 code, default: true).")]
Expand Down
4 changes: 2 additions & 2 deletions src/NSwag.Sample.NET80Minimal/nswag.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"dictionaryBaseType": "System.Collections.Generic.Dictionary",
"classStyle": "Poco",
"jsonLibrary": "NewtonsoftJson",
"jsonPolymorphicSerializationStyle": "NSwag",
"jsonPolymorphicSerializationStyle": "NJsonSchema",
"generateDefaultValues": true,
"generateDataAnnotations": true,
"excludedTypeNames": [],
Expand Down Expand Up @@ -207,7 +207,7 @@
"dictionaryBaseType": "System.Collections.Generic.Dictionary",
"classStyle": "Poco",
"jsonLibrary": "NewtonsoftJson",
"jsonPolymorphicSerializationStyle": "NSwag",
"jsonPolymorphicSerializationStyle": "NJsonSchema",
"generateDefaultValues": true,
"generateDataAnnotations": true,
"excludedTypeNames": [],
Expand Down
4 changes: 2 additions & 2 deletions src/NSwag.Sample.NET90Minimal/nswag.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"dictionaryBaseType": "System.Collections.Generic.Dictionary",
"classStyle": "Poco",
"jsonLibrary": "NewtonsoftJson",
"jsonPolymorphicSerializationStyle": "NSwag",
"jsonPolymorphicSerializationStyle": "NJsonSchema",
"generateDefaultValues": true,
"generateDataAnnotations": true,
"excludedTypeNames": [],
Expand Down Expand Up @@ -207,7 +207,7 @@
"dictionaryBaseType": "System.Collections.Generic.Dictionary",
"classStyle": "Poco",
"jsonLibrary": "NewtonsoftJson",
"jsonPolymorphicSerializationStyle": "NSwag",
"jsonPolymorphicSerializationStyle": "NJsonSchema",
"generateDefaultValues": true,
"generateDataAnnotations": true,
"excludedTypeNames": [],
Expand Down
Loading