Skip to content

Schemas

The shapes the operations read and return, as the document declares them. A property whose type is another schema links to it rather than repeating it, because it is one shape and not several.

One line of the service log: one try at one delivery.

(object, no other properties)

Property
atWhen it was tried. (string, required)
attempt1 to 5. (integer, required)
delivery(string, required)
endpoint(string, required)
error(string or null, required)
outcome(string, required, one of delivered, failed)
retry_atWhen this delivery becomes due again, or null when it landed or has used all 5 attempts. The schedule after the first attempt is 60, 300, 1800, 7200 seconds. (string or null, required)
statusThe subscriber’s status code, or null where no response was had at all. A 4xx or a 5xx is a refusal rather than an absence and is retried the same. (integer or null, required)
subscription(string, required)

(object, no other properties)

Property
attempts(array of Attempt, required)

One atom change of one published release.

(object, no other properties)

Property
atomThe obligation atom that moved. (string, required)
changeThe manifest’s own word: added, changed, removed or deprecated. (string, required)
citationThe change’s citation, copied out of the release’s diff manifest unaltered. Its shape is the release plane’s — an eId, the quoted text and the character span it occupies in the source — and this service restates none of it. (object, required)
classificationSubstantive or editorial, copied from the manifest. The release plane decided it from the amending act’s own recitals, and this service does not re-decide it: a second reading would eventually disagree with the one the release shipped, and a consumer could not tell which was the release’s answer. (string, required)
classification_basisWhy the classification is what it is, again the manifest’s own. (string, required)
detailWhat the change was, as the manifest states it: the atom before and after, and the amending instruction responsible. (object, required)
facetsWhat a filter is written against. The manifest states none of it: entity_types is the atom’s applies_to and jurisdiction is that of the unit the atom cites, both read out of the release’s own corpus bundle once at publication and stored — so a feed request is a query, and the feed keeps saying what it said after the checkout has moved on. (object, required, no other properties)
facets.entity_types(array of string, required)
facets.jurisdiction(array of string, required)
facets.regime(string, required)
facets.topics(array of string, required)
idopenregs:<regime>@<tag>:<atom id> — permanent, and a function of the release and the atom, so re-announcing a release cannot make an old change look new. A reader that has seen this id has seen this change. (string, required)

One payload owed to one subscriber. The payload bytes are not in it: they are in the store, and what a reader of this endpoint needs is the state and the schedule.

(object, no other properties)

Property
attemptsHow many attempts have been made. (integer, required)
created_at(string, required)
event(string, required, one of release.published)
idA function of the subscription and the payload bytes, so it is stable across a re-announcement and worth deduplicating on. It travels on the X-OpenRegs-Delivery header of the POST. (string, required)
last_error(string or null, required)
next_attempt_atWhen it becomes due again; null when it is not waiting. (string or null, required)
regime(string, required)
signaturesha256=<hex> over the payload bytes. (string, required)
state(string, required, one of delivered, exhausted, pending)
subscription(string, required)
tag(string, required)

(object, no other properties)

Property
deliveries(array of Delivery, required)

The release’s own diff manifest, served verbatim. Its shape belongs to the release plane, which is why this schema is open: it names the members a client needs to navigate and leaves the rest to the artifact.

(object)

Property
changesEvery change the release reported, atom and unit alike. The feed fans out only the atom ones; both are here, because this is the manifest and not a projection of it. (array of any, required)
regime(string, required)
tag(string, required)

The one refusal shape this service uses, on every failure path it owns. It carries a sentence and nothing else: no code to branch on and no correlation id, which is a real difference from the serving API and is stated here rather than left for a client to discover. The one refusal not in this shape is the standard library’s 501 for a method the handler implements nothing for, which is HTML and belongs to no route.

(object, no other properties)

Property
errorWhat went wrong, in words a caller can act on. (string, required)

What one publication announced, owed, and managed to hand over.

(object, no other properties)

Property
attemptsThe first attempt at each delivery, made inline. (array of Attempt, required)
deliveriesCreated by this publication, in subscription order. (array of Delivery, required)
publication(Publication, required)
silentSubscriptions this release matched nothing for, and which were therefore not written to. Named rather than omitted, because ‘nobody heard’ and ‘this one did not’ are different answers. (array of string, required)

(object, no other properties)

Property
base_urlWhat the links in this instance’s feeds are written against. It is the bound address unless --base-url said otherwise, which is what a deployment behind a proxy sets. (string, required)
feeds(object, required, no other properties)
feeds.json(string, required)
feeds.rss(string, required)
filtersThe dimensions a filter may name. (array of string, required)
service(string, required)
signatureHow to verify a delivery, said where a subscriber will look. (object, required, no other properties)
signature.algorithm(string, required)
signature.header(string, required)
signature.over(string, required)

The four dimensions a subscription or a feed request may narrow on, each a sorted list of terms. A dimension left empty matches everything; a dimension with terms matches a change carrying any of them, and every named dimension must match — so a filter is an and of ors.

entity_type is the one dimension where membership is not the test: the taxonomy’s parent relation decides, so an obligation declared on a broader type reaches a subscription for a narrower one and not the other way round. topic matches nothing today, because no atom in the corpus carries a subject vocabulary yet; it is wired rather than removed so that subscriptions written against it start matching the day one lands.

(object, no other properties)

Property
entity_type(array of string, required)
jurisdiction(array of string, required)
regime(array of string, required)
topic(array of string, required)

A JSON Feed 1.1 document. Its members are the JSON Feed specification’s and are not restated here; the schema names version and items because a client needs them to navigate, and describes the _openregs member because that one is this project’s, in the _-prefixed namespace the specification reserves for extensions.

(object)

Property
_openregsThe filter this document was rendered for, echoed back. (object, no other properties)
_openregs.filter(Filter, required)
_openregs.schema_version(integer, required)
items(array of JsonFeedItem, required)
version(string, required)

One JSON Feed item. title, content_text, date_published and tags are the specification’s members, carried as it defines them.

(object)

Property
_openregsThe change in the same shape a webhook payload states it, so a consumer that polls the feed and a consumer that is pushed to read one document and not two. (object, no other properties)
_openregs.change(Change, required)
_openregs.release(ReleaseRef, required)
idThe feed item id; see Change.id. (string, required)
urlThe release’s diff manifest on this service, with the atom id as the fragment. A link and not a decoration: it resolves. (string, required)

One release this service has announced.

(object, no other properties)

Property
as_of(string, required)
built_at(string, required)
changesHow many atom changes were announced. (integer, required)
commit(string, required)
diff_manifest(string, required)
published_atWhen this service was told about the release. A genuine event, and the reason it is stored and not what an item is dated by. (string, required)
regime(string, required)
tag(string, required)

Which built release to announce. A member this operation does not read is ignored rather than refused — see the operation’s request body.

(object)

Property
regimeThe regime whose release this is. (string, required)
tagThe release tag, as it was built. (string, required)

The release a change was announced from.

(object, no other properties)

Property
as_ofThe date the release’s texts speak from. (string, required)
built_atThat commit’s committer date, and every date this feed publishes. A feed entry is content, and content derived from a commit is dated by it. (string, required)
commitThe canon commit it was compiled from. (string, required)
diff_manifestThe manifest filename inside the release directory. (string, required)
regime(string, required)
tag(string, required)

An RSS 2.0 document with an Atom self-link. RSS is a specified format and is not restated here.

(string)

A registered subscription. The signing secret is deliberately not a property of this schema, because it is in no response.

(object, no other properties)

Property
activeWhether a publication fans out to it. (boolean, required)
created_atWhen the registration happened — a real moment, and one of the two things in this service that a commit cannot date. (string, required)
endpointWhere a matching change is POSTed. (string, required)
filter(Filter, required)
idMinted as sub-0001 when none was given. (string, required)
nameDefaults to the endpoint. (string, required)

(object, no other properties)

Property
subscription(Subscription, required)

(object, no other properties)

Property
subscriptions(array of Subscription, required)

What a registration states. A member this operation does not read is ignored rather than refused; the one thing inside it that is refused is a filter naming something that is not a dimension.

(object)

Property
activeDefaults to true. (boolean)
endpointAn http(s) URL. Cleartext http only to loopback — see the operation’s description for why. (string, required)
filterA filter as a caller writes it. Any dimension may be omitted, and a bare string is read as a one-element list. A key that is not a dimension is refused, not ignored — this is the one place in a request body where that is true, and it is true because a subscriber who misspells a dimension and is quietly registered for everything has been widened without being told. The schema is left open rather than closed because the service reads a plural by stripping trailing letters, so the exact set of spellings it tolerates is wider than the eight named here, and a schema claiming a refusal the service does not make would be the first false sentence in this document. (object)
filter.entity_typeOne entity_type term or a list of them. Both the singular and the plural spelling are read. (any)
filter.entity_typesOne entity_type term or a list of them. Both the singular and the plural spelling are read. (any)
filter.jurisdictionOne jurisdiction term or a list of them. Both the singular and the plural spelling are read. (any)
filter.jurisdictionsOne jurisdiction term or a list of them. Both the singular and the plural spelling are read. (any)
filter.regimeOne regime term or a list of them. Both the singular and the plural spelling are read. (any)
filter.regimesOne regime term or a list of them. Both the singular and the plural spelling are read. (any)
filter.topicOne topic term or a list of them. Both the singular and the plural spelling are read. (any)
filter.topicsOne topic term or a list of them. Both the singular and the plural spelling are read. (any)
idMinted when absent; must not already exist. (string)
nameDefaults to the endpoint. (string)
secretThe key deliveries to this endpoint are signed with. Held by this service and by the subscriber, and returned by no response. (string, required)

(object, no other properties)

Property
removedThe id that is now gone. (string, required)

The document POSTed to a subscriber. Its bytes are a function of the release and the filter — sorted keys, two-space indent, one trailing newline — which is what makes the signature reproducible and the delivery id stable.

(object, no other properties)

Property
changesOnly the changes this subscription’s filter matched. (array of Change, required)
counts(object, required, no other properties)
counts.changes(integer, required)
event(string, required)
filter(Filter, required)
release(ReleaseRef, required)
schema_version(integer, required)
subscriptionWhich subscription this delivery answers. (string, required)

Rendered from openregs/openregs@f3a2d10:docs/reference/feed-openapi.json