issues: 530513784
This data as json
| id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | pull_request | body | repo | type | active_lock_reason | performed_via_github_app | reactions | draft | state_reason |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 530513784 | MDExOlB1bGxSZXF1ZXN0MzQ3MTc5MDgx | 644 | Validate metadata json on startup | 6025893 | closed | 0 | 1 | 2019-11-30T00:32:15Z | 2021-07-28T17:58:45Z | 2021-07-28T17:58:45Z | CONTRIBUTOR | simonw/datasette/pulls/644 | This PR adds a sanity check which builds up a marshmallow schema on-the-fly based on the structure of the database(s) on startup and then validates the metadata json against it. In case of invalid data, this will raise with a descriptive error e.g:
Closes #260 This was intended to be fairly self-contained, but then while I was working on it, I hit some problems getting the tests to pass in the context of the test suite as a whole. My tests passed in isolation, but then failed while doing a full test suite run. That's when the worms started coming out of the can :bug: After some sleuthing, it turned out this was essentially the result of several issues intersecting:
As such, I've added some band-aids in 3552024 and 6859fd8:
* Switching the metadata object to a |
107914493 | pull | {
"url": "https://api.github.com/repos/simonw/datasette/issues/644/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
0 |