feat:Simplify output property schema in prediction response of OpenAPI spec#100
Conversation
WalkthroughThe schema for the Changes
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (9)
src/libs/Replicate/Generated/JsonConverters.OneOf6.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/JsonSerializerContext.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/OneOf.6.Json.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/OneOf.6.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponse.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseOutput.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseOutputItem.Json.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseOutputItem.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Replicate/openapi.yaml(1 hunks)
| output: | ||
| oneOf: | ||
| - type: object | ||
| nullable: true | ||
| - type: array | ||
| items: | ||
| type: object | ||
| nullable: true | ||
| - type: string | ||
| nullable: true | ||
| - type: integer | ||
| nullable: true | ||
| - type: number | ||
| nullable: true | ||
| - type: boolean | ||
| nullable: true | ||
| description: 'The prediction output, which can be any JSON-serializable value, depending on the model' | ||
| started_at: |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Output schema missing explicit null allowance
The simplified output definition removed type constraints but also omits nullable: true. According to the spec and docs, output can become null (e.g., after data is removed), so you should explicitly allow null values to avoid schema validation errors.
@@ -979,2 +979,3
- output:
- description: 'The prediction output, which can be any JSON-serializable value, depending on the model'
+ output:
+ description: 'The prediction output, which can be any JSON-serializable value, depending on the model'
+ 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.
| output: | |
| oneOf: | |
| - type: object | |
| nullable: true | |
| - type: array | |
| items: | |
| type: object | |
| nullable: true | |
| - type: string | |
| nullable: true | |
| - type: integer | |
| nullable: true | |
| - type: number | |
| nullable: true | |
| - type: boolean | |
| nullable: true | |
| description: 'The prediction output, which can be any JSON-serializable value, depending on the model' | |
| started_at: | |
| output: | |
| description: 'The prediction output, which can be any JSON-serializable value, depending on the model' | |
| nullable: true | |
| started_at: |
🤖 Prompt for AI Agents (early access)
In src/libs/Replicate/openapi.yaml around lines 979 to 981, the output schema lacks explicit allowance for null values, which can cause validation errors since output can be null. Update the output definition to include "nullable: true" to explicitly permit null values in the schema.
Summary by CodeRabbit