diff --git a/Directory.Build.props b/Directory.Build.props index 4c9436cab..f54f3367d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 14.6.3 + 14.7.0 Rico Suter Copyright © Rico Suter, 2025 diff --git a/Directory.Packages.props b/Directory.Packages.props index bd91ee6bd..24de1c4b5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,14 +21,14 @@ - + - - - - - - + + + + + + diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationBasePathTests.When_custom_BasePath_is_not_specified_then_the_BasePath_from_document_is_used_as_Route.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationBasePathTests.When_custom_BasePath_is_not_specified_then_the_BasePath_from_document_is_used_as_Route.verified.txt index 47688d55c..3b4f103d0 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationBasePathTests.When_custom_BasePath_is_not_specified_then_the_BasePath_from_document_is_used_as_Route.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationBasePathTests.When_custom_BasePath_is_not_specified_then_the_BasePath_from_document_is_used_as_Route.verified.txt @@ -17,7 +17,6 @@ namespace MyNamespace } [Microsoft.AspNetCore.Mvc.Route("virtual_directory/v1")] - public partial class Controller : Microsoft.AspNetCore.Mvc.ControllerBase { private IController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationBasePathTests.When_custom_BasePath_is_specified_then_that_is_used_as_Route.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationBasePathTests.When_custom_BasePath_is_specified_then_that_is_used_as_Route.verified.txt index 149a155b5..7a12bc371 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationBasePathTests.When_custom_BasePath_is_specified_then_that_is_used_as_Route.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationBasePathTests.When_custom_BasePath_is_specified_then_that_is_used_as_Route.verified.txt @@ -17,7 +17,6 @@ namespace MyNamespace } [Microsoft.AspNetCore.Mvc.Route("v1")] - public partial class Controller : Microsoft.AspNetCore.Mvc.ControllerBase { private IController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationDefaultParameterTests.When_parameter_has_default_then_set_in_partial_controller.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationDefaultParameterTests.When_parameter_has_default_then_set_in_partial_controller.verified.txt index f13501d8d..2a69c6cb1 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationDefaultParameterTests.When_parameter_has_default_then_set_in_partial_controller.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Controllers/Snapshots/ControllerGenerationDefaultParameterTests.When_parameter_has_default_then_set_in_partial_controller.verified.txt @@ -17,7 +17,6 @@ namespace MyNamespace } - public partial class Controller : Microsoft.AspNetCore.Mvc.ControllerBase { private IController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_body_is_binary_array_then_IFormFile_Collection_is_used_as_parameter_in_CSharp_ASPNETCore.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_body_is_binary_array_then_IFormFile_Collection_is_used_as_parameter_in_CSharp_ASPNETCore.verified.txt index ebbe12986..12b9e19fe 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_body_is_binary_array_then_IFormFile_Collection_is_used_as_parameter_in_CSharp_ASPNETCore.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_body_is_binary_array_then_IFormFile_Collection_is_used_as_parameter_in_CSharp_ASPNETCore.verified.txt @@ -14,7 +14,6 @@ namespace MyNamespace } - public partial class Controller : Microsoft.AspNetCore.Mvc.ControllerBase { private IController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_body_is_binary_then_IFormFile_is_used_as_parameter_in_CSharp_ASPNETCore.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_body_is_binary_then_IFormFile_is_used_as_parameter_in_CSharp_ASPNETCore.verified.txt index 577494096..dc30c6bf8 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_body_is_binary_then_IFormFile_is_used_as_parameter_in_CSharp_ASPNETCore.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_body_is_binary_then_IFormFile_is_used_as_parameter_in_CSharp_ASPNETCore.verified.txt @@ -14,7 +14,6 @@ namespace MyNamespace } - public partial class Controller : Microsoft.AspNetCore.Mvc.ControllerBase { private IController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_response_body_is_binary_then_IActionResult_is_used_as_return_type_in_CSharp_ASPNETCore.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_response_body_is_binary_then_IActionResult_is_used_as_return_type_in_CSharp_ASPNETCore.verified.txt index 12dd88f35..2bbe76805 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_response_body_is_binary_then_IActionResult_is_used_as_return_type_in_CSharp_ASPNETCore.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/BinaryTests.When_response_body_is_binary_then_IActionResult_is_used_as_return_type_in_CSharp_ASPNETCore.verified.txt @@ -4,7 +4,6 @@ namespace MyNamespace { using System = global::System; - public abstract class ControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase { [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route("logo")] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_aspnet_actiontype_inuse_with_abstract_then_actiontype_is_generated.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_aspnet_actiontype_inuse_with_abstract_then_actiontype_is_generated.verified.txt index 14f547158..f348b2c36 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_aspnet_actiontype_inuse_with_abstract_then_actiontype_is_generated.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_aspnet_actiontype_inuse_with_abstract_then_actiontype_is_generated.verified.txt @@ -4,7 +4,6 @@ namespace MyNamespace { using System = global::System; - public abstract class TestControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase { [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route("Foo")] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_aspnet_actiontype_inuse_with_partial_then_actiontype_is_generated.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_aspnet_actiontype_inuse_with_partial_then_actiontype_is_generated.verified.txt index 362befa9c..6cb4f9756 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_aspnet_actiontype_inuse_with_partial_then_actiontype_is_generated.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_aspnet_actiontype_inuse_with_partial_then_actiontype_is_generated.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_complextype_then_abstractcontroller_is_generated_with_frombody_attribute.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_complextype_then_abstractcontroller_is_generated_with_frombody_attribute.verified.txt index 4d4dffebc..cbd928949 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_complextype_then_abstractcontroller_is_generated_with_frombody_attribute.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_complextype_then_abstractcontroller_is_generated_with_frombody_attribute.verified.txt @@ -4,7 +4,6 @@ namespace MyNamespace { using System = global::System; - public abstract class TestControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase { [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route("Foo")] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_complextype_then_partialcontroller_is_generated_with_frombody_attribute.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_complextype_then_partialcontroller_is_generated_with_frombody_attribute.verified.txt index 02b329766..393129632 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_complextype_then_partialcontroller_is_generated_with_frombody_attribute.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_complextype_then_partialcontroller_is_generated_with_frombody_attribute.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_header_parameter_then_partialcontroller_is_generated_with_fromheader_attribute.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_header_parameter_then_partialcontroller_is_generated_with_fromheader_attribute.verified.txt index 88afe0705..0da6bcffc 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_header_parameter_then_partialcontroller_is_generated_with_fromheader_attribute.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operation_with_header_parameter_then_partialcontroller_is_generated_with_fromheader_attribute.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : System.Web.Http.ApiController { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operations_with_required_parameters_then_abstractcontroller_is_generated_with_bindrequired_attribute.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operations_with_required_parameters_then_abstractcontroller_is_generated_with_bindrequired_attribute.verified.txt index fec5a180c..90f902771 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operations_with_required_parameters_then_abstractcontroller_is_generated_with_bindrequired_attribute.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operations_with_required_parameters_then_abstractcontroller_is_generated_with_bindrequired_attribute.verified.txt @@ -4,7 +4,6 @@ namespace MyNamespace { using System = global::System; - public abstract class TestControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase { [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route("Foo")] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operations_with_required_parameters_then_partialcontroller_is_generated_with_bindrequired_attribute.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operations_with_required_parameters_then_partialcontroller_is_generated_with_bindrequired_attribute.verified.txt index d3445f21f..65a96e9ca 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operations_with_required_parameters_then_partialcontroller_is_generated_with_bindrequired_attribute.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controller_has_operations_with_required_parameters_then_partialcontroller_is_generated_with_bindrequired_attribute.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_abstract_then_abstractcontroller_is_generated.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_abstract_then_abstractcontroller_is_generated.verified.txt index 4d4dffebc..cbd928949 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_abstract_then_abstractcontroller_is_generated.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_abstract_then_abstractcontroller_is_generated.verified.txt @@ -4,7 +4,6 @@ namespace MyNamespace { using System = global::System; - public abstract class TestControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase { [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route("Foo")] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_notsetted_then_partialcontroller_is_generated.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_notsetted_then_partialcontroller_is_generated.verified.txt index 02b329766..393129632 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_notsetted_then_partialcontroller_is_generated.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_notsetted_then_partialcontroller_is_generated.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_partial_then_partialcontroller_is_generated.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_partial_then_partialcontroller_is_generated.verified.txt index 02b329766..393129632 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_partial_then_partialcontroller_is_generated.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllergenerationformat_partial_then_partialcontroller_is_generated.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllerroutenamingstrategy_none_then_route_attribute_name_not_specified.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllerroutenamingstrategy_none_then_route_attribute_name_not_specified.verified.txt index 02b329766..393129632 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllerroutenamingstrategy_none_then_route_attribute_name_not_specified.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllerroutenamingstrategy_none_then_route_attribute_name_not_specified.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllerroutenamingstrategy_operationid_then_route_attribute_name_specified.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllerroutenamingstrategy_operationid_then_route_attribute_name_specified.verified.txt index 3e8eb532b..2ea0fa32c 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllerroutenamingstrategy_operationid_then_route_attribute_name_specified.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllerroutenamingstrategy_operationid_then_route_attribute_name_specified.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllertarget_aspnet_and_multiple_controllers_then_only_single_custom_fromheader_generated.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllertarget_aspnet_and_multiple_controllers_then_only_single_custom_fromheader_generated.verified.txt index 7bc9eb1d4..bb0a671d8 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllertarget_aspnet_and_multiple_controllers_then_only_single_custom_fromheader_generated.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllertarget_aspnet_and_multiple_controllers_then_only_single_custom_fromheader_generated.verified.txt @@ -4,7 +4,6 @@ namespace MyNamespace { using System = global::System; - public abstract class ControllerBase : System.Web.Http.ApiController { [System.Web.Http.HttpGet, System.Web.Http.Route("Foo")] @@ -27,7 +26,6 @@ namespace MyNamespace } - public abstract class SecondaryControllerBase : System.Web.Http.ApiController { [System.Web.Http.HttpPost, System.Web.Http.Route("HeaderParamRequired")] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllertarget_aspnetcore_then_use_builtin_fromheader.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllertarget_aspnetcore_then_use_builtin_fromheader.verified.txt index 02b329766..393129632 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllertarget_aspnetcore_then_use_builtin_fromheader.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_controllertarget_aspnetcore_then_use_builtin_fromheader.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_the_generation_of_dto_classes_are_disabled_then_file_is_generated_without_any_dto_clasess.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_the_generation_of_dto_classes_are_disabled_then_file_is_generated_without_any_dto_clasess.verified.txt index d21241498..750ce0e3e 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_the_generation_of_dto_classes_are_disabled_then_file_is_generated_without_any_dto_clasess.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/ControllerGenerationFormatTests.When_the_generation_of_dto_classes_are_disabled_then_file_is_generated_without_any_dto_clasess.verified.txt @@ -32,7 +32,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added.verified.txt index b4cc05cbe..d34a0f76a 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added.verified.txt @@ -4,7 +4,6 @@ namespace MyNamespace { using System = global::System; - public abstract class TestControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase { [Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route("Foo")] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added.verified.txt index b4cc05cbe..d34a0f76a 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added.verified.txt @@ -4,7 +4,6 @@ namespace MyNamespace { using System = global::System; - public abstract class TestControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase { [Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route("Foo")] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added.verified.txt index b4f65b4da..8aa438c10 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added.verified.txt @@ -16,7 +16,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added.verified.txt index b4f65b4da..8aa438c10 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added.verified.txt @@ -16,7 +16,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_usecancellationtokenparameter_notsetted_then_cancellationtoken_isnot_added.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_usecancellationtokenparameter_notsetted_then_cancellationtoken_isnot_added.verified.txt index 5f1b29601..8e83368da 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_usecancellationtokenparameter_notsetted_then_cancellationtoken_isnot_added.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseCancellationTokenTests.When_usecancellationtokenparameter_notsetted_then_cancellationtoken_isnot_added.verified.txt @@ -4,7 +4,6 @@ namespace MyNamespace { using System = global::System; - public abstract class TestControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase { [Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route("Foo")] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt index 61bdb9e13..34ee1e49b 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt @@ -260,7 +260,8 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] public string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt index 61bdb9e13..34ee1e49b 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt @@ -260,7 +260,8 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] public string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_keyword_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_keyword_should_generate_with_required_keyword.verified.txt index 61bdb9e13..34ee1e49b 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_keyword_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_disabled_properties_with_required_keyword_should_generate_with_required_keyword.verified.txt @@ -260,7 +260,8 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] public string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_enabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_enabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt index a1205e8a6..581951ec7 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_enabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_enabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt @@ -260,8 +260,9 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public required int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string RequiredByC11Keyword { get; set; } + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public required string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_enabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_enabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt index a1205e8a6..581951ec7 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_enabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordNewtonsoftJsonSchemaGeneratorTests.When_setting_is_enabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt @@ -260,8 +260,9 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public required int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string RequiredByC11Keyword { get; set; } + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public required string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt index f75e435b1..f4d74b16a 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt @@ -260,7 +260,8 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] public string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt index f75e435b1..f4d74b16a 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt @@ -260,7 +260,8 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] public string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_keyword_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_keyword_should_generate_with_required_keyword.verified.txt index f75e435b1..f4d74b16a 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_keyword_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_disabled_properties_with_required_keyword_should_generate_with_required_keyword.verified.txt @@ -260,7 +260,8 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] public string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_enabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_enabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt index 1d8c4f248..24f6ecf7d 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_enabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_enabled_properties_with_required_attribute_should_generate_with_required_keyword.verified.txt @@ -260,8 +260,9 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public required int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string RequiredByC11Keyword { get; set; } + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public required string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_enabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_enabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt index 1d8c4f248..24f6ecf7d 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_enabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/UseRequiredKeywordSystemTextJsonSchemaGeneratorSettingsTests.When_setting_is_enabled_properties_with_required_keyword_and_attribute_should_generate_with_required_keyword.verified.txt @@ -260,8 +260,9 @@ namespace MyNamespace [Newtonsoft.Json.JsonProperty("RequiredByAttribute", Required = Newtonsoft.Json.Required.Always)] public required int RequiredByAttribute { get; set; } - [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string RequiredByC11Keyword { get; set; } + [Newtonsoft.Json.JsonProperty("RequiredByC11Keyword", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public required string RequiredByC11Keyword { get; set; } [Newtonsoft.Json.JsonProperty("RequiredByAttributeAndC11Keyword", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/WrapResponsesTests.When_success_responses_are_wrapped_then_SwaggerResponse_is_returned_web_api.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/WrapResponsesTests.When_success_responses_are_wrapped_then_SwaggerResponse_is_returned_web_api.verified.txt index ee3650443..2e5ed197a 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/WrapResponsesTests.When_success_responses_are_wrapped_then_SwaggerResponse_is_returned_web_api.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/WrapResponsesTests.When_success_responses_are_wrapped_then_SwaggerResponse_is_returned_web_api.verified.txt @@ -14,7 +14,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/WrapResponsesTests.When_success_responses_are_wrapped_then_SwaggerResponse_is_returned_web_api_aspnetcore.verified.txt b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/WrapResponsesTests.When_success_responses_are_wrapped_then_SwaggerResponse_is_returned_web_api_aspnetcore.verified.txt index ee3650443..2e5ed197a 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/WrapResponsesTests.When_success_responses_are_wrapped_then_SwaggerResponse_is_returned_web_api_aspnetcore.verified.txt +++ b/src/NSwag.CodeGeneration.CSharp.Tests/Snapshots/WrapResponsesTests.When_success_responses_are_wrapped_then_SwaggerResponse_is_returned_web_api_aspnetcore.verified.txt @@ -14,7 +14,6 @@ namespace MyNamespace } - public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase { private ITestController _implementation; diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET100Minimal_targetFramework=net10.0_generatesCode=True.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET100Minimal_targetFramework=net10.0_generatesCode=True.verified.txt index 1ec4233cd..9fa049105 100644 --- a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET100Minimal_targetFramework=net10.0_generatesCode=True.verified.txt +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET100Minimal_targetFramework=net10.0_generatesCode=True.verified.txt @@ -43,7 +43,6 @@ namespace MyNamespace } [System.CodeDom.Compiler.GeneratedCode("NSwag", "")] - public partial class Controller : Microsoft.AspNetCore.Mvc.ControllerBase { private IController _implementation; @@ -92,7 +91,6 @@ namespace MyNamespace } [System.CodeDom.Compiler.GeneratedCode("NSwag", "")] - public partial class ExampleController : Microsoft.AspNetCore.Mvc.ControllerBase { private IExampleController _implementation; diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET100_targetFramework=net10.0_generatesCode=True.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET100_targetFramework=net10.0_generatesCode=True.verified.txt index eda97ee62..cb6f29058 100644 --- a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET100_targetFramework=net10.0_generatesCode=True.verified.txt +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET100_targetFramework=net10.0_generatesCode=True.verified.txt @@ -52,7 +52,6 @@ namespace MyNamespace } [System.CodeDom.Compiler.GeneratedCode("NSwag", "")] - public partial class ValuesController : Microsoft.AspNetCore.Mvc.ControllerBase { private IValuesController _implementation; diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET80Minimal_targetFramework=net8.0_generatesCode=True.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET80Minimal_targetFramework=net8.0_generatesCode=True.verified.txt index 1ec4233cd..9fa049105 100644 --- a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET80Minimal_targetFramework=net8.0_generatesCode=True.verified.txt +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET80Minimal_targetFramework=net8.0_generatesCode=True.verified.txt @@ -43,7 +43,6 @@ namespace MyNamespace } [System.CodeDom.Compiler.GeneratedCode("NSwag", "")] - public partial class Controller : Microsoft.AspNetCore.Mvc.ControllerBase { private IController _implementation; @@ -92,7 +91,6 @@ namespace MyNamespace } [System.CodeDom.Compiler.GeneratedCode("NSwag", "")] - public partial class ExampleController : Microsoft.AspNetCore.Mvc.ControllerBase { private IExampleController _implementation; diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET80_targetFramework=net8.0_generatesCode=True.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET80_targetFramework=net8.0_generatesCode=True.verified.txt index 78ad1db06..254c651e9 100644 --- a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET80_targetFramework=net8.0_generatesCode=True.verified.txt +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET80_targetFramework=net8.0_generatesCode=True.verified.txt @@ -55,7 +55,6 @@ namespace MyNamespace } [System.CodeDom.Compiler.GeneratedCode("NSwag", "")] - public partial class ValuesController : Microsoft.AspNetCore.Mvc.ControllerBase { private IValuesController _implementation; diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt index 1ec4233cd..9fa049105 100644 --- a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt @@ -43,7 +43,6 @@ namespace MyNamespace } [System.CodeDom.Compiler.GeneratedCode("NSwag", "")] - public partial class Controller : Microsoft.AspNetCore.Mvc.ControllerBase { private IController _implementation; @@ -92,7 +91,6 @@ namespace MyNamespace } [System.CodeDom.Compiler.GeneratedCode("NSwag", "")] - public partial class ExampleController : Microsoft.AspNetCore.Mvc.ControllerBase { private IExampleController _implementation; diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90_targetFramework=net9.0_generatesCode=True.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90_targetFramework=net9.0_generatesCode=True.verified.txt index eda97ee62..cb6f29058 100644 --- a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90_targetFramework=net9.0_generatesCode=True.verified.txt +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90_targetFramework=net9.0_generatesCode=True.verified.txt @@ -52,7 +52,6 @@ namespace MyNamespace } [System.CodeDom.Compiler.GeneratedCode("NSwag", "")] - public partial class ValuesController : Microsoft.AspNetCore.Mvc.ControllerBase { private IValuesController _implementation; diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.cs b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.cs index 1f1487cf7..8a3b95757 100644 --- a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.cs +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.cs @@ -49,20 +49,25 @@ public async Task Should_generate_openapi_for_project(string projectName, string } }); + // Read stdout/stderr asynchronously to avoid deadlock when pipe buffers fill up + var outputTask = process.StandardOutput.ReadToEndAsync(); + var errorTask = process.StandardError.ReadToEndAsync(); + try { - process.WaitForExit(20000); + process.WaitForExit(60000); } finally { process.Kill(); } + var output = await outputTask; + var error = await errorTask; + // Assert if (process.ExitCode != 0) { - var output = await process.StandardOutput.ReadToEndAsync(); - var error = await process.StandardError.ReadToEndAsync(); Assert.Fail(output + error); }