-
Notifications
You must be signed in to change notification settings - Fork 18
Fix source map locations for OAS 3 warnings #229
Conversation
|
||
if (examples.length > 1) { | ||
parseResult.push(createWarning(namespace, `'${name}' 'examples' only one example is supported, other examples have been ignored`, examples)); | ||
parseResult.push(createWarning(namespace, `'${name}' 'examples' only one example is supported, other examples have been ignored`, examples.content[1])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"examples" is an array and thus doesn't have source maps, we should point to the 1st example which causes the warning for source maps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this an ideal case for providing multiple source map ranges? 😉 Not that I need them, this solution is fine for Dredd.
isValidType, | ||
R.compose( | ||
createWarning(namespace, `'Schema Object' 'type' must be either ${types.join(', ')}`), | ||
getValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"type" the element passed ot createWarning is a member element and not a value and thus does not contain source maps.
|
||
if (examples.length > 1) { | ||
parseResult.push(createWarning(namespace, `'${name}' 'examples' only one example is supported, other examples have been ignored`, examples)); | ||
parseResult.push(createWarning(namespace, `'${name}' 'examples' only one example is supported, other examples have been ignored`, examples.content[1])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this an ideal case for providing multiple source map ranges? 😉 Not that I need them, this solution is fine for Dredd.
I discovered missing source maps on two types of warnings, will comment below.