API Design & Governance
OverviewReferencesSession prep
Course
0/15
  1. 1Design-First Foundations
    • Why design-first
    • RAML vs OAS
    • Your first spec in API Designer
  2. 2Reuse & Fragments
    • Exchange as the reuse hub
    • Spec fragments & dependencies
    • Semantic versioning for APIs
  3. 3API Governance
    • Rulesets & conformance
    • Encoding org API standards
    • Automated conformance checks
  4. 4Lifecycle & Publishing
    • The mocking service
    • Publishing & the developer portal
    • Graceful deprecation
  5. 5Coaching the Rollout
    • Positioning design-first
    • Aligning with the C4E
    • Objections as coaching moments
References Session prep
API Governance

Rulesets & conformance

7 min · 55 XP · Read → Check → Complete


Governance as code

Anypoint API Governance evaluates specs against rulesets and reports a conformance status. A ruleset is a set of machine-checkable rules — written in the Spectral-style format — applied to RAML or OAS specs in Exchange.

A small ruleset example

rules:
  resource-name-plural:
    message: Resource paths should use plural nouns
    severity: warning
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: "^/[a-z]+s(/.*)?$"
  response-must-describe-errors:
    message: Every operation must document a 4xx response
    severity: error
    given: $.paths[*][*].responses
    then:
      field: "400"
      function: truthy

How conformance works

  • Rulesets are published to Exchange and applied to a set of APIs.
  • Each API gets a conformance report — pass, warnings, or errors.
  • Governance gives a program-wide view of which APIs meet standards.

Coaching note

Introduce governance as warnings before errors. A ruleset that blocks on day one breeds resentment; one that surfaces gaps, then tightens over time, builds trust in the standard.

Check your understanding
  1. 1. What does an API Governance ruleset evaluate?

  2. 2. How should you coach a customer to introduce a new ruleset?

  3. 3. What format are rulesets written in on Anypoint Platform?

  4. 4. Where are rulesets published for reuse?

  5. 5. What view does API Governance provide for a program?

  6. 6. What does a conformance report show?

Encoding org API standards