Skip to content

Commit 3c75048

Browse files
committed
chore: add more refs
1 parent 3b824f0 commit 3c75048

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/core/src/rules/common/__tests__/no-identical-paths.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ describe('no-identical-paths', () => {
5050
},
5151
],
5252
"message": "The path already exists which differs only by path parameter name(s): \`/good/{id}\` and \`/good/{hash}\`.",
53+
"reference": "https://redocly.com/docs/cli/rules/oas/no-identical-paths",
5354
"ruleId": "no-identical-paths",
5455
"severity": "error",
5556
"suggest": [],

packages/core/src/rules/common/no-identical-paths.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const NoIdenticalPaths: Oas3Rule | Oas2Rule = () => {
1414
report({
1515
message: `The path already exists which differs only by path parameter name(s): \`${existingSamePath}\` and \`${pathName}\`.`,
1616
location: location.child([pathName]).key(),
17+
reference: 'https://redocly.com/docs/cli/rules/oas/no-identical-paths',
1718
});
1819
} else {
1920
Paths.set(id, pathName);

packages/core/src/rules/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ export function validateDefinedAndNonEmpty({
103103
ctx.report({
104104
message: missingRequiredField(ctx.type.name, fieldName),
105105
location: ctx.location.child([fieldName]).key(),
106-
...(reference !== undefined ? { reference } : {}),
106+
reference,
107107
});
108108
} else if (!value[fieldName]) {
109109
ctx.report({
110110
message: fieldNonEmpty(ctx.type.name, fieldName),
111111
location: ctx.location.child([fieldName]).key(),
112-
...(reference !== undefined ? { reference } : {}),
112+
reference,
113113
});
114114
}
115115
}
@@ -132,15 +132,15 @@ export function validateOneOfDefinedAndNonEmpty({
132132
ctx.report({
133133
message: missingRequiredOneOfFields(ctx.type.name, fieldNames),
134134
location: ctx.location.key(),
135-
...(reference !== undefined ? { reference } : {}),
135+
reference,
136136
});
137137
}
138138
for (const fieldName of fieldNames) {
139139
if (value.hasOwnProperty(fieldName) && !value[fieldName]) {
140140
ctx.report({
141141
message: fieldNonEmpty(ctx.type.name, fieldName),
142142
location: ctx.location.child([fieldName]).key(),
143-
...(reference !== undefined ? { reference } : {}),
143+
reference,
144144
});
145145
}
146146
}

0 commit comments

Comments
 (0)