Skip to content

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

@MLenterman

Description

@MLenterman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions