Skip to content

Register the API Commons FHIR ruleset - #2

Merged
kinlane merged 1 commit into
mainfrom
register-fhir
Aug 17, 2026
Merged

kinlane merged 1 commit into
mainfrom
register-fhir

Conversation

@kinlane

@kinlane kinlane commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Adds api-common-fhir — 15 grounded rules for HL7 FHIR R4/R5 RESTful APIs.

Filed under industry: it encodes an HL7 specification, not a hardening posture.

notes records the two residuals rather than glossing them:

  • It governs the HTTP surface, not resource instances. Profile and IG conformance needs StructureDefinitions, terminology servers and the resource graph — none of which exist inside an OpenAPI. The HL7 validator remains the tool for that; this checks what the validator doesn't.
  • The resource list is the R4 ∪ R5 union deliberately, so flagging a valid R5 type on an R5 API can't happen. The cost, stated openly, is that an R4 API using an R5-only type passes.

Validated against a real server: the public HAPI FHIR R4 server's own generated OpenAPI, 2,973 paths, zero false positives on resource types. The 584 findings that remain there are real — HAPI's generated spec doesn't document the ETag/If-Match/409-412 concurrency contract even though the running server implements it.

Inserted as text rather than re-serialized, so the diff is +20 / −0. Validates against public/rulesets.schema.json; 19 entries.

Refs api-commons/api-commons#11.

🤖 Generated with Claude Code

Adds api-common-fhir — 15 grounded rules for HL7 FHIR R4/R5 RESTful APIs,
adoptable by `extends` against the raw URL or via npm.

Filed under `industry`: it encodes an HL7 specification, not a hardening posture.

`notes` records the two residuals rather than glossing them. It governs the HTTP
surface, not resource instances — profile and IG conformance needs
StructureDefinitions and terminology servers, so the HL7 validator remains the
tool for that. And the resource list is the R4 union R5 union deliberately, which
means an R4 API using an R5-only type is not caught.

Inserted as text, not re-serialized, so the diff is +20/-0. Validates against
rulesets.schema.json; 19 entries.

Refs api-commons/api-commons#11.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
kinlane added a commit to api-commons/api-commons that referenced this pull request Aug 17, 2026
New repo: api-commons/spectral-fhir-ruleset — 15 grounded rules for HL7 FHIR
R4/R5 RESTful APIs, following the OWASP and Problem Details pattern.

Registered in Ruleset Commons separately (api-commons/ruleset-commons#2).

Refs #11.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@kinlane
kinlane merged commit fb7b81e into main Aug 17, 2026
1 check passed
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.

1 participant