Skip to content

Commit 412dabe

Browse files
committed
add integration test (#115)
1 parent 40a83bd commit 412dabe

File tree

10 files changed

+95
-0
lines changed

10 files changed

+95
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
prefix: api
2+
items:
3+
- inputs/api/openapi30.yaml
4+
- inputs/api/openapi31.yaml
5+
- inputs/api/mapping.yaml
6+
- inputs/main/kotlin/io/openapiprocessor/foo/foo.yaml
7+
- inputs/main/kotlin/io/openapiprocessor/foo/resources.yaml
8+
9+
# src/api
10+
# src/main
11+
# src/main/java
12+
# src/main/resources
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
openapi-processor-mapping: v12
2+
3+
options:
4+
package-name: io.openapiprocessor
5+
package-name-from-path: true
6+
format-code: false
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
openapi: 3.0.2
2+
info:
3+
title: test template
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/foo:
9+
$ref: '../main/kotlin/io/openapiprocessor/foo/foo.yaml'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
openapi: 3.1.0
2+
info:
3+
title: test template
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/foo:
9+
$ref: '../main/kotlin/io/openapiprocessor/foo/foo.yaml'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
get:
2+
responses:
3+
'200':
4+
description: the foo result
5+
content:
6+
application/json:
7+
schema:
8+
$ref: './resources.yaml#/Foo'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Foo:
2+
type: object
3+
properties:
4+
bar:
5+
type: string
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
prefix: generated
2+
items:
3+
- outputs/io/openapiprocessor/foo/Api.java
4+
- outputs/io/openapiprocessor/foo/model/<model>/Foo.java
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package io.openapiprocessor.foo;
2+
3+
import annotation.Mapping;
4+
import io.openapiprocessor.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public interface Api {
8+
9+
@Mapping("/foo")
10+
Foo getFoo();
11+
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package io.openapiprocessor.foo;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import io.openapiprocessor.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public class Foo {
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,10 @@
1+
package io.openapiprocessor.foo;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import io.openapiprocessor.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public record Foo(
8+
@JsonProperty("bar")
9+
String bar
10+
) {}

0 commit comments

Comments
 (0)