Skip to content

docs: explain omitempty behavior in structured outputs - #879

Open
pentaoa wants to merge 1 commit into
openai:mainfrom
pentaoa:docs/539-structured-output-omitempty
Open

docs: explain omitempty behavior in structured outputs#879
pentaoa wants to merge 1 commit into
openai:mainfrom
pentaoa:docs/539-structured-output-omitempty

Conversation

@pentaoa

@pentaoa pentaoa commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Fixes #539.

The full structured-outputs example already warns that omitempty changes how invopop/jsonschema builds the schema, but the copy-paste example in the README omitted that warning.

This adds the same guidance at the point where readers define their response struct, explaining that omitempty removes fields from the schema's required array and can therefore lead to strict-schema rejection or omitted output fields.

Validation

  • Confirmed the wording matches the behavior documented in examples/structured-outputs/main.go.
  • git diff --check

AI assistance was used to locate the duplicated example and draft concise wording. I reviewed the final documentation change.

@pentaoa
pentaoa requested a review from a team as a code owner September 3, 2026 15:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T15:38:46.021426Z ae6306a PR opened
🔒 Security Review Completed 2026-09-03T15:39:54.371104Z ae6306a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

Implicit ignore of omitempty struct tags

1 participant