File tree 2 files changed +8
-4
lines changed
src/main/java/com/mservicetech/openapi/validation 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 19
19
<modelVersion >4.0.0</modelVersion >
20
20
<groupId >com.mservicetech</groupId >
21
21
<artifactId >openapi-schema-validation</artifactId >
22
- <version >2.0.0 </version >
22
+ <version >2.0.1 </version >
23
23
<packaging >jar</packaging >
24
24
<description >openapi schema for openpai 3.*</description >
25
25
<url >https://github.com/mservicetech/openapi-schema-validation</url >
57
57
<java .version>11</java .version>
58
58
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
59
59
<version .json-schema-validator>1.0.44</version .json-schema-validator>
60
- <version .light-4j>2.0.22-SNAPSHOT </version .light-4j>
60
+ <version .light-4j>2.0.22</version .light-4j>
61
61
<version .jackson>2.10.4</version .jackson>
62
62
<version .snakeyaml>1.26</version .snakeyaml>
63
63
<version .slf4j>1.7.30</version .slf4j>
Original file line number Diff line number Diff line change 32
32
public class OpenApiValidator {
33
33
Logger logger = LoggerFactory .getLogger (OpenApiValidator .class );
34
34
final String OPENAPI_YML_CONFIG = "openapi.yml" ;
35
+ final String OPENAPI_YAML_CONFIG = "openapi.yaml" ;
35
36
final String STATUS_INVALID_REQUEST_PATH = "ERR10007" ;
36
37
final String STATUS_METHOD_NOT_ALLOWED = "ERR10008" ;
37
38
@@ -52,9 +53,12 @@ public class OpenApiValidator {
52
53
*/
53
54
public OpenApiValidator () {
54
55
try {
55
- InputStream in = this .getClass ().getClassLoader ().getResourceAsStream (OPENAPI_YML_CONFIG );
56
+ InputStream in = this .getClass ().getClassLoader ().getResourceAsStream (OPENAPI_YAML_CONFIG );
56
57
if (in == null ) {
57
- throw new IOException ("cannot load openapi spec file" );
58
+ in = this .getClass ().getClassLoader ().getResourceAsStream (OPENAPI_YML_CONFIG );
59
+ if (in ==null ) {
60
+ throw new IOException ("cannot load openapi spec file" );
61
+ }
58
62
}
59
63
spec = new BufferedReader (new InputStreamReader (in , StandardCharsets .UTF_8 )).lines ().collect (Collectors .joining ("\n " ));
60
64
openApiHelper = OpenApiHelper .init (spec );
You can’t perform that action at this time.
0 commit comments