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

Commit 1e762c4

Browse files
committed
escaped path name ref test cases
1 parent 89c2a2b commit 1e762c4

File tree

7 files changed

+111
-0
lines changed

7 files changed

+111
-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/Foo.java
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 annotation.Parameter;
10+
import generated.model.Foo;
11+
12+
public interface Api {
13+
14+
@Mapping("/foo")
15+
Foo getFoo();
16+
17+
@Mapping("/foo/{id}")
18+
Foo getFooId(@Parameter Integer id);
19+
20+
}
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
items:
2+
- inputs/openapi.yaml
3+
- inputs/foo.yaml
4+
- inputs/mapping.yaml
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
openapi: 3.0.2
2+
info:
3+
title: test ref to path name, foo
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/foo:
9+
get:
10+
responses:
11+
'200':
12+
description: the foo result
13+
content:
14+
application/json:
15+
schema:
16+
$ref: '#/components/schemas/Foo'
17+
18+
'/foo/{id}':
19+
get:
20+
parameters:
21+
- in: path
22+
name: id
23+
schema:
24+
type: integer
25+
required: true
26+
description: id parameter
27+
responses:
28+
'200':
29+
description: the foo result
30+
content:
31+
application/json:
32+
schema:
33+
$ref: '#/components/schemas/Foo'
34+
35+
components:
36+
schemas:
37+
38+
Foo:
39+
type: object
40+
properties:
41+
bar:
42+
type: string
43+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
openapi-processor-mapping: v2
2+
3+
options:
4+
package-name: generated
5+
6+
# map:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
openapi: 3.0.2
2+
info:
3+
title: test ref to path name, main
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/foo:
9+
$ref: ./foo.yaml#/paths/~1foo
10+
11+
'/foo/{id}':
12+
$ref: ./foo.yaml#/paths/~1foo~1{id}

0 commit comments

Comments
 (0)