Skip to content

Bring the base to RFC 9457 conformance - #1

Merged
kinlane merged 1 commit into
mainfrom
rfc9457-conformance
Aug 17, 2026
Merged

kinlane merged 1 commit into
mainfrom
rfc9457-conformance

Conversation

@kinlane

@kinlane kinlane commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Found by running the new API Commons Problem Details Spectral ruleset against this file. Four findings, all real:

Severity Rule What
error problem-details-schema-is-object The Problem schema had properties but never declared type: object
warn problem-details-401-www-authenticate The 401 carried a problem body and no challenge. RFC 9110 §11.6.1 requires one — a problem detail explaining the 401 does not substitute for it
info problem-details-cites-obsoleted-rfc7807 externalDocs pointed at RFC 7807, obsoleted by RFC 9457 in July 2023
info problem-details-type-format-uri No format: uri on the type member

Also fixed, spotted while in here

  • The RateLimit header declared type: string with a list as its example. A type error that no OpenAPI linter catches, because examples aren't validated against their schema by default.
  • NotFound and Conflict were defined in components and referenced by nothing. The example operation now returns 404 and 409, so all seven responses in the base are actually reachable.
  • instance gains format: uri-reference.
  • info.description now names RFC 9457, explains that the retained urn:ietf:rfc:7807 namespace is deliberate, and links the ruleset.

Deliberately not touched

urn:ietf:rfc:7807 stays. RFC 9457 Appendix B retained that XML namespace for backward compatibility. It looks like a stale reference and isn't — the ruleset has a regression test specifically to keep it from being "corrected."

The servers warning from spectral:oas stays. Adding a placeholder server would just trip oas3-server-not-example.com. A base template with no server is right.

Needs your call — not changed

info.license says CC BY-NC-SA 4.0 while the repo LICENSE is Apache-2.0. A non-commercial clause on a base template people are meant to copy into their own APIs looks unintended, but relicensing isn't mine to do.

Verification

Lints clean under the ruleset (0 findings, down from 4), and still passes spectral:oas apart from the pre-existing servers warning.

Refs #9.

🤖 Generated with Claude Code

Found by running the new API Commons Problem Details Spectral ruleset against
this file. Four findings, all real:

- error  problem-details-schema-is-object       The Problem schema had
  `properties` but never declared `type: object`.
- warn   problem-details-401-www-authenticate   The 401 carried a problem body
  and no challenge. RFC 9110 Section 11.6.1 requires one; a problem detail
  explaining the 401 does not substitute for it.
- info   problem-details-cites-obsoleted-rfc7807  externalDocs pointed at
  RFC 7807, obsoleted by RFC 9457 in July 2023.
- info   problem-details-type-format-uri        No `format: uri` on the `type`
  member.

Also fixed, spotted while in here:

- The RateLimit header declared `type: string` with a LIST as its example.
- NotFound and Conflict were defined in components and referenced by nothing.
  The example operation now returns 404 and 409, so all seven responses in the
  base are actually reachable.
- `instance` gains `format: uri-reference`.
- info.description now names RFC 9457, explains that the retained
  `urn:ietf:rfc:7807` XML namespace is deliberate, and links the ruleset.

NOT changed, needs a human decision: info.license says CC BY-NC-SA 4.0 while
the repo LICENSE is Apache-2.0. A non-commercial clause on a base template
people are meant to copy into their own APIs looks unintended, but relicensing
is not mine to do.

The file now lints clean under the ruleset, and still passes spectral:oas apart
from the pre-existing `servers` warning — deliberately not "fixed", since a
placeholder server would fail oas3-server-not-example.com.

Refs #9.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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