-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
There are a bug in the generateSpec.ts file. like
const schema = getParamSchema(headersMeta) as oa.ReferenceObject
headers.push({
in: 'header',
name: schema.$ref.split('/').pop() || '',
required: isRequired(headersMeta, route),
schema,
})
const paramSchema = getParamSchema(queriesMeta) as oa.ReferenceObject
// the last segment after '/'
const paramSchemaName = paramSchema.$ref.split('/').pop() || ''
const currentSchema = schemas[paramSchemaName]
The getParamSchema function may return a empty object which result in an error.
What's more, I change
// example1
name: schema.$ref.split('/').pop() || '',
// example2
const paramSchemaName = paramSchema.$ref.split('/').pop() || ''
to
// example1
name: (schema.$ref || '').split('/').pop() || '',
// example2
const paramSchemaName = (paramSchema.$ref || '').split('/').pop() || ''
And it works.
Metadata
Metadata
Assignees
Labels
No labels