Skip to content

Commit 0b1f8fa

Browse files
reusable enum schemas
1 parent 6bff9a4 commit 0b1f8fa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/spectral/ipa/__tests__/IPA123EnumValuesShouldNotExceed20.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ testRule('xgen-IPA-123-allowable-enum-values-should-not-exceed-20', [
100100
errors: [
101101
{
102102
code: 'xgen-IPA-123-allowable-enum-values-should-not-exceed-20',
103-
message: 'Enum arrays should not exceed 20 values. Current count: 21',
103+
message: 'Inline enum arrays should not exceed 20 values. Current count: 21',
104104
path: ['components', 'schemas', 'TestSchema', 'properties', 'status', 'enum'],
105105
severity: DiagnosticSeverity.Warning,
106106
},
@@ -172,7 +172,7 @@ testRule('xgen-IPA-123-allowable-enum-values-should-not-exceed-20', [
172172
errors: [
173173
{
174174
code: 'xgen-IPA-123-allowable-enum-values-should-not-exceed-20',
175-
message: 'Enum arrays should not exceed 20 values. Current count: 21',
175+
message: 'Inline enum arrays should not exceed 20 values. Current count: 21',
176176
path: ['components', 'schemas', 'TestSchema', 'properties', 'priority', 'enum'],
177177
severity: DiagnosticSeverity.Warning,
178178
},
@@ -245,7 +245,7 @@ testRule('xgen-IPA-123-allowable-enum-values-should-not-exceed-20', [
245245
errors: [
246246
{
247247
code: 'xgen-IPA-123-allowable-enum-values-should-not-exceed-20',
248-
message: 'Enum arrays should not exceed 20 values. Current count: 21',
248+
message: 'Inline enum arrays should not exceed 20 values. Current count: 21',
249249
path: ['paths', '/resources', 'get', 'parameters', '0', 'schema', 'enum'],
250250
severity: DiagnosticSeverity.Warning,
251251
},

tools/spectral/ipa/rulesets/functions/IPA123EnumValuesShouldNotExceed20.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getSchemaPathFromEnumPath } from './utils/schemaUtils.js';
44
import { resolveObject } from './utils/componentUtils.js';
55

66
const RULE_NAME = 'xgen-IPA-123-allowable-enum-values-should-not-exceed-20';
7-
const ERROR_MESSAGE = 'Enum arrays should not exceed 20 values. Current count: ';
7+
const ERROR_MESSAGE = 'Inline enum arrays should not exceed 20 values. Current count: ';
88
const MAX_ENUM_VALUES = 20;
99

1010
export default (input, options, { path, documentInventory }) => {

0 commit comments

Comments
 (0)