Skip to content

Tighten Python reference doc types#684

Merged
danielporterda merged 2 commits into
mainfrom
python-type-tightening
Jun 2, 2026
Merged

Tighten Python reference doc types#684
danielporterda merged 2 commits into
mainfrom
python-type-tightening

Conversation

@danielporterda
Copy link
Copy Markdown
Contributor

@danielporterda danielporterda commented Jun 1, 2026

Summary

  • Add recursive parsed-JSON aliases and a concrete recursive MintlifyNavGroup TypedDict for Mintlify navigation items.
  • Replace broad Any/generic aliases in AsyncAPI and OpenRPC models with format-specific TypedDict records for documents, extracted detail rows, change details, and history buckets.
  • Keep dynamic parsed JSON casts at checked ingress points or immediately after runtime validation of docs.json navigation lists.

@danielporterda danielporterda force-pushed the python-type-tightening branch from 1a79b7b to e42254e Compare June 1, 2026 19:46
@danielporterda danielporterda force-pushed the python-type-tightening branch from e42254e to aea07fe Compare June 1, 2026 20:07
@danielporterda danielporterda marked this pull request as ready for review June 2, 2026 14:50

from x2mdx.types import JsonObject

DamlJsonModule = JsonObject
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really a significant improvement… I'd honestly rather never we redeclare JsonObject because now it's just misleading me into thinking I have better types where in fact, I don't…

Comment on lines +9 to +10
TypeDocDocument = JsonObject
TypeDocExport = JsonObject
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too… this doesn't add anything

Copy link
Copy Markdown
Collaborator

@da-tanabe da-tanabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some improvements, so already better than what we have, but I'd rather have real types for the places I called out in the PR (ok for this to be a subsequent PR)

@danielporterda danielporterda merged commit 3f1197f into main Jun 2, 2026
3 checks passed
@danielporterda danielporterda deleted the python-type-tightening branch June 2, 2026 15:11
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.

2 participants