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

Commit 87979cd

Browse files
committed
check $ref is relative to current file
1 parent b3ffe87 commit 87979cd

File tree

9 files changed

+98
-2
lines changed

9 files changed

+98
-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-parameter-with-primitive-mapping', processor: new TestProcessor(), parser: ParserType.SWAGGER),
36-
new TestSet(name: 'ref-parameter-with-primitive-mapping', processor: new TestProcessor(), parser: ParserType.OPENAPI4J)
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)
3737
]
3838
}
3939

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
items:
2+
- generated/api/Api.java
3+
- generated/model/Foo.java
4+
- generated/model/Bar.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 Bar {
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: 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 Bar bar;
14+
15+
public Bar getBar() {
16+
return bar;
17+
}
18+
19+
public void setBar(Bar 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/schemas/foo.yaml
4+
- inputs/schemas/bar.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
openapi: 3.0.2
2+
info:
3+
title: API
4+
version: 1.0.0
5+
6+
paths:
7+
/foo:
8+
get:
9+
responses:
10+
'200':
11+
description: none
12+
content:
13+
application/json:
14+
schema:
15+
$ref: 'schemas/foo.yaml#/Foo'
16+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bar:
2+
type: object
3+
properties:
4+
bar:
5+
type: string
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Foo:
2+
type: object
3+
properties:
4+
bar:
5+
$ref: 'bar.yaml#/Bar'

0 commit comments

Comments
 (0)