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

[Fix] Resolves operation ids for $count and overloaded functions paths #386

Merged
merged 9 commits into from
May 25, 2023

Conversation

irvinesunday
Copy link
Collaborator

Fixes #383, #382

This PR:

  • Updates the operation id generation function for both $count and overloaded function paths.
  • Updates the release note.
  • Updates integration tests.

@irvinesunday irvinesunday marked this pull request as ready for review May 19, 2023 08:06
@sonarcloud
Copy link

sonarcloud bot commented May 23, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 4 Code Smells

92.0% 92.0% Coverage
0.0% 0.0% Duplication

@@ -309,24 +310,24 @@ internal static string GenerateODataTypeCastPathOperationIdPrefix(ODataPath path
string operationId = null;
if (secondLastSegment is ODataComplexPropertySegment complexSegment)
{
string listOrGet = complexSegment.Property.Type.IsCollection() ? "List" : "Get";
string listOrGet = includeListOrGetPrefix ? (complexSegment.Property.Type.IsCollection() ? "List" : "Get") : null;
Copy link
Member

Choose a reason for hiding this comment

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

Less work when we enable NRT this way

Suggested change
string listOrGet = includeListOrGetPrefix ? (complexSegment.Property.Type.IsCollection() ? "List" : "Get") : null;
string listOrGet = includeListOrGetPrefix ? (complexSegment.Property.Type.IsCollection() ? "List" : "Get") : string.Empty;

? entitySet.Name + "." + entitySet.EntityType().Name + ".List" + Utils.UpperFirstChar(entitySet.EntityType().Name)
: singleton.Name + "." + singleton.EntityType().Name + ".Get" + Utils.UpperFirstChar(singleton.EntityType().Name);
? entitySet.Name + "." + entitySet.EntityType().Name + $".{(includeListOrGetPrefix ? "List" : null)}" + Utils.UpperFirstChar(entitySet.EntityType().Name)
: singleton.Name + "." + singleton.EntityType().Name + $".{(includeListOrGetPrefix ? "Get" : null)}" + Utils.UpperFirstChar(singleton.EntityType().Name);
Copy link
Member

Choose a reason for hiding this comment

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

Singleton can technically be null here

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.

Duplicate operation ids for functions overloads
5 participants