Skip to content

Fixed Subscription API Detection#36

Merged
hdamker merged 3 commits intocamaraproject:mainfrom
hdamker:30-fix-subscription-api-detection
Jul 14, 2025
Merged

Fixed Subscription API Detection#36
hdamker merged 3 commits intocamaraproject:mainfrom
hdamker:30-fix-subscription-api-detection

Conversation

@hdamker
Copy link
Copy Markdown
Contributor

@hdamker hdamker commented Jul 13, 2025

What type of PR is this?

  • correction

What this PR does / why we need it:

Refined the detection of the API type (Regular API, Implicit Subscriptions, Explicit Subscriptions.
Details below in "Additional documentation"

Which issue(s) this PR fixes:

Fixes #30

Special notes for reviewers:

Tested with:

Note: all API types identified correctly. For the scope naming issues for Explicit Subscription APIs opened #35

Changelog input

 release-note

Additional documentation

  • Added API name parameter: Modified _detect_api_type() to accept an optional api_name parameter and use it to check if the API follows CAMARA naming conventions (ends with -subscriptions)
  • Fixed schema detection logic: Replaced the broad check that flagged any schema with "subscription" in its name; now only considers it an event subscription schema if it contains a subscriptionId property
  • Stored API name as instance variable: Added _current_api_name to store the API name when processing, allowing other validation methods to access it without passing it as a parameter
  • Decision based on multiple factors: Changed from immediately returning EXPLICIT_SUBSCRIPTION when finding "subscription" in schema names to collecting evidence and making the decision based on both API naming convention and presence of event subscription properties

@hdamker hdamker requested review from Kevsy and rartych as code owners July 13, 2025 19:27
Copy link
Copy Markdown
Contributor

@rartych rartych left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@Kevsy Kevsy left a comment

Choose a reason for hiding this comment

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

LGTM

@hdamker hdamker merged commit 84fac32 into camaraproject:main Jul 14, 2025
1 check passed
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.

CAMARA API Review Trigger: false positive if 'Subscription' in API name

3 participants