Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Conversation

kylef
Copy link
Member

@kylef kylef commented May 16, 2019

I discovered missing source maps on two types of warnings, will comment below.

@kylef kylef added the openapi3 label May 16, 2019
@kylef kylef requested a review from pksunkara May 16, 2019 22:55

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]));
Copy link
Member Author

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.

Copy link
Contributor

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
Copy link
Member Author

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.

@kylef kylef force-pushed the kylef/sourcemaps branch from 93468f6 to 198eff5 Compare May 16, 2019 23:40

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]));
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants