-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[http-client-csharp]: Don't include custom required literal propertie…
…s in public ctor (#4783) This PR addresses an issue where required spec properties that were literals and then customized to another literal type were being incorrectly included in the public constructor. fixes: #4747
- Loading branch information
1 parent
a689659
commit f1bfe9c
Showing
4 changed files
with
130 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...odelCustomizationTests/DoesNotIncludeReqCustomFieldLiteralInDefaultCtor/MockInputModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Microsoft.Generator.CSharp.Customization; | ||
|
||
namespace Sample.Models; | ||
|
||
public partial class MockInputModel | ||
{ | ||
[CodeGenMember("Prop1")] | ||
private string _prop1 = "bar"; | ||
} |
14 changes: 14 additions & 0 deletions
14
...ata/ModelCustomizationTests/DoesNotIncludeReqCustomLiteralInDefaultCtor/MockInputModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Microsoft.Generator.CSharp.Customization; | ||
|
||
namespace Sample.Models; | ||
|
||
public partial class MockInputModel | ||
{ | ||
[CodeGenMember("Prop1")] | ||
public CustomEnum Prop1 { get; } = CustomEnum.Bar; | ||
} | ||
|
||
public enum CustomEnum | ||
{ | ||
Bar | ||
} |