fix: handle deserializing and writing empty security requirements #1426 - #2323
Conversation
…crosoft#1426 make distinction between empty security requirements and no security requirements on an operation. empty security requirements are read as an empty list, no security requirements are read as null for OpenAPI v2/v3/v3.1. This is a breaking change, previously both cases were read as an empty list. also includes a change to OpenApiOperation.SerializeInternal so it can serialize these two cases separately. this required a new method OpenApiWriterExtensions.WriteOptionalOrEmptyCollection. includes unit tests, change to PublicApi.approved.txt to include the new method, and I removed a couple of unused usings and a typo in test name `SerializeDocWithSecuritySchemeWithInlineReferencesWorks`.
|
I will contact the right people at my work so I can sign the CLA, this will take some time. |
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
A couple of suggestions while we wait for the CLA.
|
@microsoft-github-policy-service agree company="Mendix" |
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
Maggie Kimani (@MaggieKimani1) for final review and merge
|
Paul Rijneveld @ Mendix (@paulmendix) can you please handle the conflict before we review another time? |
…ity-requirements-on-operation
|
Thanks. I addressed the conflict. Ready for final review Maggie Kimani (@MaggieKimani1) |
fix #1426.
make distinction between empty security requirements and no security requirements on an operation. empty security requirements are read as an empty list, no security requirements are read as null for OpenAPI v2/v3/v3.1. This is a breaking change, previously both cases were read as an empty list.
also includes a change to
OpenApiOperation.SerializeInternalso it can serialize these two cases separately. this required a new methodOpenApiWriterExtensions.WriteOptionalOrEmptyCollection.includes unit tests, change to PublicApi.approved.txt to include the new method, and I removed a couple of unused usings and a typo in test name
SerializeDocWithSecuritySchemeWithInlineReferencesWorks.