This repository was archived by the owner on Mar 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
RFC0015: Schema resource #28
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
71eef86
Add RFC for the schema resource
356baf0
Assign number 0015
7d43be1
Start document for defining how to get the schema
d722373
Remove old schema-api
df6f61d
Make explicit where datatypes are described
6357928
Reject RFC0015
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| --- | ||
| rfc: 0015 | ||
| start_date: 2018-02-09 | ||
| pr: openregister/registers-rfcs#28 | ||
| status: rejected | ||
| --- | ||
|
|
||
| # Schema resource | ||
|
|
||
| This RFC has been rejected (see comments | ||
| https://github.com/openregister/registers-rfcs/pull/28). | ||
|
|
||
| In summary, this resource doesn't fit well with the broader metadata stream of | ||
| work. Schema will be addressed in a future RFC. | ||
|
|
||
| ## Summary | ||
|
|
||
| This RFC proposes a schema resource to describe the register set of attributes | ||
| with their datatypes. | ||
|
|
||
|
|
||
| ## Motivation | ||
|
|
||
| The current mechanisms to get information about the schema are the `GET | ||
| /register` endpoint or the Register register complemented with the Field | ||
| register. It is cumbersome to get the full picture of the schema and, even | ||
| more the day the schema gets the ability to evolve. | ||
|
|
||
|
|
||
| ## Explanation | ||
|
|
||
| Note: All datatypes mentioned in this RFC are defined by the specification. In | ||
| a few cases like `Cardinality` or `Datatype` it is described inline. | ||
|
|
||
| *** | ||
| ### Endpoint | ||
|
|
||
| ``` | ||
| GET /schema | ||
| ``` | ||
|
|
||
| ### Parameters | ||
|
|
||
| |Name|Type|Description| | ||
| |-|-|-| | ||
| |`log-size` | Optional `Integer`| Set the log size to the given entry number instead of the latest value.| | ||
|
|
||
|
|
||
| ### Response attributes | ||
|
|
||
| |Name|Type|Description| | ||
| |-|-|-| | ||
| |`attributes` | List of `Attribute`| The list of attributes.| | ||
|
|
||
|
|
||
| ### Attribute attributes | ||
|
|
||
| |Name|Type|Description| | ||
| |-|-|-| | ||
| |`label` | `Attrname` | The attribute machine-readable name. (`[a-z][a-z0-9-]*`)| | ||
| |`title` | `String` | The attribute human-readable title.| | ||
| |`description` | `Text` | The attribute description.| | ||
| |`datatype` | `Datatype` | The attribute datatype. (one of `curie`, `datetime`, `attrname`, `hash`, `integer`, `period`, `string`, `text`, `url`)| | ||
| |`cardinality` | `Cardinality` | The attribute cardinality (either `1` or `n`).| | ||
| *** | ||
|
|
||
| Note that meanwhile there is no schema evolution, `log-size` doesn't affect | ||
| the result. | ||
|
|
||
| *** | ||
| **EXAMPLE:** | ||
|
|
||
| ```http | ||
| GET /schema HTTP/1.1 | ||
| Host: approved-open-standard-guidance.register.gov.uk | ||
| Accept: application/json | ||
| ``` | ||
|
|
||
| ```http | ||
| HTTP/1.1 200 OK | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "attributes": [ | ||
| { | ||
| "label": "name", | ||
| "title": "Name", | ||
| "description": "The commonly-used name of a record.", | ||
| "datatype": "string", | ||
| "cardinality": "1" | ||
| }, | ||
| { | ||
| "label": "approved-open-standards", | ||
| "title": "Approved open standards", | ||
| "description": "Open standards that have been approved by government technology.", | ||
| "datatype": "curie", | ||
| "cardinality": "n" | ||
| }, | ||
| { | ||
| "label": "website", | ||
| "title": "Website", | ||
| "description": "The website for a record.", | ||
| "datatype": "url", | ||
| "cardinality": "1" | ||
| }, | ||
| { | ||
| "label": "start-date", | ||
| "title": "Start date", | ||
| "description": "The date a record first became relevant to a register.", | ||
| "datatype": "datetime", | ||
| "cardinality": "1" | ||
| }, | ||
| { | ||
| "label": "end-date", | ||
| "title": "End date", | ||
| "description": "The date a record stopped being applicable.", | ||
| "datatype": "datetime", | ||
| "cardinality": "1" | ||
| }, | ||
|
|
||
| ] | ||
| } | ||
| ``` | ||
| *** | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand this param, is it to retrieve the schema at a particular point in the log?
If so, it would be great if the records endpoint could behave in the same way eventually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the purpose and I agree the data counterpart should have the same