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

Fetch ZGW API version dynamically from an OpenAPI spec provided by a configured OpenAPI spec download endpoint #419

Open
5 tasks
MLenterman opened this issue Jul 10, 2024 · 0 comments
Labels
feature New feature or request

Comments

@MLenterman
Copy link
Collaborator

For backwards compatibility and the ability to use the newest ZGW API functionality, we need to create conditional alternate execution paths based on the version of the API we are communicating with. For example the recently added "expand" mechanism that is only available from a certain version of the API's.

Currently it is possible to configure a DeploymentSpecifics property called zaakbrug.zgw.<api-name>-api.version to base these conditions on. We would like to have an additional property per API called zaakbrug.zgw.<api-name>-api.oas-endpoint to configure an endpoint where the OpenAPI spec for that API can be downloaded. Once downloaded, we can fetch the API version number from the OpenAPI spec.

  • Adapter for downloading an OpenAPI spec from a provided url.

    • Cache the downloaded OpenAPI spec.
    • Provide a mechanism to pass in a JsonPath to the adapter, apply it to the OpenAPI spec and return the result as string. Return the whole OpenAPI spec as default if no JsonPath is provided.
    • Error should be thrown if OpenAPI can't be downloaded.
  • Call above adapter once in any adapter that uses zaakbrug.zgw.<api-name>-api.version property. Store as sessionKey.

  • OpenAPI spec download adapter should not be called if no "oas-endpoint" is configured. Instead fallback to zaakbrug.zgw.<api-name>-api.version. If an error occurs while downloading the OpenAPI spec, the zaakbrug.zgw.<api-name>-api.version fallback should be used aswell with a warning being thrown.

@MLenterman MLenterman added the feature New feature or request label Jul 10, 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

1 participant