Undocumented Operation Detection
Find operations the API serves but never documents, since undocumented routes are where authorization checks age worst
Use when: you have a description document and want to know what exists beyond it before trusting coverage numbers
Avoid when: the API has no published document at all, where everything you find is undocumented by definition
Procedure
- Extract the documented operation set from the description document, normalized to method plus path template.
- Collect observed operations from clients, gateway routes, logs you are entitled to see and your own crawling.
- Diff the two sets in both directions: served-but-undocumented and documented-but-not-served.
- For served-but-undocumented operations, determine the auth layer and whether any authorization check exists at all.
- Check versioned prefixes and internal-only routes, which are the usual home of stale operations.
- Report the undocumented set as coverage risk with the auth layer recorded for each entry.
Signals
- An operation responds successfully but never appears in any published document.
- An internal-looking route answers on the public gateway, which suggests routing configuration drift.
- Documented operations return 404, meaning the document describes a version that no longer exists.
- Undocumented operations skip middleware that documented routes pass through.
Patterns
1. Two-way diff
documented 128, observed 143 -> undocumented=15, unserved=0
GET /api/internal/metrics as member -> 200, undocumented, auth=none -> flag
2. Coverage number
coverage = documented_and_served / served
128/143 = 89.5% -> report the gap, not the flattering figure
3. Triage order
1 auth=none undocumented 2 admin-only undocumented 3 stale documented routes
Pitfalls
- Reporting coverage as document-only, which ignores everything the server actually serves.
- Testing undocumented routes without checking scope, since some are internal by design and excluded.
- Forgetting that a document can lag by one release, making the diff noisy until you account for timing.
Done when
- Both diff directions are computed and every undocumented operation has an auth layer recorded.
- Coverage is stated with its denominator, and undocumented auth-free routes are ranked first for review.