You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that examples in $.components.schemas are not validated if they are not referenced from a path.
Usually schemas are references from a path. However, x-tags allow to sometimes break this rule.
Observed behavior means that examples of those schemas are not validated which is unexpected and error prone.
To Reproduce
Steps to reproduce the behavior:
Given any redocly.yaml file
And this OpenAPI file(s)
openapi: 3.1.0
info:
title: any
version: 2024-03-15
tags:
- name: my-tag
description: any
components:
schemas:
MySchema:
x-tags:
- my-tag
required:
- id
properties:
id:
type: string
example:
not-id: "any"
Run this command with these arguments... redocly ...
redocly lint test.yaml
Observe that no warning was raised regarding the absent id property in the example.
validating /data/docs/events/test.yaml...
/data/docs/events/test.yaml: validated in 8ms
Woohoo! Your API description is valid. 🎉
Expected behavior
All examples should be linted.
Logs
OpenAPI description
Redocly Version(s): 1.9.0
Node.js Version(s) v21.6.1
The text was updated successfully, but these errors were encountered:
Describe the bug
It seems that examples in $.components.schemas are not validated if they are not referenced from a path.
Usually schemas are references from a path. However,
x-tags
allow to sometimes break this rule.Observed behavior means that examples of those schemas are not validated which is unexpected and error prone.
To Reproduce
Steps to reproduce the behavior:
redocly.yaml
fileredocly ...
id
property in the example.Expected behavior
All examples should be linted.
Logs
OpenAPI description
Redocly Version(s): 1.9.0
Node.js
Version(s) v21.6.1The text was updated successfully, but these errors were encountered: