Computation Function

Published: 06 July 2025

Known Uses

The Computation Function pattern is not widely used in the public domain, but there are several validation services available:

  • Geovalidation service: The Geovalidation service of the Dutch Cadastre (Kadaster) provides the capability to validate geometric data (such as areas of operation or locations) based on GML 3.2.2 SF2 (GML 3.2.2 Simple Feature profile level 2). The Geovalidation service generates a Validation Report, that can be retrieved or sent via a callback.
  • The Daisycon Energy API allows clients to submit customer-specific data, such as address and expected energy usage, to receive tailored energy pricing information. By processing these inputs to compute personalized offers, this API demonstrates the Computation Function pattern in practice.
  • Many linters are exposed as API endpoints (for example, you send code to /lint and receive a report). This is a classic example of the Computation Function pattern in practice. The API Design Rules Linter of the Dutch government is available both as an OAS Checker endpoint and via a command-line API Design Rules Validator interface. The ADR validator can be integrated into the Continuous Integration (CI) pipeline to automatically validate your API each time it is deployed.

Discussion Input

  • The Geovalidation service also offers a health check operation (GET /health). See also the Essent and Energiedirect API. Note, however, that since there is no input involved, this check operation is not strictly an example of the Computation Function.
  • The Computation Function pattern is very often implemented via a controller aka Processing Resource, like /calculate or /validate endpoints provided by the API implementation.
  • Validation functionality is often implemented upfront in an API. API providers should always perform validation prior to processing and explicitly state in the API contract that invalid input may be rejected (we believe).

Read the complete pattern on api-patterns.org

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top