1717package io.openapiprocessor.core.parser.swagger
1818
1919import io.openapiprocessor.core.misc.toURL
20- import io.openapiprocessor.core.parser.OpenApi as ParserOpenApi
2120import io.swagger.v3.parser.OpenAPIV3Parser
2221import io.swagger.v3.parser.core.models.ParseOptions
2322import io.swagger.v3.parser.core.models.SwaggerParseResult
23+ import io.openapiprocessor.core.parser.OpenApi as ParserOpenApi
2424
2525const val SCHEME_RESOURCE = " resource:"
2626
@@ -35,10 +35,10 @@ open class Parser {
3535 val opts = ParseOptions ()
3636 // loads $refs to other files into #/components/schema and replaces the $refs to the
3737 // external files with $refs to #/components/schema.
38- opts.setResolve( true )
38+ opts.isResolve = true
3939
4040 val result: SwaggerParseResult = OpenAPIV3Parser ()
41- .readLocation (preparePath (apiPath), null , opts)
41+ .readLocation(preparePath(apiPath), null , opts)
4242
4343 return OpenApi (result)
4444 }
@@ -49,16 +49,16 @@ open class Parser {
4949 // If it is something different (or nothing) it tries to find the given path as-is on the
5050 // file system. If that fails it tries to load the path as resource.
5151
52- if (isResource (path)) {
52+ if (isResource(path)) {
5353 // strip resource: (only used by tests) to load test files from the resources
54- return path.substring (SCHEME_RESOURCE .length)
54+ return path.substring(SCHEME_RESOURCE .length)
5555 }
5656
5757 return toURL(path).toString ()
5858 }
5959
6060 private fun isResource (path : String ): Boolean {
61- return path.startsWith (SCHEME_RESOURCE )
61+ return path.startsWith(SCHEME_RESOURCE )
6262 }
6363
6464}
0 commit comments