|
1 | 1 | package io.swagger.v3.parser.util;
|
2 | 2 |
|
3 |
| -import static io.swagger.v3.parser.util.RefUtils.computeDefinitionName; |
4 |
| -import static io.swagger.v3.parser.util.RefUtils.computeRefFormat; |
5 |
| -import static io.swagger.v3.parser.util.RefUtils.isAnExternalRefFormat; |
6 |
| - |
7 |
| -import java.util.ArrayList; |
8 |
| -import java.util.HashMap; |
9 |
| -import java.util.HashSet; |
10 |
| -import java.util.IdentityHashMap; |
11 |
| -import java.util.LinkedHashMap; |
12 |
| -import java.util.List; |
13 |
| -import java.util.Map; |
14 |
| -import java.util.Set; |
15 |
| -import java.util.stream.Collectors; |
16 |
| - |
17 | 3 | import io.swagger.v3.oas.models.Components;
|
18 | 4 | import io.swagger.v3.oas.models.OpenAPI;
|
19 | 5 | import io.swagger.v3.oas.models.Operation;
|
|
37 | 23 | import org.slf4j.Logger;
|
38 | 24 | import org.slf4j.LoggerFactory;
|
39 | 25 |
|
| 26 | +import java.util.ArrayList; |
| 27 | +import java.util.HashMap; |
| 28 | +import java.util.HashSet; |
| 29 | +import java.util.IdentityHashMap; |
| 30 | +import java.util.LinkedHashMap; |
| 31 | +import java.util.List; |
| 32 | +import java.util.Map; |
| 33 | +import java.util.Set; |
| 34 | +import java.util.stream.Collectors; |
| 35 | + |
| 36 | +import static io.swagger.v3.parser.util.RefUtils.computeDefinitionName; |
| 37 | +import static io.swagger.v3.parser.util.RefUtils.computeRefFormat; |
| 38 | +import static io.swagger.v3.parser.util.RefUtils.isAnExternalRefFormat; |
| 39 | + |
40 | 40 | public class ResolverFully {
|
41 | 41 | private static final Logger LOGGER = LoggerFactory.getLogger(ResolverFully.class);
|
42 | 42 |
|
@@ -275,10 +275,14 @@ public Parameter resolveParameter(Parameter parameter){
|
275 | 275 | }
|
276 | 276 |
|
277 | 277 | public Schema resolveSchema(Schema schema) {
|
| 278 | + if (schema == null) { |
| 279 | + return null; |
| 280 | + } |
| 281 | + |
278 | 282 | if(schema.get$ref() != null) {
|
279 | 283 | String ref= schema.get$ref();
|
280 | 284 | ref = ref.substring(ref.lastIndexOf("/") + 1);
|
281 |
| - Schema resolved = schemas.get(ref); |
| 285 | + Schema resolved = schemas != null ? schemas.get(ref) : null; |
282 | 286 |
|
283 | 287 | if (resolved != null) {
|
284 | 288 |
|
|
0 commit comments