Skip to content

Commit a1d62fc

Browse files
committed
v32 - querystring
1 parent 3103e10 commit a1d62fc

2 files changed

Lines changed: 113 additions & 1 deletion

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ repos:
5454
hooks:
5555
- id: yamlfmt
5656
args: [--mapping, '2', --sequence, '4', --offset, '2', --preserve-quotes, --implicit_start, --width, '1500']
57-
exclude: tests/fixtures/schema-enum.yaml
57+
exclude: |
58+
(?x)(
59+
^tests/fixtures/schema-enum.yaml|
60+
^tests/fixtures/paths-parameter-querystring.yaml
61+
)
5862
5963
- repo: https://github.com/astral-sh/uv-pre-commit
6064
# uv version.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
openapi: 3.2.0
2+
info:
3+
title: ''
4+
version: 0.0.0
5+
servers:
6+
- url: http://127.0.0.1/api
7+
8+
security:
9+
- {}
10+
11+
paths:
12+
/qs0:
13+
parameters:
14+
- $ref: "#/components/parameters/qs0"
15+
get:
16+
operationId: qs0
17+
responses:
18+
'204': {}
19+
/json:
20+
parameters:
21+
- $ref: "#/components/parameters/json"
22+
get:
23+
operationId: json
24+
responses:
25+
'204': {}
26+
27+
/selector:
28+
parameters:
29+
- $ref: "#/components/parameters/selector"
30+
get:
31+
operationId: selector
32+
responses:
33+
'204': {}
34+
35+
36+
components:
37+
parameters:
38+
qs0:
39+
name: qs0
40+
in: querystring
41+
content:
42+
application/x-www-form-urlencoded:
43+
schema:
44+
type: object
45+
properties:
46+
foo:
47+
type: string
48+
bar:
49+
type: boolean
50+
examples:
51+
spacesAndPluses:
52+
description: Note handling of spaces and "+" per media type.
53+
dataValue:
54+
foo: a + b
55+
bar: true
56+
serializedValue: foo=a+%2B+b&bar=true
57+
examples:
58+
spacesAndPluses:
59+
description: |
60+
Note that no additional percent encoding is done, as this
61+
media type is URI query string-ready by definition.
62+
dataValue:
63+
foo: a + b
64+
bar: true
65+
serializedValue: foo=a+%2B+b&bar=true
66+
67+
json:
68+
in: querystring
69+
name: json
70+
content:
71+
application/json:
72+
schema:
73+
type: object
74+
properties:
75+
numbers:
76+
type: array
77+
items:
78+
type: integer
79+
flag:
80+
type: [boolean, "null"]
81+
examples:
82+
TwoNoFlag:
83+
description: Serialize with minimized whitespace
84+
dataValue:
85+
numbers:
86+
- 1
87+
- 2
88+
flag: null
89+
serializedValue: '{"numbers":[1,2],"flag":null}'
90+
examples:
91+
TwoNoFlag:
92+
dataValue:
93+
numbers:
94+
- 1
95+
- 2
96+
flag: null
97+
serializedValue: "%7B%22numbers%22%3A%5B1%2C2%5D%2C%22flag%22%3Anull%7D"
98+
selector:
99+
in: querystring
100+
name: selector
101+
content:
102+
application/jsonpath:
103+
schema:
104+
type: string
105+
example: $.a.b[1:1]
106+
examples:
107+
Selector:
108+
serializedValue: "%24.a.b%5B1%3A1%5D"

0 commit comments

Comments
 (0)