Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit a6815ed

Browse files
committed
#78, integration test
1 parent 79b94a3 commit a6815ed

File tree

9 files changed

+152
-0
lines changed

9 files changed

+152
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
items:
2+
- generated/api/Api.java
3+
- generated/model/Foo.java
4+
- generated/model/GenericProperties.java
5+
- generated/model/SpecificPropertiesOne.java
6+
- generated/model/SpecificPropertiesTwo.java
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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.Foo;
10+
11+
public interface Api {
12+
13+
@Mapping("/foo")
14+
Foo getFoo();
15+
16+
}
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 Foo {
11+
12+
@JsonProperty("myProperties")
13+
private GenericProperties myProperties;
14+
15+
public GenericProperties getMyProperties() {
16+
return myProperties;
17+
}
18+
19+
public void setMyProperties(GenericProperties myProperties) {
20+
this.myProperties = myProperties;
21+
}
22+
23+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
public interface GenericProperties {
9+
}
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 SpecificPropertiesOne implements GenericProperties {
11+
12+
@JsonProperty("foo")
13+
private String foo;
14+
15+
public String getFoo() {
16+
return foo;
17+
}
18+
19+
public void setFoo(String foo) {
20+
this.foo = foo;
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 SpecificPropertiesTwo implements GenericProperties {
11+
12+
@JsonProperty("bar")
13+
private String bar;
14+
15+
public String getBar() {
16+
return bar;
17+
}
18+
19+
public void setBar(String bar) {
20+
this.bar = bar;
21+
}
22+
23+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
items:
2+
- inputs/openapi.yaml
3+
- inputs/mapping.yaml
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
openapi-processor-mapping: v2
2+
3+
options:
4+
package-name: generated
5+
one-of-interface: true
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
openapi: 3.0.2
2+
info:
3+
title: composed oneOf interface
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/foo:
9+
get:
10+
responses:
11+
'200':
12+
description: the foo result
13+
content:
14+
application/json:
15+
schema:
16+
$ref: '#/components/schemas/Foo'
17+
18+
components:
19+
schemas:
20+
21+
Foo:
22+
type: object
23+
properties:
24+
myProperties:
25+
$ref: '#/components/schemas/GenericProperties'
26+
27+
GenericProperties:
28+
oneOf:
29+
- $ref: '#/components/schemas/SpecificPropertiesOne'
30+
- $ref: '#/components/schemas/SpecificPropertiesTwo'
31+
32+
SpecificPropertiesOne:
33+
type: object
34+
properties:
35+
foo:
36+
type: string
37+
maxLength: 200
38+
39+
SpecificPropertiesTwo:
40+
type: object
41+
properties:
42+
bar:
43+
type: string
44+
maxLength: 100

0 commit comments

Comments
 (0)