Modify the serialization for each element#41
Modify the serialization for each element#41xuzhg wants to merge 1 commit intomicrosoft:masterfrom xuzhg:OpenApiSerialization
Conversation
xuzhg
commented
Oct 26, 2017
- add the extension methods for each element.
- remove OpenApiV2(3)Writer
- remove OpenApiV2(3)Serializer
- Add some Unit test.
- All other tests pass
1. add the extension methods for each element. 2. remove OpenApiV2(3)Writer 3. remove OpenApiV2(3)Serializer 4. Add some Unit test. 5. All other tests pass
| /// <summary> | ||
| /// Extensions method for <see cref="OpenApiCallback"/> serialization. | ||
| /// </summary> | ||
| internal static class OpenApiCallbackExtensions |
There was a problem hiding this comment.
OpenApiCallbackExtensions [](start = 26, length = 25)
I like it that we are finally separating out these Serialize methods into their own classes, instead of one giant serializer.
I'm reading through this, but at first glance, I wonder this: Is it beneficial to have these as Extension methods? Have you considered putting the methods directly into the models?
There was a problem hiding this comment.
:) I am working the whole morning to covert it to as you said.
There was a problem hiding this comment.
The PR is almost ready.
There was a problem hiding this comment.
Sorry for missing this, I was flying all day Friday. I guess we can discuss this further at our meeting today.
| { | ||
| ""description"": ""Find more info here"", | ||
| ""url"": ""https://example.com"" | ||
| }"; |
There was a problem hiding this comment.
Once we have more of these tests (which I think we should in order to test the whole serialization), this literal string is going to be very distracting.
I suggest we read this from a file.
There was a problem hiding this comment.
What I am thinking is that the Unit test can test every small part individually.
for example, we can test the "OpenApiTag" serialization individually, same as the "OpenApiDocument".
But, I will do a little bit small changes in the coming PR.
There was a problem hiding this comment.
That sounds like a good idea. This is fine then. I'd say we should still have at least a couple of test that verify that the overall serialization works well.
These booleans are kinda funny. I'd rather make format and version a public property with getter and setter. Refers to: src/Microsoft.OpenApi.Workbench/MainModel.cs:65 in 6884b00. [](commit_id = 6884b00, deletion_comment = False) |
|
As we discussed today to take the #42, so close it. |