Skip to content

Commit 4fe710a

Browse files
committed
adjusted wildcard example
following OAI#88
1 parent 65e7d38 commit 4fe710a

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

examples/wildcard.bump.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ paths:
1515
description: condition for items to return
1616
required: true
1717
schema: &ref_0
18-
type: string
1918
$ref: '#/components/schemas/filterSchema'
2019
limitParam:
2120
name: limit
@@ -79,4 +78,13 @@ paths:
7978
application/json:
8079
schema:
8180
type: array
81+
components:
82+
schemas:
83+
filterSchema:
84+
type: string
85+
default: available
86+
enum:
87+
- available
88+
- pending
89+
- sold
8290

examples/wildcard.overlay.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ actions:
66
- target: $.paths.*.get
77
update:
88
x-safe: true
9+
- target: $
10+
update:
11+
components:
12+
schemas:
13+
filterSchema:
14+
type: string
15+
default: available
16+
enum:
17+
- available
18+
- pending
19+
- sold
20+
- target: $.paths.*.get.parameters[?(@.name=='filter' && @.in=='query')].schema
21+
remove: true
922
- target: $.paths.*.get.parameters[?(@.name=='filter' && @.in=='query')]
1023
update:
1124
schema:

examples/wildcard.speakeasy.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,12 @@ paths:
7979
application/json:
8080
schema:
8181
type: array
82+
components:
83+
schemas:
84+
filterSchema:
85+
type: string
86+
default: available
87+
enum:
88+
- available
89+
- pending
90+
- sold

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"Swagger"
3838
],
3939
"scripts": {
40-
"build": "npm run structured-bump && npm run structured-speakeasy",
40+
"build": "npm run structured-bump && npm run structured-speakeasy && npm run wildcard-bump && npm run wildcard-speakeasy",
4141
"structured-bump": "bump overlay examples/structured.openapi.yaml examples/structured.overlay.yaml > examples/structured.bump.yaml",
4242
"structured-speakeasy": "speakeasy overlay apply -s examples/structured.openapi.yaml -o examples/structured.overlay.yaml --out examples/structured.speakeasy.yaml",
4343
"wildcard-bump": "bump overlay examples/wildcard.openapi.yaml examples/wildcard.overlay.yaml > examples/wildcard.bump.yaml",

0 commit comments

Comments
 (0)