diff --git a/datasette/app.py b/datasette/app.py index 9c9b7de4..e13f0731 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -2514,8 +2514,8 @@ class Datasette: def add_route(view, regex): routes.append((regex, view)) - add_route(IndexView.as_view(self), r"/(\.(?Pjsono?))?$") - add_route(IndexView.as_view(self), r"/-/(\.(?Pjsono?))?$") + add_route(IndexView.as_view(self), r"/(\.(?Pjson))?$") + add_route(IndexView.as_view(self), r"/-/(\.(?Pjson))?$") add_route(permanent_redirect("/-/"), r"/-$") add_route(favicon, "/favicon.ico") diff --git a/datasette/views/row.py b/datasette/views/row.py index 129216b9..c99b75d1 100644 --- a/datasette/views/row.py +++ b/datasette/views/row.py @@ -21,7 +21,6 @@ from datasette.utils import ( InvalidSql, make_slot_function, path_from_row_pks, - path_with_added_args, path_with_format, path_with_removed_args, to_css_class, @@ -209,18 +208,6 @@ class RowView(BaseView): end = time.perf_counter() data["query_ms"] = (end - start) * 1000 - # Special case for .jsono extension - redirect to _shape=objects - if format_ == "jsono": - return self.redirect( - request, - path_with_added_args( - request, - {"_shape": "objects"}, - path=request.path.rsplit(".jsono", 1)[0] + ".json", - ), - forward_querystring=False, - ) - if format_ in self.ds.renderers.keys(): # Dispatch request to the correct output format renderer # (CSV is not handled here due to streaming) diff --git a/existing-api.md b/existing-api.md index 1933d287..d7678613 100644 --- a/existing-api.md +++ b/existing-api.md @@ -25,8 +25,7 @@ directory: every claim below is based on the route table in `datasette/app.py` - Most read endpoints are registered with an optional format suffix: `/(...)(\.(?Pjson))?$`. The bare path returns HTML; the `.json` - extension returns JSON. The homepage additionally accepts the legacy - `.jsono` extension, which returns identical JSON (app.py:2517-2518). + extension returns JSON. - Table, row and query routes accept any `\w+` format extension; formats other than the built-in `html`, `json`, `csv`, `blob` must be provided by a plugin via `register_output_renderer`, otherwise the request 404s. @@ -772,8 +771,7 @@ tilde-encoded primary key values (rowid for rowid tables). - **Foreign-key label expansion does not apply to row JSON** — `_labels` has no effect here; expansion happens only in the HTML path (views/row.py:445-475). -- `_shape`, `_json`, `_nl`, `_json_infinity`, `_ttl` apply. A `.jsono` - request redirects to `.json?_shape=objects`. +- `_shape`, `_json`, `_nl`, `_json_infinity`, `_ttl` apply. ### The .blob format diff --git a/stable-api-recommendations.md b/stable-api-recommendations.md index 9eac543f..8d8a87b4 100644 --- a/stable-api-recommendations.md +++ b/stable-api-recommendations.md @@ -233,8 +233,10 @@ Concerns: `_labels=on/off`, `?all=1`, `is_write=1|0|true|false|t|f|yes|no|on|off`, `_nocount=1`. Adopt one accepted set (the query-list parser at query_helpers.py:81-94 is a good candidate) and apply it everywhere. -- **`.jsono`** survives on the homepage route (identical output to `.json`) - and as a row-view redirect. Remove it at 1.0; it is pure legacy. +- ~~**`.jsono`** survives on the homepage route (identical output to `.json`) + and as a row-view redirect. Remove it at 1.0; it is pure legacy.~~ + ✅ Removed: the homepage routes only accept `.json` and the row-view + redirect is gone. - **`_json` is overloaded:** on GET it is a renderer option naming a column to parse as JSON (repeatable); on canned-query POST a `_json` body field forces a JSON response. Two unrelated meanings for one name.