fix(openapi): Preserve RequestWithoutId and its required fields when bundling - #2774
Merged
Conversation
Contributor
|
🗑️ Preview for this PR was deleted. |
This comment was marked as outdated.
This comment was marked as outdated.
vdusek
force-pushed
the
fix/request-without-id-bundling
branch
from
August 21, 2026 17:37
3a96e7d to
767ee67
Compare
vdusek
marked this pull request as ready for review
August 21, 2026 18:24
fnesveda
approved these changes
Aug 24, 2026
Pijukatel
approved these changes
Aug 24, 2026
| required: | ||
| - uniqueKey | ||
| - url | ||
| # Wrapped in a single-member `allOf` so that bundling keeps this component. A bare `$ref` with sibling keys is a |
Contributor
There was a problem hiding this comment.
Maybe the comment can be just in the description of this PR
vdusek
added a commit
to apify/apify-client-python
that referenced
this pull request
Aug 25, 2026
…#1026) `add_request` and `batch_add_requests` sent request fields snake_cased. The API declares its write bodies with `additionalProperties: false`, so it rejected the whole write with HTTP 400 — a request carrying `user_data`, `no_retry`, `retry_count`, `loaded_url`, `error_messages`, or `handled_at` could not be added at all. The identical dict passed to `update_request` worked: ```python add_request -> 400 {"uniqueKey": "k", "url": "...", "user_data": {...}, "no_retry": true} update_request -> 200 {"uniqueKey": "k", "url": "...", "userData": {...}, "noRetry": true} ``` The client was using `RequestDraft` (the spec's response-only schema for `unprocessedRequests`, which declares only `id`/`unique_key`/`url`/`method` and leaves the rest to `extra='allow'`) as its input model. The spec actually declares both add-request bodies as `RequestWithoutId`, now correctly generated as its own model since apify-docs#2774 fixed the spec bundler dropping its identity — no custom postprocessing needed. Upstream spec fix ([apify-docs#2774](apify/apify-docs#2774)) is closed. Two things to know: - **Validation narrows.** The newly declared fields are validated instead of passed through, so `retry_count='abc'` or a naive `handled_at` now raise `ValidationError` instead of a 400 from the API. - **`update_request`'s timestamp format changes** (`fa77d88`): `mode='json'` emits ISO 8601 where python mode emitted `2019-06-16 10:23:31.607000+00:00`. The API accepts both, so this is spec fidelity, not a fix — its own commit, revertible alone. Integration tests round-trip every field through both add paths against the live API; they fail on master with `InvalidRequestError`. *✍️ Drafted by Claude Code*
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.
RequestWithoutIdwas a bare$refwith sibling keys, so the bundler inlined it: the publishedopenapi.jsonhas no such component, the add-request / batch-add-requests / update-request bodies point straight atRequestBase, andrequired: [uniqueKey, url]disappears. Generated clients therefore get no schema for those bodies —apify-client-pythonfell back to a response shape and sentuserDataand friends snake_cased, which the API rejects with HTTP 400 (apify/apify-client-python#1026).Wrapping
RequestWithoutIdin a single-memberallOfkeeps it a named component through bundling.required: [uniqueKey, url]moves toRequestBase, andRequestdrops the now-redundant entries — net constraints unchanged.redocly lintpasses, and the bundle keeps the component with all 11 properties and the required constraint.✍️ Drafted by Claude Code