fix(prompt): update OpenAI JSON schema generation for serialization o…#1943
Open
grantlerduck wants to merge 1 commit intoJetBrains:developfrom
Open
fix(prompt): update OpenAI JSON schema generation for serialization o…#1943grantlerduck wants to merge 1 commit intoJetBrains:developfrom
grantlerduck wants to merge 1 commit intoJetBrains:developfrom
Conversation
fcd5fc5 to
ba54077
Compare
…f nullable collections (JetBrains#1930)
ba54077 to
7ee683e
Compare
Contributor
Author
|
Just rebased. There was an agent run test which ran into a deadlock unrelated to my changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
List<X>?fields produced{"type": ["array", "null"], "items": {...}}, which OpenAI'sGPT-5-family strict-mode validator rejects (surfaces as
'Invalid schema for response_format ... got "type": "None"'). SwitchOpenAIStandardJsonSchemaGenerator.processListto emit{"anyOf": [{"type": "array", "items": ...}, {"type": "null"}]}for nullable lists, mirroringthe shape already used for nullable objects.
StandardJsonSchemaGeneratorareunchanged. Only the OpenAI-specific generator is touched, so other providers keep their existing
type-union encoding.
testGenerateOpenAIStandardJsonSchemaForNullableLists) covering bothprimitive (
List<String>?) and$ref(List<Tag>?) item types.Out of scope (could follow up)
OpenAIBasicJsonSchemaGeneratorstill emits the OpenAPI-3.0-stylenullable: truekeyword, whichOpenAI strict mode silently ignores. Same root cause family, different generator — happy to file
a follow-up if useful.
closes #1930