Skip to content

feat: add EL resolution for dynamic subscription form options - domai…#16065

Open
JedrzejJanasiak wants to merge 1 commit intomasterfrom
apim-12990-el-domain
Open

feat: add EL resolution for dynamic subscription form options - domai…#16065
JedrzejJanasiak wants to merge 1 commit intomasterfrom
apim-12990-el-domain

Conversation

@JedrzejJanasiak
Copy link
Copy Markdown
Contributor

@JedrzejJanasiak JedrzejJanasiak commented Mar 27, 2026

Issue

https://gravitee.atlassian.net/browse/APIM-12990

Description

PR 1/2 — Domain & infrastructure layer for EL-based resolution of dynamic subscription form options.

This PR adds:

  • SubscriptionFormElResolverDomainService interface with resolveSchemaOptions and resolveConstraints methods
  • SubscriptionFormElResolverDomainServiceImpl — resolves EL expressions (e.g. ${api.metadata['key']}:fallback) against API and environment metadata; falls back gracefully on resolution failure
  • Constraint model extended with DynamicOneOf / DynamicEachOf variants for EL-driven constraints
  • SubscriptionFormSchema extended with DynamicOptionsAttribute carrying the raw EL expression and parsed fallback values
  • SubscriptionFormConstraintsFactoryconstraintsFor broken into focused private helpers to reduce cyclomatic complexity (Sonar)
  • GetSubscriptionFormForEnvironmentUseCase.Input migrated to Lombok @Builder
  • ApiMetadataQueryService#findEnvironmentMetadata — returns global/environment-level metadata without API overrides, used to populate EL template context when no API context is available
  • In-memory doubles: SubscriptionFormElResolverInMemory, updated ApiMetadataQueryServiceInMemory

Not in this PR (coming in PR 2/2):

  • REST resource changes (management v2 and portal endpoints)
  • OAS spec updates
  • Portal endpoint moved from env-level to API-level (/apis/{apiId}/subscription-form)

Additional context

Previous in chain: #15918 (apim-12990-validation-resource — validation constraints at resource layer)

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@JedrzejJanasiak JedrzejJanasiak force-pushed the apim-12990-validation-resource branch from 8063362 to 8b03cb6 Compare March 27, 2026 16:10
Base automatically changed from apim-12990-validation-resource to master March 30, 2026 07:33
@JedrzejJanasiak JedrzejJanasiak force-pushed the apim-12990-el-domain branch 2 times, most recently from 39aeb89 to a20e4b7 Compare March 30, 2026 09:28
@JedrzejJanasiak JedrzejJanasiak marked this pull request as ready for review March 30, 2026 10:10
@JedrzejJanasiak JedrzejJanasiak requested a review from a team as a code owner March 30, 2026 10:10
@JedrzejJanasiak JedrzejJanasiak force-pushed the apim-12990-el-domain branch 2 times, most recently from 7e12ef3 to c5f9223 Compare March 31, 2026 14:53
Copy link
Copy Markdown
Contributor

@dev-marek dev-marek left a comment

Choose a reason for hiding this comment

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

some more mostly about styling

…n layer

Introduces SubscriptionFormElResolverDomainService with EL-based resolution of dynamic schema options and constraints, backed by API/environment metadata. Extends Constraint and SubscriptionFormSchema models with dynamic variants. Adds ApiMetadataQueryService#findApiMetadata and introduces no-context overloads that return fallbacks directly when no API context is available.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

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.

2 participants