Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 23, 2025

Summary by CodeRabbit

  • Refactor

    • Renamed API schemas: CreateConversationRequest → CreateConversationBody; ComputerEnvironment1 → ComputerEnvironment; MetadataParam → Metadata. Updated all references accordingly.
    • Request body for CreateConversationBody is no longer required.
    • Metadata field updated to use the new Metadata schema and is now nullable.
  • Documentation

    • Improved operation descriptions (e.g., “OK” → “Success”) and clarified delete/get/update text.
    • Updated multi-language code examples to reflect new schema names and parameter shapes.
  • Chores

    • Removed schema-level x-oaiMeta block.

@coderabbitai
Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

Single OpenAPI spec file updated to rename schemas and adjust references, change CreateConversation request body requirement and metadata typing, update operation descriptions, refresh multi-language examples, and remove an x-oaiMeta block.

Changes

Cohort / File(s) Summary
Schema renames
src/libs/tryAGI.OpenAI/openapi.yaml
Renamed CreateConversationRequest → CreateConversationBody; ComputerEnvironment1 → ComputerEnvironment; MetadataParam → Metadata.
$ref updates
src/libs/tryAGI.OpenAI/openapi.yaml
Updated all component references to new schema names.
Request body requirement
src/libs/tryAGI.OpenAI/openapi.yaml
CreateConversationBody request body no longer marked as required.
Metadata field typing
src/libs/tryAGI.OpenAI/openapi.yaml
Adjusted CreateConversationBody.metadata to use Metadata schema; added nullability (nullable: true / type: 'null').
Descriptions/wording
src/libs/tryAGI.OpenAI/openapi.yaml
Operation/response text tweaks (e.g., “OK” → “Success”; clarify delete/get/update descriptions).
Examples and code snippets
src/libs/tryAGI.OpenAI/openapi.yaml
Updated language-specific examples to use new schema names and shapes (e.g., shared.Metadata, added type fields).
Metadata blocks
src/libs/tryAGI.OpenAI/openapi.yaml
Removed x-oaiMeta block under a schema item.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I twitch my whiskers at renamed things,
Schemas hop, and reference sings.
Metadata burrows, nullable and new,
Examples sprout in a multi-language hue.
One YAML meadow, tidied and bright—
I thump my paws: specs set right! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title "feat:@coderabbitai" is not descriptive of the changes in this pull request and reads like a mention/tag rather than a summary of the work; it does not convey the API/schema renames and reference updates present in src/libs/tryAGI.OpenAI/openapi.yaml. The changes rename several public schemas (e.g., CreateConversationRequest → CreateConversationBody, ComputerEnvironment1 → ComputerEnvironment, MetadataParam → Metadata) and adjust request/response shapes and examples, none of which are reflected by the current title. Because it is ambiguous and off-topic, the title will hinder reviewers and make commit history harder to scan. Replace the title with a concise, descriptive summary of the OpenAPI/schema changes and remove the @mention; for example: "openapi: rename CreateConversationRequest -> CreateConversationBody, ComputerEnvironment1 -> ComputerEnvironment, MetadataParam -> Metadata". Alternatively use conventional commit style like "feat(openapi): rename public schemas and update $ref paths" so the PR clearly communicates intent to reviewers and in project history.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202509230112

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HavenDV HavenDV merged commit 986d9c1 into main Sep 23, 2025
2 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202509230112 branch September 23, 2025 01:13
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:OpenAPI: rename schemas, fix refs, update CreateConversation, examples Sep 23, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
src/libs/tryAGI.OpenAI/openapi.yaml (4)

1139-1142: CreateConversation request: confirm requestBody.required and 201 status

You’ve switched the request schema to CreateConversationBody and responses to “Success.” Please confirm:

  • Is the request body now optional? If yes, ensure SDKs/docs reflect that an empty body creates an empty conversation.
  • Consider 201 Created for resource creation if a new conversation is created.

1169-1169: Clarify delete semantics and retention

“Items in the conversation will not be deleted.” Specify retention/visibility (e.g., still listable/searchable? for how long?) to avoid ambiguity and client-side data lifecycle surprises.


1181-1181: Delete response code: consider 204 No Content

If the delete endpoint returns no body, prefer 204. If a body is returned, keep 200 but document the response shape.


1272-1272: SDK example consistency (Go/others) and key naming

Examples mix metadata keys (“topic” vs “foo”) and API key handling across languages. Unify for clarity; also please verify the Go snippet compiles with shared.Metadata literal.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f49b050 and 4fe2e92.

⛔ Files ignored due to path filters (19)
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ConversationsClient.CreateConversation.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ConversationsClient.DeleteConversation.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ConversationsClient.GetConversation.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.ConversationsClient.UpdateConversation.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IConversationsClient.CreateConversation.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IConversationsClient.DeleteConversation.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IConversationsClient.GetConversation.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IConversationsClient.UpdateConversation.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ComputerEnvironment.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.ComputerEnvironmentNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerEnvironment.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerUsePreviewTool.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateConversationBody.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateConversationBody.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateConversationRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.MetadataParam.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.UpdateConversationBody.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/tryAGI.OpenAI/openapi.yaml (13 hunks)
🔇 Additional comments (7)
src/libs/tryAGI.OpenAI/openapi.yaml (7)

1207-1207: LGTM: wording tweak

“Get a conversation” is fine and clearer.


1219-1219: LGTM: response description

Consistent “Success” phrasing is OK.


1245-1245: LGTM: summary/description

No issues.


1262-1262: LGTM: response description

No issues.


10005-10008: LGTM: enum rename

ComputerEnvironment rename looks correct.


10173-10173: LGTM: $ref updated

Reference now points to ComputerEnvironment.


28873-28873: LGTM: centralizing on Metadata

Good alignment to the new Metadata schema.

Comment on lines +1396 to +1401
go: "package main\n\nimport (\n \"context\"\n \"fmt\"\n\n \"github.com/openai/openai-go\"\n \"github.com/openai/openai-go/conversations\"\n \"github.com/openai/openai-go/option\"\n \"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n client := openai.NewClient(\n option.WithAPIKey(\"My API Key\"),\n )\n conversationItemList, err := client.Conversations.Items.New(\n context.TODO(),\n \"conv_123\",\n conversations.ItemNewParams{\n Items: []responses.ResponseInputItemUnionParam{responses.ResponseInputItemUnionParam{\n OfMessage: &responses.EasyInputMessageParam{\n Content: responses.EasyInputMessageContentUnionParam{\n OfString: openai.String(\"string\"),\n },\n Role: responses.EasyInputMessageRoleUser,\n Type: responses.EasyInputMessageTypeMessage,\n },\n }},\n },\n )\n if err != nil {\n panic(err.Error())\n }\n fmt.Printf(\"%+v\\n\", conversationItemList.FirstID)\n}\n"
java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.items.ConversationItemList;\nimport com.openai.models.conversations.items.ItemCreateParams;\nimport com.openai.models.responses.EasyInputMessage;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemCreateParams params = ItemCreateParams.builder()\n .conversationId(\"conv_123\")\n .addItem(EasyInputMessage.builder()\n .content(\"string\")\n .role(EasyInputMessage.Role.USER)\n .type(EasyInputMessage.Type.MESSAGE)\n .build())\n .build();\n ConversationItemList conversationItemList = client.conversations().items().create(params);\n }\n}"
javascript: "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst items = await client.conversations.items.create(\n \"conv_123\",\n {\n items: [\n {\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text: \"Hello!\" }],\n },\n {\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text: \"How are you?\" }],\n },\n ],\n }\n);\nconsole.log(items.data);\n"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: 'My API Key',\n});\n\nconst conversationItemList = await client.conversations.items.create('conv_123', {\n items: [{ content: 'string', role: 'user' }],\n});\n\nconsole.log(conversationItemList.first_id);"
python: "from openai import OpenAI\n\nclient = OpenAI(\n api_key=\"My API Key\",\n)\nconversation_item_list = client.conversations.items.create(\n conversation_id=\"conv_123\",\n items=[{\n \"content\": \"string\",\n \"role\": \"user\",\n }],\n)\nprint(conversation_item_list.first_id)"
ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item_list = openai.conversations.items.create(\"conv_123\", items: [{content: \"string\", role: :user}])\n\nputs(conversation_item_list)"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: 'My API Key',\n});\n\nconst conversationItemList = await client.conversations.items.create('conv_123', {\n items: [{ content: 'string', role: 'user', type: 'message' }],\n});\n\nconsole.log(conversationItemList.first_id);"
python: "from openai import OpenAI\n\nclient = OpenAI(\n api_key=\"My API Key\",\n)\nconversation_item_list = client.conversations.items.create(\n conversation_id=\"conv_123\",\n items=[{\n \"content\": \"string\",\n \"role\": \"user\",\n \"type\": \"message\",\n }],\n)\nprint(conversation_item_list.first_id)"
ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item_list = openai.conversations.items.create(\"conv_123\", items: [{content: \"string\", role: :user, type: :message}])\n\nputs(conversation_item_list)"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Examples diverge from schema: content shape inconsistent across SDKs

Node.js/Python/Ruby use content: "string" while schema/examples elsewhere use content: [{ type: "input_text", text: "..." }]. Mismatch will confuse users.

Apply this diff to align Node.js/Python/Ruby with the structured content used in curl/JS:

-            node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n  apiKey: 'My API Key',\n});\n\nconst conversationItemList = await client.conversations.items.create('conv_123', {\n  items: [{ content: 'string', role: 'user', type: 'message' }],\n});\n\nconsole.log(conversationItemList.first_id);"
+            node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({ apiKey: 'My API Key' });\n\nconst conversationItemList = await client.conversations.items.create('conv_123', {\n  items: [{\n    type: 'message',\n    role: 'user',\n    content: [{ type: 'input_text', text: 'Hello!' }]\n  }]\n});\n\nconsole.log(conversationItemList.first_id);"
-            python: "from openai import OpenAI\n\nclient = OpenAI(\n    api_key=\"My API Key\",\n)\nconversation_item_list = client.conversations.items.create(\n    conversation_id=\"conv_123\",\n    items=[{\n        \"content\": \"string\",\n        \"role\": \"user\",\n        \"type\": \"message\",\n    }],\n)\nprint(conversation_item_list.first_id)"
+            python: "from openai import OpenAI\n\nclient = OpenAI(api_key=\"My API Key\")\nconversation_item_list = client.conversations.items.create(\n    conversation_id=\"conv_123\",\n    items=[{\n        \"type\": \"message\",\n        \"role\": \"user\",\n        \"content\": [{\"type\": \"input_text\", \"text\": \"Hello!\"}],\n    }],\n)\nprint(conversation_item_list.first_id)"
-            ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item_list = openai.conversations.items.create(\"conv_123\", items: [{content: \"string\", role: :user, type: :message}])\n\nputs(conversation_item_list)"
+            ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item_list = openai.conversations.items.create(\n  \"conv_123\",\n  items: [{\n    type: :message,\n    role: :user,\n    content: [{ type: :input_text, text: \"Hello!\" }]\n  }]\n)\n\nputs(conversation_item_list)"
📝 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.

Suggested change
go: "package main\n\nimport (\n \"context\"\n \"fmt\"\n\n \"github.com/openai/openai-go\"\n \"github.com/openai/openai-go/conversations\"\n \"github.com/openai/openai-go/option\"\n \"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n client := openai.NewClient(\n option.WithAPIKey(\"My API Key\"),\n )\n conversationItemList, err := client.Conversations.Items.New(\n context.TODO(),\n \"conv_123\",\n conversations.ItemNewParams{\n Items: []responses.ResponseInputItemUnionParam{responses.ResponseInputItemUnionParam{\n OfMessage: &responses.EasyInputMessageParam{\n Content: responses.EasyInputMessageContentUnionParam{\n OfString: openai.String(\"string\"),\n },\n Role: responses.EasyInputMessageRoleUser,\n Type: responses.EasyInputMessageTypeMessage,\n },\n }},\n },\n )\n if err != nil {\n panic(err.Error())\n }\n fmt.Printf(\"%+v\\n\", conversationItemList.FirstID)\n}\n"
java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.items.ConversationItemList;\nimport com.openai.models.conversations.items.ItemCreateParams;\nimport com.openai.models.responses.EasyInputMessage;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemCreateParams params = ItemCreateParams.builder()\n .conversationId(\"conv_123\")\n .addItem(EasyInputMessage.builder()\n .content(\"string\")\n .role(EasyInputMessage.Role.USER)\n .type(EasyInputMessage.Type.MESSAGE)\n .build())\n .build();\n ConversationItemList conversationItemList = client.conversations().items().create(params);\n }\n}"
javascript: "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst items = await client.conversations.items.create(\n \"conv_123\",\n {\n items: [\n {\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text: \"Hello!\" }],\n },\n {\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text: \"How are you?\" }],\n },\n ],\n }\n);\nconsole.log(items.data);\n"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: 'My API Key',\n});\n\nconst conversationItemList = await client.conversations.items.create('conv_123', {\n items: [{ content: 'string', role: 'user' }],\n});\n\nconsole.log(conversationItemList.first_id);"
python: "from openai import OpenAI\n\nclient = OpenAI(\n api_key=\"My API Key\",\n)\nconversation_item_list = client.conversations.items.create(\n conversation_id=\"conv_123\",\n items=[{\n \"content\": \"string\",\n \"role\": \"user\",\n }],\n)\nprint(conversation_item_list.first_id)"
ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item_list = openai.conversations.items.create(\"conv_123\", items: [{content: \"string\", role: :user}])\n\nputs(conversation_item_list)"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: 'My API Key',\n});\n\nconst conversationItemList = await client.conversations.items.create('conv_123', {\n items: [{ content: 'string', role: 'user', type: 'message' }],\n});\n\nconsole.log(conversationItemList.first_id);"
python: "from openai import OpenAI\n\nclient = OpenAI(\n api_key=\"My API Key\",\n)\nconversation_item_list = client.conversations.items.create(\n conversation_id=\"conv_123\",\n items=[{\n \"content\": \"string\",\n \"role\": \"user\",\n \"type\": \"message\",\n }],\n)\nprint(conversation_item_list.first_id)"
ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item_list = openai.conversations.items.create(\"conv_123\", items: [{content: \"string\", role: :user, type: :message}])\n\nputs(conversation_item_list)"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({ apiKey: 'My API Key' });\n\nconst conversationItemList = await client.conversations.items.create('conv_123', {\n items: [{\n type: 'message',\n role: 'user',\n content: [{ type: 'input_text', text: 'Hello!' }]\n }]\n});\n\nconsole.log(conversationItemList.first_id);"
python: "from openai import OpenAI\n\nclient = OpenAI(api_key=\"My API Key\")\nconversation_item_list = client.conversations.items.create(\n conversation_id=\"conv_123\",\n items=[{\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": [{\"type\": \"input_text\", \"text\": \"Hello!\"}],\n }],\n)\nprint(conversation_item_list.first_id)"
ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item_list = openai.conversations.items.create(\n \"conv_123\",\n items: [{\n type: :message,\n role: :user,\n content: [{ type: :input_text, text: \"Hello!\" }]\n }]\n)\n\nputs(conversation_item_list)"
🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 1396 to 1401, the example
payloads for Node.js/Python/Ruby show content as a plain string, but the schema
and other examples expect a structured array of content objects like [{ type:
"input_text", text: "..." }]; update the Node.js/Python/Ruby examples to use the
structured content array matching the schema (replace content: "string" with
content: [{ type: "input_text", text: "your text here" }] and adjust any sample
values accordingly) so all SDK examples are consistent with the documented
schema.

Comment on lines +11259 to +11271
CreateConversationBody:
type: object
properties:
items:
maxItems: 20
type: array
items:
$ref: '#/components/schemas/InputItem'
description: "Initial items to include in the conversation context.\nYou may add up to 20 items at a time.\n"
description: Initial items to include in the conversation context. You may add up to 20 items at a time.
nullable: true
metadata:
$ref: '#/components/schemas/Metadata'
description: Create a conversation
type: 'null'
nullable: true
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

🧩 Analysis chain

Bug: metadata now only allows null; restore Metadata schema with nullability

Setting type: 'null' + nullable: true makes metadata effectively null-only and drops the schema. Use Metadata with null allowed.

Apply this diff (OpenAPI 3.0.x–safe):

-        metadata:
-          type: 'null'
-          nullable: true
+        metadata:
+          allOf:
+            - $ref: '#/components/schemas/Metadata'
+          nullable: true

If on OpenAPI 3.1, prefer:

  • metadata: { type: [ 'object', 'null' ], $ref: '#/components/schemas/Metadata' } via anyOf/oneOf since $ref can’t be combined directly with type.

🏁 Script executed:

#!/bin/bash
set -euo pipefail
f="src/libs/tryAGI.OpenAI/openapi.yaml"
if [ ! -f "$f" ]; then
  echo "MISSING: $f"
  echo "Searching for openapi.yaml files in repo..."
  rg --hidden --glob '!**/node_modules/**' -n "openapi.yaml" || true
  exit 0
fi

echo "FOUND: $f"
echo
echo "---- openapi header (first 20 lines) ----"
sed -n '1,20p' "$f"
echo
echo "---- excerpt lines 11259-11271 ----"
nl -ba "$f" | sed -n '11259,11271p'
echo
echo "---- context lines 11250-11280 ----"
nl -ba "$f" | sed -n '11250,11280p'
echo
echo "---- all 'metadata:' occurrences (with 2 lines context) ----"
rg -n -C2 '\bmetadata:\b' "$f" || true
echo
echo "---- components.schemas.Metadata definition (6 lines context) ----"
rg -n -C6 '^\s*Metadata:' "$f" || true
rg -n -C6 '#/components/schemas/Metadata' "$f" || true

Length of output: 699


🏁 Script executed:

#!/bin/bash
f="src/libs/tryAGI.OpenAI/openapi.yaml"
if [ ! -f "$f" ]; then
  echo "MISSING: $f"
  echo "Searching for openapi.yaml files in repo..."
  rg --hidden --glob '!**/node_modules/**' -n "openapi.yaml" || true
  exit 0
fi

echo "FOUND: $f"
echo
echo "---- openapi header (first 20 lines) ----"
sed -n '1,20p' "$f" || true
echo
echo "---- excerpt lines 11259-11271 ----"
sed -n '11259,11271p' "$f" || true
echo
echo "---- context lines 11250-11280 ----"
sed -n '11250,11280p' "$f" || true
echo
echo "---- all 'metadata:' occurrences (with 2 lines context) ----"
rg -n -C2 '\bmetadata:\b' "$f" || true
echo
echo "---- locations of 'Metadata:' schema definitions ----"
rg -n '^\s*Metadata:' "$f" || true
echo
echo "---- print blocks around each 'Metadata:' occurrence (10 lines before, 40 after) ----"
rg -n '^\s*Metadata:' "$f" | while IFS=: read -r ln _; do
  start=$((ln-10)); [ $start -lt 1 ] && start=1
  end=$((ln+40))
  echo "---- around line $ln ----"
  sed -n "${start},${end}p" "$f" || true
done
echo
echo "---- references to '#/components/schemas/Metadata' ----"
rg -n '#/components/schemas/Metadata' "$f" || true

Length of output: 6545


Bug: metadata now only allows null; restore Metadata schema with nullability

CreateConversationBody.metadata is declared as type: 'null' + nullable: true, making it null-only and dropping the intended Metadata object schema. Replace with an allOf $ref to the Metadata schema and keep nullable (OpenAPI 3.0.x-safe). File: src/libs/tryAGI.OpenAI/openapi.yaml (lines ~11259-11271).

Apply this diff (OpenAPI 3.0.x–safe):

-        metadata:
-          type: 'null'
-          nullable: true
+        metadata:
+          allOf:
+            - $ref: '#/components/schemas/Metadata'
+          nullable: true
📝 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.

Suggested change
CreateConversationBody:
type: object
properties:
items:
maxItems: 20
type: array
items:
$ref: '#/components/schemas/InputItem'
description: "Initial items to include in the conversation context.\nYou may add up to 20 items at a time.\n"
description: Initial items to include in the conversation context. You may add up to 20 items at a time.
nullable: true
metadata:
$ref: '#/components/schemas/Metadata'
description: Create a conversation
type: 'null'
nullable: true
metadata:
allOf:
- $ref: '#/components/schemas/Metadata'
nullable: true
🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 11259 to 11271,
CreateConversationBody.metadata is incorrectly defined as type: 'null' with
nullable: true which makes it null-only and drops the intended Metadata object
schema; replace that property with an allOf referencing the existing Metadata
schema and keep nullable: true (OpenAPI 3.0.x-safe) so metadata can be either
the Metadata object or null — update the CreateConversationBody schema to use an
allOf $ref to '#/components/schemas/Metadata' and set nullable: true instead of
type: 'null'.

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.

2 participants