Skip to content

Fix native generation overwriting empty shared model files - #100

Merged
urbankrepel-povio merged 2 commits into
mainfrom
codex/native-empty-models
Sep 11, 2026
Merged

Fix native generation overwriting empty shared model files#100
urbankrepel-povio merged 2 commits into
mainfrom
codex/native-empty-models

Conversation

@urbankrepel-povio

@urbankrepel-povio urbankrepel-povio commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

When there are no shared schemas, native generation writes a nearly empty common.models.ts, overwriting checked-in enums that JavaScript generation leaves intact. Omit the native shared model file for an empty schema collection to match JavaScript behavior.

Adds 16 lifecycle regression cases covering JavaScript/native, JSON/YAML, incremental on/off, and models-only output. They assert no shared file is created on fresh output, existing enums and modification times survive regeneration with clearOutput: false, and explicit cleanup removes the stale file. Native cases require full native rendering.

Adds a schema-free /health endpoint to Petstore and derives a health-only Petstore fixture for every existing parity configuration. Both the unit parity suite and CI's Linux/macOS file-list and SHA-256 comparison consume this fixture. Explicit assertions verify that the endpoint is generated, the common model file is omitted, and the canonical native case uses full native rendering. The full Petstore fixture remains covered, including updated endpoint and metadata expectations.

Validation on macOS:

  • Reproduced the original failure before the fix.
  • Full JavaScript and native suites: 1,053 passed and 13 skipped each.
  • CI generation/hash commands: JS and native match across 708 cases, 5,266 generated files, and 5,974 manifest entries each.
  • Native build, typecheck, lint, and diff checks passed.

Remote CI must validate Linux/macOS jobs for the latest commit.

@urbankrepel-povio
urbankrepel-povio merged commit f427be1 into main Sep 11, 2026
6 checks passed
@urbankrepel-povio
urbankrepel-povio deleted the codex/native-empty-models branch September 11, 2026 09:27
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