Skip to content

Conversation

@mschaef-da
Copy link
Contributor

No description provided.

mschaef-da and others added 3 commits December 4, 2018 15:28
Update module name passed to debug so that it matches both the instru…
const matchUrlWithSchema = (reqUrl) => {
let url = parseUrl(reqUrl).pathname;
if (options.schema.basePath) {
url = url.replace(options.schema.basePath, '');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code will replace occurrences of the basepath that occur in the middle of the input URL. (As long as they are the first such instance.)

> const basePath = '/b';
undefined
> '/a/b/c/d'.replace(basePath, '')
'/a/c/d'

const responseSchema = resolveResponseModelSchema(req, res);
if (!responseSchema) {
debug('Response validation skipped: no matching response schema');
debug(`Response validation skipped: no matching response schema for ${req.method} ${req.originalUrl}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent behind these changes is to make it easier to see which requests are not covered by a given schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant