Skip to content

Feat/dump v2 prefix - #20

Merged
sagargg merged 5 commits into
mainfrom
feat/dump-v2-prefix
Aug 27, 2026
Merged

Feat/dump v2 prefix#20
sagargg merged 5 commits into
mainfrom
feat/dump-v2-prefix

Conversation

@sagargg

@sagargg sagargg commented Aug 27, 2026

Copy link
Copy Markdown
Member

No description provided.

sagargg and others added 5 commits August 27, 2026 14:48
Downloads move from `/datastore/dump/…` to `/datastore/api/v2/dump/…`,
reverting the direction of 34ec309. A dump URL's query params and output
layout are part of the same compatibility contract as the actions, so it
versions with them rather than sitting outside `/api`.

`DUMP_PREFIX` is now built from `API_PREFIX`, which is the whole change —
routes, analytics and tests all derive their paths from it. The analytics
middleware still checks the dump prefixes before the action prefix, so a
download is recorded as `datastore_dump` rather than an action named
`dump`. Health probes stay unversioned.

The Postman collection had no download requests at all; it gains a `dump`
folder covering both routes across all four formats. Those requests take a
path parameter and no body, so they are declared inline in the generator
rather than driven by `example_payload/`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dump routes declared no `response_class`, so FastAPI added its default
`application/json` body to the 200 for both. Swagger rendered that as the
primary response, and a generated client would have parsed a parquet file
or a redirect as the CKAN envelope.

Both routes now declare `response_class=RedirectResponse` with an explicit
`status_code=302`, which is what the handler actually returns — without the
pin FastAPI documents RedirectResponse's own 307 default as a "Successful
Response" that never occurs. The 302 gains its `Location` header and the
per-format content types, and the 200 stays the sharded-parquet zip.

`DUMP_MEDIA_TYPES` puts the format → content-type mapping next to the
extensions it parallels; API.md gains the same table.

Error responses are untouched: those really are JSON envelopes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The "Datastore Download" section read like another JSON action group, which
is misleading: those two routes hand back a file and never the CKAN
envelope. It now says so first — open one in a browser or curl it, there is
nothing to parse — before covering the formats, the signed-URL redirect and
the sharded-parquet zip. JSON is named only as what an error looks like.

Renamed to "Datastore Downloads" in both the tag list and the router, since
the two strings have to match or Swagger renders a second, untitled section.

The "Datastore" group gets the same treatment: it now states that it is the
JSON action API and what its envelope looks like, replacing a description
that said "API endpoint" and carried a "searchsearch_sql" typo.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The section description ran to three paragraphs, which left the header
block taller than the operation it introduced. It says the essential thing
in one paragraph now — these return a file, here are the formats, the
answer is a 302 to a signed URL. The zip case and the error envelope are
already documented on the responses themselves, where a reader looks for
them.

The `sql` parameter described itself as "A  Datastore read API with
`SELECT` / `WITH` statement" on both routes — reads as though the parameter
were an API, with a doubled space and, on the dump route, a missing one. It
is just a statement, so it says that.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both descriptions still ran long enough to wrap over the operations they
introduce. One line each now, matching Health: what the group returns, and
nothing else. The formats, the zip case and the error envelope are on the
responses themselves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sagargg
sagargg merged commit cbae7b1 into main Aug 27, 2026
1 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d43d566-f3eb-4b90-8c4c-21496bbd9f31


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant