Skip to content

Conversation

@andreyyudin
Copy link
Contributor

Closes #7

Summary

This PR adds a new Spectral rule enforcing that all OpenAPI specifications explicitly declare the leading business capability through the info.x-leading-capability field. This ensures every API is traceable to its primary business capability as defined in LeanIX.

Changes Made

Spectral Rule: info-leading-capability

  • Introduced a new rule requiring info.x-leading-capability in all OpenAPI files.

  • Validation checks that the value matches one of the approved UKHSA Business Capabilities.

  • Custom error message for violations:

    Missing or wrong 'info.x-leading-capability', should be a valid UKHSA Business Capability.

UKHSA Business Capabilities List

Documentation Updates

  • Extended API linting documentation with details of the new rule.
  • Included guidance on how to set the correct x-leading-capability value and fix validation errors.

Example Specifications

  • Added valid and invalid OpenAPI examples to demonstrate compliance and failure scenarios.

    • Valid example includes a correct info.x-leading-capability value.
    • Invalid examples cover missing or unrecognized capability names.

@andreyyudin andreyyudin requested a review from a team as a code owner November 5, 2025 13:58
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

Test Results

 1 files  ±0   9 suites  +2   10s ⏱️ ±0s
54 tests +6  54 ✅ +6  0 💤 ±0  0 ❌ ±0 
55 runs  +6  55 ✅ +6  0 💤 ±0  0 ❌ ±0 

Results for commit ca47925. ± Comparison against base commit 262285b.

@milkshakeuk milkshakeuk force-pushed the main branch 3 times, most recently from 6ea8b57 to e3cca53 Compare November 13, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create spectral rule to mandate inclusion of leading business capability

2 participants