Skip to content

Commit ef946bd

Browse files
authored
fix: parameters examples value validation (#114)
1 parent b6bb61a commit ef946bd

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

src/internal/Validator/openapi.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@
570570
"type": "string"
571571
},
572572
"value": {
573-
"$ref": "#/definitions/any"
573+
"$ref": "#/definitions/defaultType"
574574
},
575575
"externalValue": {
576576
"type": "string"

test/__tests__/class/__snapshots__/parameter-test.ts.snap

+8
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,14 @@ exports[`Parameter api.test.domain 1`] = `
460460
"schema": {
461461
"type": "integer",
462462
"format": "int32"
463+
},
464+
"examples": {
465+
"example1": {
466+
"value": 20231119
467+
},
468+
"example2": {
469+
"value": 20240101
470+
}
463471
}
464472
}
465473
],

test/__tests__/functional/__snapshots__/parameter-test.ts.snap

+8
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,14 @@ exports[`Parameter api.test.domain 1`] = `
460460
"schema": {
461461
"type": "integer",
462462
"format": "int32"
463+
},
464+
"examples": {
465+
"example1": {
466+
"value": 20231119
467+
},
468+
"example2": {
469+
"value": 20240101
470+
}
463471
}
464472
}
465473
],

test/api.test.domain/index.yml

+5
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ paths:
439439
schema:
440440
type: integer
441441
format: int32
442+
examples:
443+
example1:
444+
value: 20231119
445+
example2:
446+
value: 20240101
442447
responses:
443448
200:
444449
description: Search Book Result

0 commit comments

Comments
 (0)