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

Commit ce6331b

Browse files
committed
test case for empty response leak
1 parent 10ea995 commit ce6331b

File tree

6 files changed

+77
-2
lines changed

6 files changed

+77
-2
lines changed

src/testInt/groovy/com/github/hauner/openapi/processor/core/ProcessorPendingTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class ProcessorPendingTest extends ProcessorTestBase {
3232
@Parameterized.Parameters(name = "{0}")
3333
static Collection<TestSet> sources () {
3434
return [
35-
new TestSet(name: 'ref-is-relative-to-current-file', processor: new TestProcessor(), parser: ParserType.SWAGGER),
36-
new TestSet(name: 'ref-is-relative-to-current-file', processor: new TestProcessor(), parser: ParserType.OPENAPI4J)
35+
new TestSet(name: 'response-content-multiple-no-content', processor: new TestProcessor(), parser: ParserType.SWAGGER),
36+
new TestSet(name: 'response-content-multiple-no-content', processor: new TestProcessor(), parser: ParserType.OPENAPI4J)
3737
]
3838
}
3939

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
items:
2+
- generated/api/Api.java
3+
- generated/model/Foo.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("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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
items:
2+
- inputs/openapi.yaml
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
openapi: 3.0.3
2+
info:
3+
title: test response content with multiple no content errors
4+
version: 1.0.0
5+
6+
paths:
7+
/foo:
8+
get:
9+
responses:
10+
'200':
11+
description: json or plain text result
12+
content:
13+
application/json:
14+
schema:
15+
$ref: '#/components/schemas/Foo'
16+
'400':
17+
description: Bad request.
18+
'401':
19+
description: Unauthorized.
20+
'404':
21+
description: Not found.
22+
'5XX':
23+
description: Server error.
24+
25+
components:
26+
schemas:
27+
Foo:
28+
type: object
29+
properties:
30+
bar:
31+
type: string

0 commit comments

Comments
 (0)