Skip to content
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

Merged

Conversation

timayabi2020
Copy link
Contributor

@timayabi2020 timayabi2020 commented Aug 23, 2023

Overview

Fixes #1314
Actual output
image

Expected output
image

@timayabi2020 timayabi2020 linked an issue Aug 23, 2023 that may be closed by this pull request
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))
Copy link
Member

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));
?

Copy link
Contributor Author

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

@sonarcloud
Copy link

sonarcloud bot commented Aug 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@timayabi2020 timayabi2020 marked this pull request as ready for review August 28, 2023 09:10
@timayabi2020 timayabi2020 requested a review from a team as a code owner August 28, 2023 09:10
@timayabi2020 timayabi2020 merged commit 7690046 into dev Aug 28, 2023
9 checks passed
@timayabi2020 timayabi2020 deleted the 1314-missing-language-snippets-for-openapi-based-sdks branch August 28, 2023 11:26
Ndiritu added a commit that referenced this pull request Sep 6, 2023
* 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>
Ndiritu added a commit that referenced this pull request Oct 24, 2023
* 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>
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.

Missing Language Snippets for OpenAPI based SDKs.
2 participants