Skip to content

Commit a9cf126

Browse files
committed
chore: finalizing tests for API serializer
Signed-off-by: Pawel Psztyc <[email protected]>
1 parent 012db30 commit a9cf126

File tree

9 files changed

+401
-129
lines changed

9 files changed

+401
-129
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cSpell.words": [
33
"Arrable",
4+
"JSESSIONID",
45
"Unionable",
56
"xone"
67
]

apis/demo-api/demo-api.raml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,16 @@ types:
935935
responses:
936936
200:
937937
description:
938+
/xml:
939+
displayName: People
940+
description: The people API used to access data about the people.
941+
post:
942+
displayName: Create a person
943+
description: Use this method to add new person
944+
body:
945+
application/xml:
946+
type: !include schemas/person.xsd
947+
example: !include examples/person.xml
938948
/examples:
939949
get:
940950
displayName: Included example

apis/demo-api/examples/person.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<resource error="false" type="AppPerson">
3+
<id>Qawer63J73HJ6khjswuqyq62382jG21s</id>
4+
<name>John Smith</name>
5+
<birthday>1990-10-12</birthday>
6+
<gender>male</gender>
7+
<url>https://www.domain.com/people/Qawer63J73HJ6khjswuqyq62382jG21s</url>
8+
<image>
9+
<url>https://www.domain.com/people/Qawer63J73HJ6khjswuqyq62382jG21s/image</url>
10+
<thumb>https://www.domain.com/people/Qawer63J73HJ6khjswuqyq62382jG21s/image/thumb</thumb>
11+
</image>
12+
<tagline>Hi, I'm John!</tagline>
13+
<language>en_US</language>
14+
</resource>

apis/demo-api/schemas/person.xsd

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
3+
<xs:element name="resource">
4+
<xs:complexType>
5+
<xs:sequence>
6+
<xs:element name="id" type="xs:string"></xs:element>
7+
<xs:element name="name" type="xs:string"></xs:element>
8+
<xs:element name="birthday" type="xs:date"></xs:element>
9+
<xs:element name="gender" type="xs:string"></xs:element>
10+
<xs:element name="url" type="xs:string"></xs:element>
11+
<xs:element name="image">
12+
<xs:complexType>
13+
<xs:sequence>
14+
<xs:element name="url" type="xs:string"></xs:element>
15+
<xs:element name="thumb" type="xs:string"></xs:element>
16+
</xs:sequence>
17+
</xs:complexType>
18+
</xs:element>
19+
<xs:element name="tagline" type="xs:string"></xs:element>
20+
<xs:element name="language" type="xs:string"></xs:element>
21+
</xs:sequence>
22+
<xs:attribute name="error" type="xs:boolean" use="required"></xs:attribute>
23+
<xs:attribute name="type" type="xs:string" use="required"></xs:attribute>
24+
</xs:complexType>
25+
</xs:element>
26+
</xs:schema>

apis/oas-3-api/oas-3-api.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,30 @@ components:
117117
BasicAuth:
118118
type: http
119119
scheme: basic
120+
description: A basic HTTP scheme
120121

121122
BearerAuth:
122123
type: http
123124
scheme: bearer
124125
bearerFormat: JWT
126+
description: Bearer form of authentication
125127

126128
ApiKeyAuth:
127129
type: apiKey
128130
in: header
129131
name: X-API-Key
132+
description: Using API keys
133+
134+
ApiKeyQuery:
135+
type: apiKey
136+
in: query
137+
name: X-API-Key
138+
description: API Key in a query parameter
130139

131140
OpenID:
132141
type: openIdConnect
133142
openIdConnectUrl: https://example.com/.well-known/openid-configuration
143+
description: Using OpenId
134144

135145
OAuth2:
136146
type: oauth2
@@ -268,3 +278,79 @@ paths:
268278
responses:
269279
'200':
270280
description: Your server returns this code if it accepts the callback
281+
/oas-properties:
282+
post:
283+
externalDocs:
284+
url: https://docs.com
285+
description: A doc
286+
deprecated: true
287+
tags:
288+
- "pets"
289+
- "tests"
290+
description: A description
291+
operationId: myId
292+
requestBody:
293+
description: A body
294+
required: false
295+
content:
296+
application/x-www-form-urlencoded:
297+
encoding:
298+
color:
299+
style: form
300+
explode: false
301+
examples:
302+
simple:
303+
value:
304+
- yellow
305+
- red
306+
- pink
307+
summary: A sample color value
308+
description: Example of a color value
309+
schema:
310+
type: object
311+
properties:
312+
color:
313+
type: array
314+
items:
315+
type: string
316+
responses:
317+
'200':
318+
description: OK response
319+
/http-security:
320+
get:
321+
security:
322+
- BasicAuth: []
323+
responses:
324+
'201':
325+
description: OK
326+
post:
327+
security:
328+
- BearerAuth: []
329+
responses:
330+
'201':
331+
description: OK
332+
put:
333+
security:
334+
- ApiKeyAuth: []
335+
responses:
336+
'201':
337+
description: OK
338+
patch:
339+
security:
340+
- cookieAuth: []
341+
responses:
342+
'201':
343+
description: OK
344+
options:
345+
security:
346+
- ApiKeyQuery: []
347+
responses:
348+
'102':
349+
description: OK
350+
/open-id:
351+
get:
352+
security:
353+
- OpenID: []
354+
responses:
355+
'201':
356+
description: OK

0 commit comments

Comments
 (0)