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

Commit a78ab00

Browse files
committed
additional test cases, #80
1 parent 2475d02 commit a78ab00

5 files changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
items:
22
- generated/api/Api.java
3+
- generated/api/MixedApi.java
4+
- generated/api/NoneApi.java
35
- generated/model/Error.java
46
- generated/model/Foo.java
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 MixedApi {
12+
13+
@Mapping("/foo-mixed")
14+
Foo getFooMixedApplicationJson();
15+
16+
@Mapping("/foo-mixed")
17+
String getFooMixedTextPlain();
18+
19+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
10+
public interface NoneApi {
11+
12+
@Mapping("/foo-none")
13+
void getFooNone();
14+
15+
}

src/testInt/resources/tests/response-content-multiple-style-success/inputs/mapping.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ options:
55

66
map:
77
# result-style: success # default
8+
9+
paths: {}
10+
11+
# to set a no content type response status enable a wrapper (e.g. Spring ResponseEntity)
12+
# paths:
13+
# /foo:
14+
# result: io.openapiprocessor.ResultWrapper

src/testInt/resources/tests/response-content-multiple-style-success/inputs/openapi.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ info:
55

66
paths:
77
/foo:
8+
description: multiple success with content type
89
get:
910
responses:
1011
'200':
@@ -23,6 +24,49 @@ paths:
2324
schema:
2425
$ref: '#/components/schemas/Error'
2526

27+
/foo-mixed:
28+
description: multiple success with & without content type
29+
get:
30+
tags:
31+
- mixed
32+
responses:
33+
'200':
34+
description: json or plain text result
35+
content:
36+
application/json:
37+
schema:
38+
$ref: '#/components/schemas/Foo'
39+
text/plain:
40+
schema:
41+
type: string
42+
'202':
43+
description: other success, no content type
44+
'204':
45+
description: other success, no content type
46+
default:
47+
description: error
48+
content:
49+
application/xml:
50+
schema:
51+
$ref: '#/components/schemas/Error'
52+
53+
/foo-none:
54+
get:
55+
description: responses without content type only
56+
tags:
57+
- none
58+
responses:
59+
'202':
60+
description: other success, no content type
61+
'204':
62+
description: other success, no content type
63+
default:
64+
description: error
65+
content:
66+
application/xml:
67+
schema:
68+
$ref: '#/components/schemas/Error'
69+
2670
components:
2771

2872
schemas:

0 commit comments

Comments
 (0)