-
Notifications
You must be signed in to change notification settings - Fork 187
Description
Describe the bug
The linter is returning the error Example validation errored: exclusiveMinimum value must be ["number"], however in openapi 3.0.x exclusiveMinimum must be of type boolean, not number.
To Reproduce
Steps to reproduce the behavior:
- Given the following openapi file:
openapi: 3.0.2
info:
title: Example API v2
description: |-
An example API.
contact: {}
version: 2.0.0
paths:
/myPath:
get:
summary: my custom path
operationId: getMyPath
parameters:
- $ref: '#/components/parameters/a'
responses:
'200':
description: Response description
content:
application/json:
schema: {}
components:
parameters:
a:
name: a
in: header
description: Example
schema:
type: integer
minimum: 10
exclusiveMinimum: true
example: 11- And the lint configuration:
rules:
no-invalid-schema-examples: error-
Run this command
npx @redocly/cli lint openapi-example.yml --config openapi-example.conf.yml --format=stylish -
See error
(node:53722) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
validating /.../openapi-example.yml:
30:9 error no-invalid-schema-examples Example validation errored: exclusiveMinimum value must be ["number"].
openapi-example.yml: validated in 12ms
❌ Validation failed with 1 error.
run `redocly lint --generate-ignore-file` to add all problems to the ignore file.
Expected behavior
The validation pass, because in openapi 3.0.x exclusiveMinimum MUST be of type boolean and is defined correctly.
This is different in openapi 3.1.0, but the specification provided is for 3.0.2.
Redocly Version(s)
1.17.1
Node.js Version(s)
22.2.0
Additional context
Same issue is present using no-invalid-parameter-examples rule.
See also changes between 3.0.x and 3.1.0: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0