Skip to content

Commit ff595a6

Browse files
hiddewiejoschi
authored andcommitted
Test for nested refs
1 parent b3c45af commit ff595a6

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.openapitools.openapidiff.core;
2+
3+
import static org.openapitools.openapidiff.core.TestUtils.assertOpenApiAreEquals;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
public class NestedSchemaRefTest {
8+
9+
private final String OPENAPI_DOC1 = "nested_schema_ref_1.yaml";
10+
11+
@Test
12+
public void shouldNotThrowErrorsForNestedRefs() {
13+
assertOpenApiAreEquals(OPENAPI_DOC1, OPENAPI_DOC1);
14+
}
15+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
openapi: 3.0.1
2+
info:
3+
title: Service
4+
description: test
5+
version: test
6+
contact:
7+
name: test
8+
url: 'test'
9+
servers:
10+
- url: 'localhost'
11+
paths:
12+
/feature:
13+
get:
14+
summary: Get feature state
15+
operationId: feature
16+
description: Gets feature
17+
parameters:
18+
- name: feature
19+
in: query
20+
schema:
21+
$ref: '#/components/schemas/Feature/properties/feature'
22+
required: true
23+
responses:
24+
'200':
25+
description: Found feature
26+
content:
27+
application/json:
28+
schema:
29+
$ref: '#/components/schemas/Feature'
30+
components:
31+
schemas:
32+
Feature:
33+
type: object
34+
properties:
35+
feature:
36+
type: string
37+
enum:
38+
- alpha
39+
- beta
40+
value:
41+
type: boolean
42+
required:
43+
- feature
44+
- value

0 commit comments

Comments
 (0)