---
type: email
from: "chatgpt-codex-connector[bot]" <notifications@github.com>
subject: Re: [openai/openai-agents-python] Fix: Remove null values from JSON

 schemas to comply with JSON Schema (PR #1698)
received: 2026-03-06 07:27:03
date_header: Tue, 09 Sep 2025 19:10:24 -0700
priority: normal
status: awaiting_approval
uid: 29977
---

## Email Content

**From:** "chatgpt-codex-connector[bot]" <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] Fix: Remove null values from JSON

 schemas to comply with JSON Schema (PR #1698)
**Date:** Tue, 09 Sep 2025 19:10:24 -0700

### Body (preview)

@chatgpt-codex-connector[bot] commented on this pull request.



Codex Review: Here are some suggestions.



Reply with `@codex fix comments` to fix any unresolved comments.



<details> <summary>About Codex in GitHub</summary>



[Your team has set up Codex to review pull requests in this repo](http://chatgpt.com/codex/settings/general). Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.



Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

</details>



> +    # Remove all null values to comply with JSON Schema Draft 2020-12

+    # This prevents LLM providers from rejecting schemas with null values

+    keys_to_remove = []

+    for key, value in json_schema.items():

+        if value is None:

+            keys_to_remove.append(key)

+

+    for key in keys_to_remove:

+        json_schema.pop(key)



**[P1] Preserve strictness when additionalProperties is None**



The new loop removes every key whose value is `None`. For object schemas that arrive with `"additionalProperties": None`, the earlier branch that defaults objects to `additionalProperties=False` is skipped because the key is present. After this block runs, the key is popped entirely, so the returned schema has no `additionalProperties` entry and therefore permits extra properties by default. This regresses the purpose of `ensure_strict_json_schema`, which should always disallow additional fields. Consider treating `None` as “not provided” before the object-type check or coercing it to `False` rather than dropping the key.



Useful? React with 👍 / 👎.



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1698#pullrequestreview-3204071605

You are receiving this because you are subscribed to this thread.



Message ID: <openai/ope

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
