File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11import isObject from 'lodash/isObject'
2+ import startsWith from 'lodash/startsWith'
23
34const toLower = str => String . prototype . toLowerCase . call ( str )
45const escapeString = ( str ) => {
@@ -12,7 +13,7 @@ export function isOAS3(spec) {
1213 return false
1314 }
1415
15- return oasVersion . startsWith ( '3.0.0 ')
16+ return startsWith ( oasVersion , '3 ')
1617}
1718
1819export function isSwagger2 ( spec ) {
@@ -21,7 +22,7 @@ export function isSwagger2(spec) {
2122 return false
2223 }
2324
24- return swaggerVersion . startsWith ( '2' )
25+ return startsWith ( swaggerVersion , '2' )
2526}
2627
2728// Strategy for determining operationId
Original file line number Diff line number Diff line change 11import cloneDeep from 'lodash/cloneDeep'
22import assign from 'lodash/assign'
3+ import startsWith from 'lodash/startsWith'
34import Url from 'url'
45import Http , { makeHttp , serializeRes , serializeHeaders } from './http'
56import Resolver , { clearCache } from './resolver'
@@ -82,7 +83,7 @@ Swagger.prototype.applyDefaults = function () {
8283 const spec = this . spec
8384 const specUrl = this . url
8485 // TODO: OAS3: support servers here
85- if ( specUrl && specUrl . startsWith ( 'http' ) ) {
86+ if ( specUrl && startsWith ( specUrl , 'http' ) ) {
8687 const parsed = Url . parse ( specUrl )
8788 if ( ! spec . host ) {
8889 spec . host = parsed . host
You can’t perform that action at this time.
0 commit comments