-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes matching of segments with overloaded bound functions #1727
Fixes matching of segments with overloaded bound functions #1727
Conversation
var pathSegment = HttpUtility.UrlDecode(pathSegments.First()); | ||
var childNode = node.Children.FirstOrDefault(x => TrimNamespace(x.Key).Equals(pathSegment)).Value; | ||
if (childNode != null) | ||
if (overloadedBoundedFunctionWithSingleOrMultipleParameters.IsMatch(pathSegment)) |
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.
I believe this would be duplicating functionality already captured in line 241 and 243 by calling IsFunctionWithParameters
and IsFunctionWithParametersMatch
.
Maybe the issue is with the regex at
private static readonly Regex FunctionWithParameterRegex = new(@"\([\w\s\d=':${}<>|\-,]+\)", RegexOptions.Compiled, TimeSpan.FromMilliseconds(200)); |
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.
Thanks. Its indeed a duplicate. I will update the regex
Kudos, SonarCloud Quality Gate passed! |
* Fixes matching of segments with overloaded bound functions (#1727) * Fix for issue 1314 * Rectified tests error * Rolled back snippet model. Updated FunctionWithParameter regex * Bump apidoctor from `6b40b1e` to `803295e` (#1732) Bumps [apidoctor](https://github.com/OneDrive/apidoctor) from `6b40b1e` to `803295e`. - [Commits](OneDrive/apidoctor@6b40b1e...803295e) --- updated-dependencies: - dependency-name: apidoctor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use correct parameter name for request body in api call (#1733) * Bump Microsoft.NET.Test.Sdk from 17.7.1 to 17.7.2 (#1735) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.7.1 to 17.7.2. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](microsoft/vstest@v17.7.1...v17.7.2) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improve PHP snippets (#1726) * Fix PHP model variable name casing when setting null values * Fix PHP model variable casing for streams * Initialise streams using Guzzle PSR-7 util method * Escape reserved words in fluent API path * Replace value identifier in fluent API path * Generate correct request configuration object name for indexed collections * Replace 'me' with 'UserItem' prefix when naming request config objects * Replace reserved keywords in request body setters * Escape dollar signs in query parameter values * Removes underscores from setter names * Simplify indexer method naming * Fix request config name for odata cast URLs * Apply SonarCloud recommendations * Apply suggestions from code review Co-authored-by: Eastman <andrueastman@users.noreply.github.com> * Uppercase first character of prefixes --------- Co-authored-by: Eastman <andrueastman@users.noreply.github.com> * Bump Microsoft.OpenApi from 1.6.6 to 1.6.7 (#1738) Bumps [Microsoft.OpenApi](https://github.com/Microsoft/OpenAPI.NET) from 1.6.6 to 1.6.7. - [Release notes](https://github.com/Microsoft/OpenAPI.NET/releases) - [Commits](microsoft/OpenAPI.NET@1.6.6...1.6.7) --- updated-dependencies: - dependency-name: Microsoft.OpenApi dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Microsoft.OpenApi.Readers from 1.6.6 to 1.6.7 (#1737) Bumps [Microsoft.OpenApi.Readers](https://github.com/Microsoft/OpenAPI.NET) from 1.6.6 to 1.6.7. - [Release notes](https://github.com/Microsoft/OpenAPI.NET/releases) - [Commits](microsoft/OpenAPI.NET@1.6.6...1.6.7) --- updated-dependencies: - dependency-name: Microsoft.OpenApi.Readers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update permissions file source used to generating permissions tables for docs (#1740) * Bump actions/checkout from 3 to 4 (#1742) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump apidoctor from `803295e` to `f83ee75` (#1741) Bumps [apidoctor](https://github.com/OneDrive/apidoctor) from `803295e` to `f83ee75`. - [Commits](OneDrive/apidoctor@803295e...f83ee75) --- updated-dependencies: - dependency-name: apidoctor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Merge Snippet Gen and Clean up of Unused Snippets Pipelines (#1739) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Tim <timwamalwa@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Samwel K <40166690+samwelkanda@users.noreply.github.com> Co-authored-by: Eastman <andrueastman@users.noreply.github.com> Co-authored-by: Millicent Achieng <achieng.milli@gmail.com> Co-authored-by: Faith Kangai <fey101@users.noreply.github.com>
* Fixes matching of segments with overloaded bound functions (#1727) * Fix for issue 1314 * Rectified tests error * Rolled back snippet model. Updated FunctionWithParameter regex * Bump apidoctor from `6b40b1e` to `803295e` (#1732) Bumps [apidoctor](https://github.com/OneDrive/apidoctor) from `6b40b1e` to `803295e`. - [Commits](OneDrive/apidoctor@6b40b1e...803295e) --- updated-dependencies: - dependency-name: apidoctor dependency-type: direct:production ... * Use correct parameter name for request body in api call (#1733) * Bump Microsoft.NET.Test.Sdk from 17.7.1 to 17.7.2 (#1735) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.7.1 to 17.7.2. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](microsoft/vstest@v17.7.1...v17.7.2) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... * Improve PHP snippets (#1726) * Fix PHP model variable name casing when setting null values * Fix PHP model variable casing for streams * Initialise streams using Guzzle PSR-7 util method * Escape reserved words in fluent API path * Replace value identifier in fluent API path * Generate correct request configuration object name for indexed collections * Replace 'me' with 'UserItem' prefix when naming request config objects * Replace reserved keywords in request body setters * Escape dollar signs in query parameter values * Removes underscores from setter names * Simplify indexer method naming * Fix request config name for odata cast URLs * Apply SonarCloud recommendations * Apply suggestions from code review * Uppercase first character of prefixes --------- * Bump Microsoft.OpenApi from 1.6.6 to 1.6.7 (#1738) Bumps [Microsoft.OpenApi](https://github.com/Microsoft/OpenAPI.NET) from 1.6.6 to 1.6.7. - [Release notes](https://github.com/Microsoft/OpenAPI.NET/releases) - [Commits](microsoft/OpenAPI.NET@1.6.6...1.6.7) --- updated-dependencies: - dependency-name: Microsoft.OpenApi dependency-type: direct:production update-type: version-update:semver-patch ... * Bump Microsoft.OpenApi.Readers from 1.6.6 to 1.6.7 (#1737) Bumps [Microsoft.OpenApi.Readers](https://github.com/Microsoft/OpenAPI.NET) from 1.6.6 to 1.6.7. - [Release notes](https://github.com/Microsoft/OpenAPI.NET/releases) - [Commits](microsoft/OpenAPI.NET@1.6.6...1.6.7) --- updated-dependencies: - dependency-name: Microsoft.OpenApi.Readers dependency-type: direct:production update-type: version-update:semver-patch ... * Update permissions file source used to generating permissions tables for docs (#1740) * Bump actions/checkout from 3 to 4 (#1742) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... * Bump apidoctor from `803295e` to `f83ee75` (#1741) Bumps [apidoctor](https://github.com/OneDrive/apidoctor) from `803295e` to `f83ee75`. - [Commits](OneDrive/apidoctor@803295e...f83ee75) --- updated-dependencies: - dependency-name: apidoctor dependency-type: direct:production ... * Merge Snippet Gen and Clean up of Unused Snippets Pipelines (#1739) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Millicent Achieng <achieng.milli@gmail.com> Co-authored-by: Eastman <andrueastman@users.noreply.github.com> Co-authored-by: Tim <timwamalwa@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Samwel K <40166690+samwelkanda@users.noreply.github.com> Co-authored-by: Faith Kangai <fey101@users.noreply.github.com>
Overview
Fixes #1314
Actual output
Expected output