You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
OpenApiOperation copy constructor: public OpenApiOperation(OpenApiOperation operation) changes a null in the RequestBody into an object instance.
To Reproduce
varoperation=new OpenApiOperation();//operation.RequestBody = null is the defaultvarcopiedOperation=new OpenApiOperation(operation);
copiedOperation.RequestBody is an new OpenApiRequestBody.
Expected behavior copiedOperation.RequestBody should also be null, as on the source object.
Fixesmicrosoft#1192
- Fix OpenApiOperation RequestBody and Tags null is not preserved
- Add tests for null preserving null on copy constructor
- Add tests for copy constructor serialization result to be equal
- Fix OpenApiParameter object changes during serialization, so that the serialization result is on consecutive run the same.
Describe the bug
OpenApiOperation copy constructor:
public OpenApiOperation(OpenApiOperation operation)
changes anull
in theRequestBody
into an object instance.To Reproduce
copiedOperation.RequestBody
is annew OpenApiRequestBody
.Expected behavior
copiedOperation.RequestBody
should also be null, as on the source object.OpenAPI.NET/src/Microsoft.OpenApi/Models/OpenApiOperation.cs
Lines 117 to 132 in db02b95
I could provide a PR to fix this.
The text was updated successfully, but these errors were encountered: