Skip to content

Commit 548bb02

Browse files
committed
feat: support classification of changes of OpenAPI specification extensions for tag object and external documentation for tag object
1 parent 49eac6f commit 548bb02

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/openapi/openapi3.rules.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,13 @@ export const openApi3Rules = (options: OpenApi3RulesOptions): CompareRules => {
416416
'/*': oAuthFlowObjectRules,
417417
}
418418

419+
const tagObjectCompareRules: CompareRules = {
420+
$: allAnnotation,
421+
'/externalDocs': externalDocumentationRules,
422+
...openApiSpecificationExtensionRules,
423+
'/*': { $: allAnnotation },
424+
}
425+
419426
const componentsRule: CompareRules = {
420427
$: allNonBreaking,
421428
[START_NEW_COMPARE_SCOPE_RULE]: COMPARE_SCOPE_COMPONENTS,
@@ -497,7 +504,10 @@ export const openApi3Rules = (options: OpenApi3RulesOptions): CompareRules => {
497504
$: globalSecurityClassifyRule,
498505
'/*': { $: globalSecurityItemClassifyRule },
499506
},
500-
'/tags': { $: allAnnotation },
507+
'/tags': {
508+
$: allAnnotation,
509+
'/*': tagObjectCompareRules,
510+
},
501511
'/externalDocs': externalDocumentationRules,
502512
}
503513
}

test/openapi.specificationExtensions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const operationObjectPaths: JsonPath[] = [
6161
]
6262

6363
const tagObjectPaths: JsonPath[] = [
64-
//['tags', 0], //Tag Object classification rules are not implemented yet
64+
['tags', 0],
6565
]
6666

6767
const responseObjectPaths: JsonPath[] = [

0 commit comments

Comments
 (0)