Skip to content

Commit 49e40c7

Browse files
committed
1 parent 733f317 commit 49e40c7

File tree

10 files changed

+168
-0
lines changed

10 files changed

+168
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
items:
2+
- inputs/openapi30.yaml
3+
- inputs/openapi31.yaml
4+
- 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: v11
2+
3+
options:
4+
package-name: generated
5+
format-code: false
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
openapi: 3.0.2
2+
info:
3+
title: test multiple success responses
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/fooBar:
9+
get:
10+
responses:
11+
'200':
12+
description: success
13+
content:
14+
application/json:
15+
schema:
16+
$ref: '#/components/schemas/Foo'
17+
text/plain:
18+
schema:
19+
type: string
20+
'202':
21+
description: another success
22+
content:
23+
application/json:
24+
schema:
25+
$ref: '#/components/schemas/Bar'
26+
27+
components:
28+
schemas:
29+
30+
Foo:
31+
type: object
32+
properties:
33+
foo:
34+
type: string
35+
36+
Bar:
37+
type: object
38+
properties:
39+
bar:
40+
type: string
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
openapi: 3.1.0
2+
info:
3+
title: test multiple success responses
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/fooBar:
9+
get:
10+
responses:
11+
'200':
12+
description: success
13+
content:
14+
application/json:
15+
schema:
16+
$ref: '#/components/schemas/Foo'
17+
text/plain:
18+
schema:
19+
type: string
20+
'202':
21+
description: another success
22+
content:
23+
application/json:
24+
schema:
25+
$ref: '#/components/schemas/Bar'
26+
27+
components:
28+
schemas:
29+
30+
Foo:
31+
type: object
32+
properties:
33+
foo:
34+
type: string
35+
36+
Bar:
37+
type: object
38+
properties:
39+
bar:
40+
type: string
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
items:
2+
- outputs/api/Api.java
3+
- outputs/<model>/Foo.java
4+
- outputs/<model>/Bar.java
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package generated.api;
2+
3+
import annotation.Mapping;
4+
import generated.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public interface Api {
8+
9+
@Mapping("/fooBar")
10+
Object getFooBarpplicationJson();
11+
12+
@Mapping("/fooBar")
13+
Object getFooBarTextPlain();
14+
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package generated.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import generated.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public class Bar {
8+
9+
@JsonProperty("bar")
10+
private String bar;
11+
12+
public String getBar() {
13+
return bar;
14+
}
15+
16+
public void setBar(String bar) {
17+
this.bar = bar;
18+
}
19+
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package generated.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import generated.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public class Foo {
8+
9+
@JsonProperty("foo")
10+
private String foo;
11+
12+
public String getFoo() {
13+
return foo;
14+
}
15+
16+
public void setFoo(String foo) {
17+
this.foo = foo;
18+
}
19+
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package generated.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import generated.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public record Bar(
8+
@JsonProperty("bar")
9+
String bar
10+
) {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package generated.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import generated.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public record Foo(
8+
@JsonProperty("foo")
9+
String foo
10+
) {}

0 commit comments

Comments
 (0)