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

Commit 19fa9b2

Browse files
committed
#91, integration test
1 parent 2487a67 commit 19fa9b2

File tree

6 files changed

+89
-0
lines changed

6 files changed

+89
-0
lines changed
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/FooResource.java
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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.FooResource;
10+
import io.openapiprocessor.Wrap;
11+
12+
public interface Api {
13+
14+
@Mapping("/foos")
15+
Wrap<FooResource> getFoos();
16+
17+
}
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 FooResource {
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
openapi-processor-mapping: v2
2+
3+
options:
4+
package-name: generated
5+
model-name-suffix: Resource
6+
7+
map:
8+
types:
9+
- type: Foos => io.openapiprocessor.Wrap<{package-name}.model.Foo>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
openapi: 3.0.2
2+
info:
3+
title: test generic mapping with {package-name}
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/foos:
9+
get:
10+
responses:
11+
'200':
12+
description: the result
13+
content:
14+
application/json:
15+
schema:
16+
$ref: '#/components/schemas/Foos'
17+
18+
components:
19+
schemas:
20+
21+
Foos:
22+
description: wrapper
23+
type: object
24+
properties:
25+
foos:
26+
type: array
27+
items:
28+
$ref: '#/components/schemas/Foo'
29+
30+
Foo:
31+
type: object
32+
properties:
33+
bar:
34+
type: string

0 commit comments

Comments
 (0)