Skip to content

Conversation

@VShingala
Copy link
Member

This PR introduces option strictRequestMatching used for improved validation.

@VShingala VShingala requested a review from abhijitkane June 1, 2020 18:57
lib/options.js Outdated
id: 'strictRequestMatching',
type: 'boolean',
default: false,
description: 'Whether schema operations be strictly matched with collection request or not.',
Copy link
Member

Choose a reason for hiding this comment

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

the or not is redundant
Also, the requests are matched with operations, not the other way round
Whether requests should be strictly matched with schema operations. Setting to true will not include any matches where the URL path segments don't match exactly.

matchScore: schemaMatchResult.score,
pathVars: schemaMatchResult.pathVars
pathVars: schemaMatchResult.pathVars,
fixMatchedSegments: schemaMatchResult.fixMatchedSegments,
Copy link
Member

Choose a reason for hiding this comment

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

describe what these two are

fixMatchedSegments++;
}

// for variable match increase variable matched segments count (used for determining order for multiple matches)
Copy link
Member

@abhijitkane abhijitkane Jun 4, 2020

Choose a reason for hiding this comment

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

for /a/b/{{c}} and /a/b/{{c}}, is the fixMatchedSegments value supposed to be 2 or 3? If 2, the check should be moved after the variables check, right?
also, rename to fixedMatchedSegments everywhere

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah it would be 3 here, Moving fixMatchedSegments check after and in else if statements to variableMatchedSegments segment. so only one of them is valid per segment.

VShingala and others added 3 commits June 5, 2020 12:37
…estMatching and updated variable matching to be priorotized over fixed matching
Added support for missing endpoints in collection.
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.

3 participants