UNPKG

@redocly/openapi-core

Version:

See https://github.com/Redocly/redocly-cli

21 lines 1.11 kB
export const NoMixedNumberRangeConstraints = () => { return { Schema(schema, { report, location }) { if (typeof schema.maximum === 'number' && typeof schema.exclusiveMaximum === 'number') { report({ message: 'Schema should not have both `maximum` and `exclusiveMaximum`. Use one or the other.', location: location.child(['exclusiveMaximum']).key(), reference: 'https://redocly.com/docs/cli/rules/common/no-mixed-number-range-constraints', }); } if (typeof schema.minimum === 'number' && typeof schema.exclusiveMinimum === 'number') { report({ message: 'Schema should not have both `minimum` and `exclusiveMinimum`. Use one or the other.', location: location.child(['exclusiveMinimum']).key(), reference: 'https://redocly.com/docs/cli/rules/common/no-mixed-number-range-constraints', }); } }, }; }; //# sourceMappingURL=no-mixed-number-range-constraints.js.map