File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
main/groovy/com/github/hauner/openapi/spring/parser/openapi4j
testInt/groovy/com/github/hauner/openapi/processor Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,18 @@ class RefResolver implements ParserRefResolver {
3636
3737 @Override
3838 ParserSchema resolve (ParserSchema ref ) {
39- O4jSchema o4jSchema = (ref as Schema ). schema
40- def resolved = o4jSchema. copy (api. context, true )
41- return new Schema (resolved)
39+ def resolved
40+
41+ def refName = getRefName (ref. ref)
42+ O4jSchema o4jCompSchema = api. components. schemas. get (refName)
43+ if (o4jCompSchema) {
44+ resolved = o4jCompSchema
45+ } else {
46+ O4jSchema o4jSchema = (ref as Schema ). schema
47+ resolved = o4jSchema. copy (api. context, true )
48+ }
49+
50+ new Schema (resolved)
4251 }
4352
4453 private String getRefName (String ref ) {
Original file line number Diff line number Diff line change @@ -21,15 +21,15 @@ import org.junit.Ignore
2121import org.junit.runner.RunWith
2222import org.junit.runners.Parameterized
2323
24- // @Ignore
24+ @Ignore
2525@RunWith (Parameterized )
2626class ProcessorPendingTest extends ProcessorTestBase {
2727
2828 @Parameterized.Parameters (name = " {0}" )
2929 static Collection<TestSet > sources () {
3030 return [
31- new TestSet (name : ' ref-into-another-file ' , parser : ParserType . SWAGGER ),
32- new TestSet (name : ' ref-into-another-file ' , parser : ParserType . OPENAPI4J )
31+ new TestSet (name : ' response-complex-data-types ' , parser : ParserType . SWAGGER ),
32+ new TestSet (name : ' response-complex-data-types ' , parser : ParserType . OPENAPI4J )
3333 ]
3434 }
3535
You can’t perform that action at this time.
0 commit comments