Skip to content

Commit 2e7ca6c

Browse files
committed
test: mutli refs response validation #576
1 parent 32d2299 commit 2e7ca6c

File tree

12 files changed

+137
-0
lines changed

12 files changed

+137
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
type: object
2+
properties:
3+
cluster_id:
4+
type: string
5+
cluster_name:
6+
type: string
7+
required:
8+
- cluster_id
9+
- cluster_name
10+
example:
11+
cluster_id: abcdefgh123456789
12+
cluster_name: MyCluster
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type: object
2+
properties:
3+
user_id:
4+
type: string
5+
name:
6+
type: string
7+
example:
8+
user_id: "1"
9+
name: John

test/resources/576/errors/400.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
type: object
2+
properties:
3+
error:
4+
type: object
5+
properties:
6+
type:
7+
type: number
8+
message:
9+
type: string
10+
example:
11+
error:
12+
type: 400
13+
message: 'Bad request'

test/resources/576/index.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
openapi: '3.0.3'
2+
info:
3+
version: 0.0.1
4+
title: My API
5+
description: Best API ever
6+
contact:
7+
name: My Support
8+
email: support@example.com
9+
servers:
10+
- url: 127.0.0.1/v1
11+
paths:
12+
$ref: paths.yaml
13+
components:
14+
schemas: {}
15+
tags:
16+
- name: Clusters
17+
- name: Users

test/resources/576/paths.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/clusters:
2+
$ref: "paths/clusters.yaml"
3+
/users:
4+
$ref: "paths/users.yaml"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
get:
2+
tags:
3+
- Clusters
4+
description: Returns a list of clusters
5+
operationId: getClusters
6+
responses:
7+
"200":
8+
$ref: "../responses/clusters.yaml"
9+
"400":
10+
$ref: "../responses/400.yaml"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
get:
2+
tags:
3+
- Users
4+
description: Returns a list of users
5+
operationId: getUsers
6+
responses:
7+
'200':
8+
$ref: '../responses/users.yaml'
9+
'400':
10+
$ref: '../responses/400.yaml'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Bad request
2+
content:
3+
'application/json':
4+
schema:
5+
$ref: '../errors/400.yaml'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Not found
2+
content:
3+
"application/json":
4+
schema:
5+
$ref: "../errors/404.yaml"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
description: Clusters
2+
content:
3+
'application/json':
4+
schema:
5+
type: array
6+
items:
7+
$ref: '../components/cluster.yaml'

0 commit comments

Comments
 (0)