Skip to content

Commit f3cf085

Browse files
authored
fix: update ajv for composite unevaluatedProperties handling (#2404)
1 parent e485ec3 commit f3cf085

File tree

7 files changed

+71
-12
lines changed

7 files changed

+71
-12
lines changed

.changeset/silent-frogs-greet.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@redocly/openapi-core": patch
3+
"@redocly/cli": patch
4+
---
5+
6+
Fixed `no-invalid-media-type-examples` for schemas using `anyOf`/`oneOf`.

package-lock.json

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"Roman Hotsiy <[email protected]> (https://redocly.com/)"
5353
],
5454
"dependencies": {
55-
"@redocly/ajv": "^8.11.2",
55+
"@redocly/ajv": "^8.11.4",
5656
"@redocly/config": "^0.37.0",
5757
"ajv-formats": "^2.1.1",
5858
"colorette": "^1.2.0",

packages/respect-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"dependencies": {
3939
"@faker-js/faker": "^7.6.0",
4040
"@noble/hashes": "^1.8.0",
41-
"@redocly/ajv": "8.11.2",
41+
"@redocly/ajv": "8.11.4",
4242
"@redocly/openapi-core": "2.11.0",
4343
"better-ajv-errors": "^1.2.0",
4444
"colorette": "^2.0.20",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
openapi: 3.1.0
2+
info:
3+
title: anyOf with top-level properties
4+
version: 1.0.0
5+
servers:
6+
- url: https://api.server.test/v1
7+
paths:
8+
/users:
9+
get:
10+
responses:
11+
'200':
12+
content:
13+
application/json:
14+
schema:
15+
type: object
16+
required:
17+
- address
18+
properties:
19+
address:
20+
type: string
21+
anyOf:
22+
- type: object
23+
required:
24+
- firstName
25+
- lastName
26+
properties:
27+
firstName:
28+
type: string
29+
lastName:
30+
type: string
31+
- type: object
32+
required:
33+
- name
34+
properties:
35+
name:
36+
type: string
37+
example:
38+
address: someWhere
39+
firstName: John
40+
lastName: Doe
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apis:
2+
main:
3+
root: ./openapi.yaml
4+
5+
rules:
6+
no-invalid-media-type-examples: error
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
validating openapi.yaml using lint rules for api 'main'...
3+
openapi.yaml: validated in <test>ms
4+
5+
Woohoo! Your API description is valid. 🎉
6+

0 commit comments

Comments
 (0)