Skip to content

Conversation

@448523760
Copy link
Contributor

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

…invalid Windows filenames

The schema generation process attempts to create Option<()>.json files,
which fail on Windows due to invalid filename characters.
This change extends the existing IGNORED_DEFINITIONS constant to also
skip Option<()> when generating individual JSON schema files, maintaining
consistency with bundle generation behavior.

Resolves Windows filename error for codex app-server generate-json-schema
Copy link
Contributor

@LIHUA919 LIHUA919 left a comment

Choose a reason for hiding this comment

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

LGTM

@448523760
Copy link
Contributor Author

Hi @etraut-openai any updates for this PR

@etraut-openai
Copy link
Collaborator

@448523760, it looks good to me, but I'd like to have another member of the codex team review it as well. It's in the queue.

@etraut-openai etraut-openai merged commit 017a4a0 into openai:main Dec 15, 2025
26 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codex-app-server-protocol exports this: Option<()>.json

4 participants