Skip to content

Dynamic OpenAPI configKey #3573

@fjtirado

Description

@fjtirado

Description

OpenAPI properties depends on configKey
For example, the property for the URL is of the form
quarkus.rest-client.<configKey>.url
configKey is currently calculated at build time (there are different alternatives based on the name and content of the openapi spec file being parsed, by default configKey is the sanitized file name)
The proposal is to allow dynamic calculation of configKey at runtime. This will allow appending extra information to the configKey calculated at build time.
For example, you can have different url properties depending on a cluster name

quarkus.rest-client.<buildTimeConfigKey>.cluster1.url=<cluster1Address>
quarkus.rest-client.<buildTimeConfigKey>.cluster2.url=<cluster2Address>

In order SonataFlow to know which information should be used to calculate configKey, users should add a new property, called sonataflow.rest-client.dynamic-config-key, which value must be a jq expression which evaluation will return the value of the dynamic configKey

For the previous example, assuming the workflow input has a clusterName which value is cluster1 or cluster2, users must add this line to application.properties.

sonataflow.rest-client.dynamic-config-key=.clusterName

Implementation ideas

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

🎯 Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions