Skip to content

Commit 913d0f0

Browse files
committed
duplicate schema by ref test case
1 parent 9e07073 commit 913d0f0

File tree

10 files changed

+133
-0
lines changed

10 files changed

+133
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
items:
2+
- generated/api/Api.java
3+
- generated/model/FooOne.java
4+
- generated/model/FooTwo.java
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* This class is auto generated by https://github.com/hauner/openapi-processor-core.
3+
* TEST ONLY.
4+
*/
5+
6+
package generated.api;
7+
8+
import annotation.Mapping;
9+
import generated.model.FooOne;
10+
import generated.model.FooTwo;
11+
12+
public interface Api {
13+
14+
@Mapping("/foo-one")
15+
FooOne getFoo();
16+
17+
@Mapping("/foo-two")
18+
FooTwo getFoo();
19+
20+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* This class is auto generated by https://github.com/hauner/openapi-processor-core.
3+
* TEST ONLY.
4+
*/
5+
6+
package generated.model;
7+
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
10+
public class FooOne {
11+
12+
@JsonProperty("foo-one")
13+
private String fooOne;
14+
15+
public String getFooOne() {
16+
return fooOne;
17+
}
18+
19+
public void setFooOne(String fooOne) {
20+
this.fooOne = fooOne;
21+
}
22+
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* This class is auto generated by https://github.com/hauner/openapi-processor-core.
3+
* TEST ONLY.
4+
*/
5+
6+
package generated.model;
7+
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
10+
public class FooTwo {
11+
12+
@JsonProperty("foo-two")
13+
private String fooTwo;
14+
15+
public String getFooTwo() {
16+
return fooTwo;
17+
}
18+
19+
public void setFooTwo(String fooTwo) {
20+
this.fooTwo = fooTwo;
21+
}
22+
23+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
items:
2+
- inputs/openapi.yaml
3+
- inputs/one.yaml
4+
- inputs/two.yaml
5+
- inputs/mapping.yaml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
openapi-processor-mapping: v2
2+
3+
options:
4+
package-name: generated
5+
6+
# map:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Foo:
2+
type: object
3+
properties:
4+
foo_one:
5+
type: string
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
openapi: 3.0.2
2+
info:
3+
title: test duplicate schema
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/foo-one:
9+
get:
10+
responses:
11+
'200':
12+
description: result
13+
content:
14+
application/json:
15+
schema:
16+
$ref: 'one.yaml#/Foo'
17+
18+
/foo-two:
19+
get:
20+
responses:
21+
'200':
22+
description: result
23+
content:
24+
application/json:
25+
schema:
26+
$ref: 'two.yaml#/Foo'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Foo:
2+
type: object
3+
properties:
4+
foo_two:
5+
type: string
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
== not currently supported
2+
3+
== swagger
4+
5+
duplicate handling produces two schemas
6+
7+
----
8+
Foo
9+
Foo_1
10+
----
11+
12+
there is no way to change it.
13+
14+
== openapi4j
15+
16+
no duplicate handling, produces two `Foo` s

0 commit comments

Comments
 (0)