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.
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 calledzaakbrug.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.
[ ] 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, thezaakbrug.zgw.<api-name>-api.version
fallback should be used aswell with a warning being thrown.