mirror of
https://github.com/simonw/datasette.git
synced 2026-05-31 06:07:05 +02:00
ok: true in /db.json for consistency
This commit is contained in:
parent
73f338b9f3
commit
5f39036b9b
4 changed files with 10 additions and 0 deletions
|
|
@ -130,6 +130,7 @@ class DatabaseView(View):
|
|||
actor=request.actor,
|
||||
)
|
||||
json_data = {
|
||||
"ok": True,
|
||||
"database": database,
|
||||
"private": private,
|
||||
"path": datasette.urls.database(database),
|
||||
|
|
|
|||
|
|
@ -3,6 +3,12 @@
|
|||
=========
|
||||
Changelog
|
||||
=========
|
||||
.. dev:
|
||||
|
||||
dev
|
||||
---
|
||||
|
||||
- The ``/<database>.json`` endpoint now includes an ``"ok": true`` key, for consistency with other JSON API responses.
|
||||
|
||||
.. _v1_0_a26:
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ The JSON version of this page provides programmatic access to the underlying dat
|
|||
* `fivethirtyeight.datasettes.com/fivethirtyeight.json <https://fivethirtyeight.datasettes.com/fivethirtyeight.json>`_
|
||||
* `datasette.io/global-power-plants.json <https://datasette.io/global-power-plants.json>`_
|
||||
|
||||
The returned object includes an ``"ok": true`` key alongside keys such as ``"database"``, ``"tables"``, ``"views"``, ``"queries"`` and ``"metadata"``.
|
||||
|
||||
.. _DatabaseView_hidden:
|
||||
|
||||
Hidden tables
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ async def test_database_page(ds_client):
|
|||
response = await ds_client.get("/fixtures.json")
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["ok"] is True
|
||||
assert data["database"] == "fixtures"
|
||||
|
||||
# Build lookup for easier assertions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue