Skip to content

Conversation

@bokelley
Copy link
Contributor

Problem

The schema generation script was missing the --use-union-operator flag, causing it to regenerate all files with Optional[X] instead of X | None syntax whenever it ran. This created constant drift between committed schemas and regenerated ones.

Changes

  • ✅ Add --use-union-operator flag to datamodel-codegen command
  • ✅ Ensures generated schemas use modern Python 3.10+ syntax (X | None)
  • ✅ Prevents 70+ file changes every time schema generation runs
  • ✅ Fixes line wrapping inconsistencies in 14 schema files
  • ✅ Remove broken check-generated-schemas pre-commit hook (script never existed)

Root Cause

PR #572 committed schemas with X | None syntax, but the generator script still produced Optional[X] syntax, creating constant drift between committed files and regenerated files.

Testing

  • ✅ Regenerated schemas produce zero git changes
  • ✅ All unit tests pass (845 passed, 21 skipped)
  • ✅ All integration tests pass (174 passed, 75 skipped)
  • ✅ Pre-commit hooks pass

Verification

# Before fix: 70+ files changed
git status src/core/schemas_generated/

# After fix: 0 files changed
uv run python scripts/generate_schemas.py
git status src/core/schemas_generated/  # Clean!

bokelley and others added 3 commits October 23, 2025 19:14
The schema generation script was missing the --use-union-operator flag,
causing it to regenerate all files with Optional[X] instead of X | None
syntax whenever it ran.

Changes:
- Add --use-union-operator flag to datamodel-codegen command
- Ensures generated schemas use modern Python 3.10+ syntax (X | None)
- Prevents 70+ file changes every time schema generation runs
- Fixes line wrapping inconsistencies in 14 schema files
- Remove broken check-generated-schemas hook (script never existed)

Root cause: PR #572 checked in schemas with X | None syntax, but the
generator script still produced Optional[X] syntax, creating constant
drift between committed files and regenerated files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit 7f55df9 into main Oct 24, 2025
8 checks passed
EmmaLouise2018 pushed a commit that referenced this pull request Oct 24, 2025
* Fix schema generator to use union operator for consistency

The schema generation script was missing the --use-union-operator flag,
causing it to regenerate all files with Optional[X] instead of X | None
syntax whenever it ran.

Changes:
- Add --use-union-operator flag to datamodel-codegen command
- Ensures generated schemas use modern Python 3.10+ syntax (X | None)
- Prevents 70+ file changes every time schema generation runs
- Fixes line wrapping inconsistencies in 14 schema files
- Remove broken check-generated-schemas hook (script never existed)

Root cause: PR #572 checked in schemas with X | None syntax, but the
generator script still produced Optional[X] syntax, creating constant
drift between committed files and regenerated files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Apply formatting consistency to schemas from PR #573 merge

---------

Co-authored-by: Claude <noreply@anthropic.com>
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…protocol#574)

* Fix schema generator to use union operator for consistency

The schema generation script was missing the --use-union-operator flag,
causing it to regenerate all files with Optional[X] instead of X | None
syntax whenever it ran.

Changes:
- Add --use-union-operator flag to datamodel-codegen command
- Ensures generated schemas use modern Python 3.10+ syntax (X | None)
- Prevents 70+ file changes every time schema generation runs
- Fixes line wrapping inconsistencies in 14 schema files
- Remove broken check-generated-schemas hook (script never existed)

Root cause: PR adcontextprotocol#572 checked in schemas with X | None syntax, but the
generator script still produced Optional[X] syntax, creating constant
drift between committed files and regenerated files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Apply formatting consistency to schemas from PR adcontextprotocol#573 merge

---------

Co-authored-by: Claude <noreply@anthropic.com>
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