There are occasions when out of the box policies won't be able to provide the behaviors required of the API platform as they are rather unusual or specific to the context in which the platform is being used. These scenarios maybe addressed through the use of a callout a policy that invokes a separately managed piece of logic. However, this approach could be cumbersome in some cases, such as:
- Applying special payload validation rules
- Routing based on runtime conditions, for example, using a microservice registry to handle help determine the URI of a service instance to call
- Dynamically segmenting the workload based on the attributes of an API call
Therefore, it becomes necessary to have the means to create a custom policy or in special cases even create a bespoke or use a third party provided policy.
Within the API platform, there is custom and...