Skip to content

Commit

Permalink
Remove description from OpenApiResponse when serializing for Swagger …
Browse files Browse the repository at this point in the history
…v2 (#4314)

* Remove description from OpenApiResponse when serializing for Swagger v2 to prevent error "Structural error at paths.somepath.get.responses.304 should NOT have additional properties additionalProperty: description" [PR].

* Remove description from OpenApiResponse when serializing for Swagger v2 to prevent error "Structural error at paths.somepath.get.responses.304 should NOT have additional properties additionalProperty: description" [PR].
  • Loading branch information
PatrickHofman authored Jan 17, 2023
1 parent 7767e71 commit 3ee148a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public void When_response_schema_and_example_is_set_then_it_is_serialized_correc
""operationId"": ""foo"",
""responses"": {
""200"": {
""description"": """",
""schema"": {
""type"": ""string""
},
Expand Down Expand Up @@ -93,7 +92,6 @@ public void When_response_schema_and_example_is_set_as_file_then_it_is_serialize
""operationId"": ""foo"",
""responses"": {
""200"": {
""description"": """",
""schema"": {
""type"": ""file""
},
Expand Down
1 change: 1 addition & 0 deletions src/NSwag.Core/OpenApiDocument.Serialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ private static PropertyRenameAndIgnoreSerializerContractResolver CreateJsonSeria
resolver.IgnoreProperty(typeof(OpenApiParameter), "x-position");

resolver.IgnoreProperty(typeof(OpenApiResponse), "content");
resolver.IgnoreProperty(typeof(OpenApiResponse), "description");
resolver.IgnoreProperty(typeof(OpenApiResponse), "links");

resolver.IgnoreProperty(typeof(OpenApiSecurityScheme), "scheme");
Expand Down

0 comments on commit 3ee148a

Please sign in to comment.