FM-010 Authentication, Authorization, and Security

OpenAPI Specification and Implementation Drift

The published spec no longer matches actual behavior — required fields treated as optional, documented status codes never returned, undocumented errors sent.

Failure explanation

The published OpenAPI document and the running service disagree. The document may define the wrong method, path, parameter, required field, media type, response schema, or status code. Consumers generate SDKs and tests from the specification, so even a small discrepancy can cause integration failures. Drift can arise because the spec is manually maintained or deployment versions are not synchronized.

Example

OpenAPI says GET /customers/{id} returns a 404 response for an unknown customer. The deployed service returns HTTP 200 with {"error":"NOT_FOUND"}, so generated clients treat the request as successful.

How to test

  • Send contract-derived requests to the deployed endpoint.
  • Validate actual status, headers, content type, and body against every relevant response schema.
  • Test required parameters, request bodies, and documented error cases.
  • Compare the spec artifact to the version deployed with the service.

Expected behavior

The published specification describes observable behavior. Any intentional deviations are documented, and contract checks run in CI/CD to prevent drift.

Runnable examples

Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.