Repository navigation
Fix V2 parameter deserializer to recognize formData instead of form - #155
Conversation
PerthCharern
commented
Dec 15, 2017
- Fix V2 parameter deserializer to recognize formData instead of form
- Basic unit tests for all types of possible parameters in V2.
- Basic unit tests for 5 types of possible parameters in V2.
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| <None Update="V2Tests\Samples\OpenApiParameter\formDataParameter.yaml"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
There was a problem hiding this comment.
Can we embed this files with the test.dll?
There was a problem hiding this comment.
I'm not sure about the pros and cons of this. Darrel (@darrelmiller) also pointed this out earlier.
What's the disadvantage of not embedding a test file?
There was a problem hiding this comment.
PerthCharern It just means you have to carry those files around to make the tests work. If they are embedded in the DLL then the tests are self-contained.
There was a problem hiding this comment.
I think I understand the concerns now. At first I thought using a non-embedded resource with relative path should work, but that might not be the case since the test assembly can technically be run from anywhere.
Let's make this change in a separate PR for all resources.
| { | ||
| using (var stream = File.OpenRead(Path.Combine(SampleFolderPath, "bodyParameter.yaml"))) | ||
| { | ||
| var yamlStream = new YamlStream(); |
| @@ -0,0 +1,10 @@ | |||
| # https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject | |||
There was a problem hiding this comment.
Do we include this line?
There was a problem hiding this comment.
I think we should point to the source we took the YAML files from.
| { | ||
| var yamlStream = new YamlStream(); | ||
| yamlStream.Load(new StreamReader(stream)); | ||
| var yamlNode = yamlStream.Documents.First().RootNode; |
There was a problem hiding this comment.
A lot of codes are duplicated. Think to add a private method to wrapper?
There was a problem hiding this comment.
I'll look into this now.
|
Darrel (@darrelmiller) Sam Xu (@xuzhg) I'll take care of embedding the all test files in a separate PR. Please let me know if you guys have more comments about the changes here. |