codex icon indicating copy to clipboard operation
codex copied to clipboard

Fix: Skip Option<()> schema generation to avoid invalid Windows filenames (#7479)

Open 448523760 opened this issue 1 month ago • 0 comments

Problem

When generating JSON schemas on Windows, the codex app-server generate-json-schema command fails with a filename error:

Error: Failed to write JSON schema for Option<()>
Caused by:
    0: Failed to write .\Option<()>.json
    1: The filename, directory name, or volume label syntax is incorrect. (os error 123)

This occurs because Windows doesn't allow certain characters in filenames, specifically the angle brackets <> used in the Option<()> type name.

Root Cause

The schema generation process attempts to create individual JSON files for each schema definition, including Option<()>. However, the characters < and > are invalid in Windows filenames, causing the file creation to fail.

Solution

The fix extends the existing IGNORED_DEFINITIONS constant (which was already being used in the bundle generation) to also skip Option<()> when generating individual JSON schema files. This maintains consistency with the existing behavior where Option<()> is excluded from the bundled schema.


close #7479

448523760 avatar Dec 13 '25 08:12 448523760