Feat/dump v2 prefix - #20
Merged
Merged
Conversation
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>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.