Skip to content

Commit

Permalink
fix: improve of yaml discrimination
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Aug 27, 2020
1 parent 52becb9 commit d663ba4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/getConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import path from 'path'
import { OpenAPI } from 'openapi-types'
import { AspidaConfig, getConfigs } from 'aspida/dist/commands'

Expand All @@ -25,7 +24,7 @@ const createConfig = (config: ConfigFile) => {
output: config.input,
trailingSlash: config.trailingSlash,
outputEachDir: config.outputEachDir,
isYaml: openapi.yaml ?? path.extname(openapi.inputFile).slice(1) === 'yaml'
isYaml: openapi.yaml ?? !openapi.inputFile.endsWith('.json')
}
}

Expand Down

0 comments on commit d663ba4

Please sign in to comment.