Repository navigation
Bases, starters, RFC 9457 across the catalog, and a home for the rule catalog - #33
Merged
Merged
Conversation
… the catalog Finishes the last line of #9 — "reuse across all the base APIs we are developing" — and fixes the 7807 staleness flagged in this PR's own notes. THE THREE BASES. accounts, images and videos were description-and-tags stubs with no OpenAPI and no repo. All three now exist: api-commons/accounts list, create, read, merge-patch, close api-commons/images upload, metadata, renditions, deletion api-commons/videos upload, transcoding, renditions, captions, webhooks Each ships an OpenAPI 3.1, an APIs.json index, a README and Apache-2.0. The RFC 9457 error components are byte-identical across all three, composed from one shared block rather than written three times. Adopt more than one base and clients parse a single error format. That is the reuse the issue asked for. All three lint CLEAN under the Problem Details ruleset, and under spectral:oas apart from oas3-api-servers — deliberate, since a base template has no server and a placeholder would only trip oas3-server-not-example.com. Building them surfaced three real defects, now fixed: two operations missing descriptions and a Conflict response in images that no operation could return. Design choices carried into the bases rather than left implicit: merge-patch with the null-means-delete trap documented on the patch schema; conditional writes via ETag/If-Match/412; two-step upload so a failed upload does not lose metadata; renditions requested rather than enumerated; alt on images and captions as a first-class sub-resource on videos; and webhooks on videos, because video is not ready when the upload finishes and polling a status field is what every implementation regrets. RFC 7807 -> RFC 9457. The catalog cited an RFC obsoleted in July 2023, 22 times, with zero references to its replacement. Fixed at the SOURCE — spotlight-validator rules/all-rules.yaml and rules/spotlight-recommended.yaml — then regenerated with scripts/generate-spotlight.py, since _data/spotlight_rules.json is generated and a direct edit would be overwritten on the next build. rules/sources/* was deliberately NOT touched. Those are harvested third-party rulesets (team-digitale and others); rewriting them would misrepresent what those vendors actually publish. Three 7807 mentions remain on purpose, in the phrasing "RFC 9457, which obsoleted RFC 7807" — that is history, not a stale citation. Also: rules/index.html advertised 733 rules; the committed data has held 740 since the agentic-access rules landed. CAVEAT for whoever picks this up. spotlight-validator has no live remote (its origin is recorded as origin-defunct), so the source-side fix exists only in the local checkout. The generated output is committed here, but the next person to regenerate from a fresh clone will reintroduce the 7807 text unless that repo gets a home. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…lently spotlight-validator had no live remote — its origin 404s with no rename redirect, and the local checkout was the only copy of the 740-rule catalog behind apicommons.org/rules/ and /rulesets/. Restored to github.com/api-commons/spotlight-validator, PRIVATE. All 60 commits plus the RFC 7807 -> RFC 9457 pass are pushed. Private rather than public deliberately: the repo was removed from the org at some point, so republishing it is a decision to take on purpose, not a side effect of restoring a backup. Flip it if you want it public. Scanned before pushing — no credentials in the working tree or across the history. generate-spotlight.py now checks for the sibling checkout up front and exits with instructions instead of throwing a FileNotFoundError deep in the run. That silent path is exactly how a corrected catalog gets reverted: regenerate from a machine without the checkout and the output is rebuilt from whatever is on disk. README records the dependency and that the generated files must not be hand-edited. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Closes #13 and #14. New repo: api-commons/starters, surfaced here as a /starters/ collection alongside /base/. Starter OpenAPI OpenAPI 3.1, one resource, RFC 9457 errors Starter APIs.json APIs.json 0.22, one index, one API Starter JSON Schema JSON Schema 2020-12 ON #13. The issue is titled "Starter OpenAPI" but its body is an APIs.json document. Rather than guess which half was the mistake, both ship — they are different layers and both were missing. The body was specificationVersion 0.18; this is written against 0.22, the current schema. Starter is not base, and the section says so. A starter is the smallest document still correct and worth copying; a base is a full working template for a real domain. /starters/ links across to /base/ and back. The starter OpenAPI returns ZERO findings under both spectral:oas and the API Commons Problem Details ruleset. Deliberate: whatever someone builds on it starts from zero, so the first warning they see is one they introduced. A starter that ships with warnings teaches people to ignore warnings. Site plumbing: a `starters` collection in _config.yml and a starters layout derived from the base layout with the right link text. Verified the other six collections still build and the base pages are unaffected. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#32 merged while this was in flight, so the rest of #9 lands here. Builds on the layout fix that shipped in #32 — without it these base pages would not render.
Reuse across the base APIs
accounts,imagesandvideoswere description-and-tags stubs with no OpenAPI and no repo. All three now exist:Each ships an OpenAPI 3.1, an APIs.json index, a README, and Apache-2.0.
The RFC 9457 error components are byte-identical across all three, composed from one shared block rather than written three times. Adopt more than one base and your clients parse a single error format. That is the reuse the issue asked for.
All three lint clean under the ruleset, and under
spectral:oasapart fromoas3-api-servers— deliberate, since a base template has no server and a placeholder would only tripoas3-server-not-example.com. Building them surfaced three real defects, now fixed: two operations missing descriptions, and aConflictresponse in images that no operation could return.Design choices carried into the bases rather than left implicit: merge-patch with the null-means-delete trap documented on the patch schema; conditional writes via ETag/If-Match/412; two-step upload so a failed upload doesn't lose metadata; renditions requested rather than enumerated;
alton images and captions as a first-class sub-resource on videos; webhooks on videos, because video isn't ready when the upload finishes.RFC 7807 → RFC 9457
The catalog cited an RFC obsoleted in July 2023 22 times, with zero references to its replacement.
Fixed at the source —
spotlight-validator/rules/all-rules.yamlandrules/spotlight-recommended.yaml— then regenerated withscripts/generate-spotlight.py, since_data/spotlight_rules.jsonis generated and a direct edit would be overwritten on the next build.rules/sources/*was deliberately not touched. Those are harvested third-party rulesets (team-digitale and others). Rewriting them would misrepresent what those vendors actually publish.Three 7807 mentions remain on purpose, in the phrasing "RFC 9457, which obsoleted RFC 7807" — history, not a stale citation.
Also:
rules/index.htmladvertised 733 rules; the committed data has held 740 since the agentic-access rules landed.Site
_base/problem-details-for-http-apis.md—urlmoves to RFC 9457, and a Spectral Ruleset entry joins the others_base/accounts|images|videos.md— rebuilt from stubs, each pointing at its OpenAPI, APIs.json, repo, and the ruleset_common/error-codes.md— threeproblem-detailsrules undergovernance_rules, ruleset and base undertoolsREADME— the ruleset in the tools table, the three bases in the specs listOne layout fix, needed for any of it to render.
_layouts/base.htmlrendered onlyGitHubGistandGitHubRepository, giving every repo the hard-coded text "Visit this Base on GitHub". The ruleset would have shown up as a second one, andOpenAPI/APIsJSONproperties would have been dropped silently. Replaced with aResourceslist. Same class of trap as the_commonlayout: the layout renders a fixed set, so new frontmatter is invisible until the layout learns it.One caveat to hand on— RESOLVED, see belowspotlight-validatorhas no live remote — its origin is recorded asorigin-defunct. The source-side RFC fix exists only in the local checkout. The generated output is committed here, but the next person to regenerate from a fresh clone will reintroduce the 7807 text unless that repo gets a home.Related
info.licensesays CC BY-NC-SA 4.0 while the repo LICENSE is Apache-2.0.🤖 Generated with Claude Code
Added since this PR opened
spotlight-validator has a home again
The caveat above is resolved.
api-commons/spotlight-validator404'd with no rename redirect — the local checkout was the only copy of the 740-rule catalog behind/rules/and/rulesets/.Restored to api-commons/spotlight-validator, private. All 60 commits plus the RFC pass are pushed. Private rather than public on purpose: the repo was removed from the org at some point, so republishing is a decision to take deliberately, not a side effect of restoring a backup. Flip it if you want. Scanned before pushing — no credentials in the working tree or across the history.
generate-spotlight.pynow checks for the sibling checkout up front and exits with instructions, instead of throwing aFileNotFoundErrordeep in the run. That silent path is exactly how a corrected catalog gets reverted. The README records the dependency and that the generated files must not be hand-edited.Starters
Closes #13. Closes #14.
New repo: api-commons/starters, surfaced here as a
/starters/collection alongside/base/.On #13: it's titled "Starter OpenAPI" but its body is an APIs.json document. Rather than guess which half was the mistake, both ship — they're different layers and both were missing. The body was
specificationVersion: 0.18; this is written against 0.22, the current schema.Starter is not base, and the section says so. A starter is the smallest document still correct and worth copying; a base is a full working template for a real domain. The two link to each other.
The starter OpenAPI returns zero findings under both
spectral:oasand the Problem Details ruleset. Deliberate — whatever you build on it starts from zero, so the first warning you see is one you introduced. Writing it caught two defects in my own first draft: 401 and 429 were sharing a generic problem response, so neither carried the header its status code requires.validate.pychecks more than well-formedness, with no Node dependency: the JSON Schema starter's ownexamplesare validated against the properties they sit on; the APIs.json starter validates against the schema fetched live fromapis-json/api-jsonrather than a vendored copy that would drift; and the OpenAPI starter'sProblemschema is checked against RFC 9457 member types.Site plumbing: a
starterscollection in_config.ymland astarterslayout derived from the base layout. Verified the other six collections still build and the base pages are unaffected.