Skip to content

Commit

Permalink
Add testcase for #152
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRalphson committed Feb 18, 2019
1 parent 177438c commit bd82b50
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/resolver/issue152/input.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
openapi: 3.0.0
info:
version: 1.0.0
title: API
tags:
- name: test
description: a test tag
paths:
/foo:
post:
operationId: postFoo
summary: Super post op
tags:
- test
responses:
'201':
$ref: 'responses.yaml#/components/responses/Post201'
/bar:
post:
operationId: postBar
summary: Super post op
tags:
- test
responses:
'201':
$ref: 'responses.yaml#/components/responses/Post201'
1 change: 1 addition & 0 deletions test/resolver/issue152/options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#preserveMiro: false
36 changes: 36 additions & 0 deletions test/resolver/issue152/output.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
openapi: 3.0.0
info:
version: 1.0.0
title: API
tags:
- name: test
description: a test tag
paths:
/foo:
post:
operationId: postFoo
summary: Super post op
tags:
- test
responses:
'201':
description: Success post
content:
application/json:
schema:
title: XYZ
description: this is xyz
type: object
properties:
id:
description: the local identifier (not necessarily globally unique)
type: string
/bar:
post:
operationId: postBar
summary: Super post op
tags:
- test
responses:
'201':
$ref: '#/paths/~1foo/post/responses/201'
14 changes: 14 additions & 0 deletions test/resolver/issue152/responses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
openapi: 3.0.0
info:
version: '1.0'
title: Common Response schemas
description: Response definitions commonly used in API-docs in a separate reference file
paths: {}
components:
responses:
Post201:
description: Success post
content:
application/json:
schema:
$ref: 'schemas.yaml#/components/schemas/xyz'
16 changes: 16 additions & 0 deletions test/resolver/issue152/schemas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
openapi: 3.0.0
info:
version: '1.0'
title: Common Message/JSON schemas
description: Message schemas / JSON datatypes commonly used in API-docs in a separate reference file
paths: {}
components:
schemas:
xyz:
title: XYZ
description: this is xyz
type: object
properties:
id:
description: the local identifier (not necessarily globally unique)
type: string

0 comments on commit bd82b50

Please sign in to comment.