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

Expand value overrides mechanism to allow the value to be dynamically resolved from a value in the request message #413

Closed
3 tasks
MLenterman opened this issue Jul 4, 2024 · 0 comments
Assignees
Labels
feature New feature or request

Comments

@MLenterman
Copy link
Collaborator

Currently it is already possible with the value overrides mechanism to override an empty value with a static value configured in the valueOverrides section of the translation profile. We would like to expand this to allow the override value to be dynamically resolved from some element's value in the request message instead. The most straight-forward way is to introduce a variable substitution mechanism in the value property, which is resolved during runtime.

  • Introduce a variable substitution mechanism that can be applied to the value field of a value override in a translation profile. Just ${} should do.
  • Allow for a xpath to be provided within the variable substitution syntax that will be applied on the referenced "context". There could be multiple contexts in the future, but for now only current should be implemented, which represents the current resource that is being translated from the request message. The reason for having current as context instead of request, is to allow for a xpath relative to the resource that is being translated. For example: If there are multiple roles present in the request message - you could use ${current://extraElement[@name = 'kvkNummer']} to use the value of "extraElement" for the specific role that is being translated. Otherwise it would not be possible to distinguish with role's "extraElement" value should be taken.
  • Document feature in Docusaurus. Also specific what the root element can be expected for the "zgw.zaken-api.rollen.rol" resource when using the "current" context.

Syntax: ${<context>:<xpath>} for example: ${current://some/xpath/to/the/value}

@MLenterman MLenterman added the feature New feature or request label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants