Skip to content

Conversation

@choipureum
Copy link
Contributor

related issue: #212

This PR uses the name by DataMemberAttribute as json serialization namingstrategy like JsonProperty.

  • Before
        [DataMember(Name = "DataMemberValue1")]
        public string DataMemberValue1 { get; set; }
          "dataMemberValue1": {
            "type": "string"
          },
  • After
        [DataMember(Name = "DataMemberValue1")]
        public string DataMemberValue1 { get; set; }
          "DataMemberValue1": {
            "type": "string"
          },

choipureum and others added 30 commits August 24, 2021 00:45
Signed-off-by: poo <[email protected]>
Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update! I've left some comments, mostly for the test cases.


namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.TestApp.Models
{
public class DataMemberObjectModel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create another class/file for JsonPropertyObjectModel for another test?

{
public class DataMemberObjectModel
{
[DataMember(Name = "DataMemberValue1")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're testing the property naming, can we set these property names in some weird ways like DAtAmeMBervALue1 so that it's rendered as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a variety of things.Thank you always for the reviews! 😊


namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.TestApp
{
public static class Get_ApplicationJson_DataMemberObject_HttpTrigger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create another one for Get_ApplicationJson_JsonPropertyObject_HttpTrigger?

{
[TestClass]
[TestCategory(Constants.TestCategory)]
public class Get_ApplicationJson_DataMember_Tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create another test class, Get_ApplicationJson_JsonProperty_Tests?

@choipureum choipureum requested a review from justinyoo October 12, 2021 23:52
@justinyoo justinyoo added oca-issue bug Something isn't working labels Oct 16, 2021
Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! LGTM

@justinyoo justinyoo merged commit 4b37b9e into Azure:main Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swagger Payload ignores [DataMember] name changes for json serialization.

2 participants