fix(spec-selector): isMediaTypeSchemaPropertiesEqual should handle case where literal media-types are equal. (#6820)

* fix(spec-selector): isMediaTypeSchemaPropertiesEqual case same

should return true in case of comparing same media types.

* test(spec-selector): isMediaTypeSchemaPropertiesEqual tests
This commit is contained in:
Mahtis Michel
2021-01-13 03:31:51 +01:00
committed by GitHub
parent 35cb92502a
commit 25433c4864
2 changed files with 169 additions and 1 deletions

View File

@@ -515,6 +515,9 @@ export const getOAS3RequiredRequestBodyContentType = (state, pathMethod) => {
}
export const isMediaTypeSchemaPropertiesEqual = ( state, pathMethod, currentMediaType, targetMediaType) => {
if((currentMediaType || targetMediaType) && currentMediaType === targetMediaType ) {
return true
}
let requestBodyContent = state.getIn(["resolvedSubtrees", "paths", ...pathMethod, "requestBody", "content"], fromJS([]))
if (requestBodyContent.size < 2 || !currentMediaType || !targetMediaType) {
// nothing to compare