Skip to content

Commit

Permalink
Fix bad line endings used (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen authored Jun 13, 2021
1 parent 2b936a9 commit 2886c5c
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ class Generator(
private val openApiModelBuilder: OpenApiModelBuilder,
private val openApiApiServicesBuilder: OpenApiApiServicesBuilder,
private val openApiConstantsBuilder: OpenApiConstantsBuilder,
private val apiBuilder: ApiBuilder
private val apiBuilder: ApiBuilder,
) {
private fun parse(openApiJson: String): SwaggerParseResult {
val parseResult = OpenAPIV3Parser().readContents(openApiJson)
// Replace CRLF with LF for consistency between platforms
val parseResult = OpenAPIV3Parser().readContents(openApiJson.replace("\r\n", "\n"))
parseResult.messages.forEach { println(it) }
return parseResult
}
Expand All @@ -42,7 +43,7 @@ class Generator(
fun generate(
openApiJson: String,
apiOutputDir: File,
modelsOutputDir: File
modelsOutputDir: File,
) {
val parseResult = parse(openApiJson)

Expand All @@ -59,6 +60,6 @@ class Generator(
// Create API operations
createApis(paths).forEach { file -> file.writeTo(apiOutputDir) }
// Create API constants
createApiConstants(parseResult.openAPI.info).let { file -> file.writeTo(apiOutputDir) }
createApiConstants(parseResult.openAPI.info).writeTo(apiOutputDir)
}
}

0 comments on commit 2886c5c

Please sign in to comment.