chore: regenerate Python SDK with typed query params, response models, datetime, hoisted nested types - #7
Closed
calvin-archastro wants to merge 1 commit into
Closed
chore: regenerate Python SDK with typed query params, response models, datetime, hoisted nested types#7calvin-archastro wants to merge 1 commit into
calvin-archastro wants to merge 1 commit into
Conversation
…, datetime, and hoisted nested types Picks up the four typing improvements landing in ArchAstro/archastro-openapi#14: - `format: date-time` fields are typed as `datetime` (ruff rewrites the post-emit `Optional[datetime]` to `datetime | None`). - Resource methods drop `**params` for typed kw-only query args (`page: int | None = None`, etc.); the call site builds a `query: dict[str, object] = {}` so `None` kwargs never hit the wire as `?key=null`. - Inline-object response schemas produce sibling `{ResourceShort}{Op}Response` Pydantic models, replacing every `dict[str, object]` return for ops whose response shape was described in the spec. - Nested inline objects in inputs / response models / channel payloads are hoisted as named sibling types (`{Parent}{FieldPascal}`, `…Item` for arrays, `…Value` for maps). Empty objects keep `dict[str, object]` (genuine freeform metadata bags). Net effect across the SDK: zero `**params` and zero `dict[str, object]` returns from inline schemas remain; deeply-nested shapes like ACL grants and pagination wrappers are now fully typed. Verified: 51 unit + harness, 670 REST contract, 51 channel contract = 772 tests passing. ruff clean. `uv build` produces a working wheel. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
calvin-archastro
marked this pull request as ready for review
April 25, 2026 20:55
|
Reviewed |
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.
Summary
Regenerated the SDK against the four Python typing improvements in ArchAstro/archastro-openapi#14. Held as a draft until that PR merges and a generator release ships (0.1.6) — at which point I'll re-run `./scripts/regenerate_sdk.sh` from a clean state so the diff is reproducible from npm.
What changes
Inputs (TypedDicts): every nested inline object now has a real type. ACL grants, profile pictures, thread attributes, etc. used to be `dict[str, object] | None` — now they're concrete classes:
```python
class TeamCreateInputAclAddItem(TypedDict, total=False):
actions: Required[list[str]]
principal: str | None
principal_type: Required[str]
class TeamCreateInputAcl(TypedDict, total=False):
add: list[TeamCreateInputAclAddItem] | None
remove: list[TeamCreateInputAclRemoveItem] | None
class TeamCreateInput(TypedDict, total=False):
name: Required[str]
acl: TeamCreateInputAcl | None
metadata: dict[str, object] | None # genuinely freeform — kept as-is
```
Responses (Pydantic models): ~30 ops that returned `dict[str, object]` because their response was inline now produce typed models. Callers go from `result["data"][0]["name"]` (untyped) to `result.data[0].name` (full IDE help).
Query params: drop `**params` for typed kw-only args.
```python
before
async def list(self, **params) -> dict[str, object]: ...
after
async def list(
self, *, page: int | None = None, page_size: int | None = None
) -> TeamListResponse: ...
```
The call site builds the query dict conditionally, so `None` kwargs never hit the wire as `?key=null`.
Datetime fields: every `created_at` / `updated_at` / etc. across `types/*.py` is now `datetime | None` instead of `str | None`. Pydantic v2 already auto-parsed the ISO strings at runtime, so behavior is unchanged — only the static types get more accurate.
Verified
Quantified improvements
Blocked on
Once those land, I'll regen from clean and mark this PR ready for review.
🤖 Generated with Claude Code