feat:Expand OpenAI OpenAPI schema with streaming and multi-modal support#253
feat:Expand OpenAI OpenAPI schema with streaming and multi-modal support#253
Conversation
WalkthroughThe OpenAI OpenAPI schema has been updated with expanded definitions for streaming events, multi-modal content support, response structures, and API management features including audio/visual handling, session lifecycle management, and role-based access control. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/libs/tryAGI.OpenAI/openapi.yaml`:
- Around line 18492-18496: The min/max item constraints are incorrectly placed
under the numeric item schema (unrecognizedKeywords: min_items/max_items) and
thus do not limit array length; move the constraints to the array schema that
contains the items and use OpenAPI's minItems and maxItems keys (e.g., add
minItems: 2 and maxItems: 2 alongside the items: block) so the array itself
enforces a 2-element length (locate the items definition shown and update its
parent array schema accordingly).
- Around line 13369-13370: The OpenAPI schema's seed property uses numeric
bounds that exceed signed 64-bit range; update the seed property's maximum and
minimum values (currently 9223372036854776000 and -9223372036854776000) to the
correct Int64 limits 9223372036854775807 and -9223372036854775808 respectively
so generated .NET models/validators won't overflow; locate the seed property in
openapi.yaml and replace those two numeric literals accordingly.
- Around line 12171-12174: The ChatCompletionResponseMessage schema currently
lists "content" and "refusal" as required but they are conditionally present;
update the OpenAPI schema for ChatCompletionResponseMessage to remove "content"
and "refusal" from the required array so they are optional, and add/update the
property descriptions to note that "content" is present when no tool_calls are
returned and "refusal" appears only on model refusal events; this change ensures
generated models match the API contract.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4db513ce-2baa-442f-86ce-66c7e531c944
⛔ Files ignored due to path filters (117)
src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AssistantsClient.CreateRun.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AssistantsClient.CreateThreadAndRun.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IAssistantsClient.CreateRun.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IAssistantsClient.CreateThreadAndRun.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.AllOf2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Annotation.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.AnnotationsItem3.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.AnyOf2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.AnyOf3.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ApplyPatchOperationParam.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.AssistantStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.AssistantsApiResponseFormatOption.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.AssistantsApiToolChoiceOption.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ChatCompletionMessageToolCallsItem.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ChatCompletionRequestAssistantMessageContentPart.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ChatCompletionRequestMessage.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ChatCompletionRequestSystemMessageContentPart.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ChatCompletionRequestToolMessageContentPart.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ChatCompletionRequestUserMessageContentPart.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ChatCompletionToolChoiceOption.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ChunkingStrategyRequestParam.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ComputerAction.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ComputerToolCallOutputResource.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Content5.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ContentItem3.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ContentItem4.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ConversationItem.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ConversationParam.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateChatCompletionRequest.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateEvalItem.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateModelResponseProperties.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateResponse.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateSpeechResponseStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateTranscriptionResponseDiarizedJsonUsage.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateTranscriptionResponseStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.DeletedConversation.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EnvironmentVariant1.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EnvironmentVariant12.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EnvironmentVariant13.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EvalGraderLabelModel.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EvalGraderPython.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EvalGraderScoreModel.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EvalGraderStringCheck.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EvalGraderTextSimilarity.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EvalItemContent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.EvalItemContentItem.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Filters2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.FiltersItem.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.FineTuneChatCompletionRequestAssistantMessage.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Format2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.FunctionAndCustomToolCallOutput.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.FunctionShellCallOutputOutcomeParam.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.FunctionToolCallOutputResource.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.FunctionToolCallResource.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ImageEditStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ImageGenStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.InputContent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.InputItem.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.InputMessageResource.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.InputParam.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Item.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ItemField.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ItemResource.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.MessageStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ModelIds.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ModelIdsCompaction.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ModelIdsResponses.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ModelIdsShared.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.NetworkPolicy.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.NetworkPolicy2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.NetworkPolicy3.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OneOf2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OneOf3.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OneOf4.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OneOf5.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OneOf9.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Operation.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Outcome.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OutputContent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OutputItem.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OutputMessageContent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OutputVariant2Item.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.OutputsVariant1Item.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeAudioFormats.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeClientEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeServerEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeTruncation.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeTurnDetectionRealtimeTurnDetection1.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Response.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ResponseFormat.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ResponseStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ResponsesClientEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ResponsesClientEventResponseCreate.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ResponsesServerEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RunStepStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RunStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Session2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.SkillsItem.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.SkillsItem2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Status.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.StopConfiguration.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.TextResponseFormatConfiguration.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ThreadItem.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ThreadStreamEvent.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Tool.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ToolChoiceParam.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ToolsItem13.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.TranscriptionChunkingStrategy.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.VideoModel.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.VoiceIdsOrCustomVoice.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.VoiceIdsShared.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.WebSearchToolCallAction.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateChatCompletionRequestVariant2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateRunRequest.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateThreadAndRunRequest.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.MessageObject.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RunObject.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/tryAGI.OpenAI/openapi.yaml
| required: | ||
| - role | ||
| - content | ||
| - refusal |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In the official OpenAI Chat Completions response schema/docs, are assistant message fields contentandrefusal both always present, or are they conditionally present depending on the response?
💡 Result:
They’re conditional, not both always present.
contenton an assistant message is optional (it’s required unless the assistant returnstool_calls/function_callinstead). [1]refusalis also optional and only appears when the model produces a refusal. [1]
So, in the official Chat Completions schema, you should not assume both fields are always present. [1]
Sources:
[1] OpenAI API Reference – Create chat completion (ChatCompletionMessage / assistant message fields) (developers.openai.com)
Citations:
- 1: https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create
Fix ChatCompletionResponseMessage required fields—content and refusal are conditionally present, not always required.
According to the official OpenAI Chat Completions schema, both content and refusal are optional fields:
contentis only required when the assistant does not returntool_callsrefusalappears only when the model produces a refusal
Marking both as required (lines 12171–12174) will make the generated models stricter than the actual API contract, causing deserialization failures when the API returns valid responses lacking one or both fields.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/libs/tryAGI.OpenAI/openapi.yaml` around lines 12171 - 12174, The
ChatCompletionResponseMessage schema currently lists "content" and "refusal" as
required but they are conditionally present; update the OpenAPI schema for
ChatCompletionResponseMessage to remove "content" and "refusal" from the
required array so they are optional, and add/update the property descriptions to
note that "content" is present when no tool_calls are returned and "refusal"
appears only on model refusal events; this change ensures generated models match
the API contract.
| maximum: 9223372036854776000 | ||
| minimum: -9223372036854776000 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
python - <<'PY'
max_spec = 9223372036854776000
min_spec = -9223372036854776000
int64_max = 2**63 - 1
int64_min = -(2**63)
print("spec maximum:", max_spec)
print("int64 maximum:", int64_max)
print("maximum overflows int64:", max_spec > int64_max)
print()
print("spec minimum:", min_spec)
print("int64 minimum:", int64_min)
print("minimum underflows int64:", min_spec < int64_min)
PYRepository: tryAGI/OpenAI
Length of output: 258
🏁 Script executed:
sed -n '13360,13380p' src/libs/tryAGI.OpenAI/openapi.yamlRepository: tryAGI/OpenAI
Length of output: 1525
Clamp seed to signed 64-bit bounds.
The current bounds exceed Int64 range by 193 and 192 respectively, which will cause overflow/underflow in generated .NET models and validators.
Suggested fix
seed:
- maximum: 9223372036854776000
- minimum: -9223372036854776000
+ maximum: 9223372036854775807
+ minimum: -9223372036854775808
type:
- 'null'
- integer📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| maximum: 9223372036854776000 | |
| minimum: -9223372036854776000 | |
| seed: | |
| maximum: 9223372036854775807 | |
| minimum: -9223372036854775808 | |
| type: | |
| - 'null' | |
| - integer |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/libs/tryAGI.OpenAI/openapi.yaml` around lines 13369 - 13370, The OpenAPI
schema's seed property uses numeric bounds that exceed signed 64-bit range;
update the seed property's maximum and minimum values (currently
9223372036854776000 and -9223372036854776000) to the correct Int64 limits
9223372036854775807 and -9223372036854775808 respectively so generated .NET
models/validators won't overflow; locate the seed property in openapi.yaml and
replace those two numeric literals accordingly.
| items: | ||
| type: number | ||
| unrecognizedKeywords: | ||
| unrecognizedKeywords: | ||
| min_items: 2 | ||
| max_items: 2 | ||
| min_items: 2 | ||
| max_items: 2 |
There was a problem hiding this comment.
Move the 2-item constraint onto the array, not the element schema.
As written, this does not constrain the range length at all. minItems/maxItems need to live on the array schema, otherwise clients can generate or accept invalid ranges.
Suggested fix
items:
type: number
- unrecognizedKeywords:
- min_items: 2
- max_items: 2
+ minItems: 2
+ maxItems: 2📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| items: | |
| type: number | |
| unrecognizedKeywords: | |
| unrecognizedKeywords: | |
| min_items: 2 | |
| max_items: 2 | |
| min_items: 2 | |
| max_items: 2 | |
| items: | |
| type: number | |
| minItems: 2 | |
| maxItems: 2 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/libs/tryAGI.OpenAI/openapi.yaml` around lines 18492 - 18496, The min/max
item constraints are incorrectly placed under the numeric item schema
(unrecognizedKeywords: min_items/max_items) and thus do not limit array length;
move the constraints to the array schema that contains the items and use
OpenAPI's minItems and maxItems keys (e.g., add minItems: 2 and maxItems: 2
alongside the items: block) so the array itself enforces a 2-element length
(locate the items definition shown and update its parent array schema
accordingly).
Summary by CodeRabbit