feat:Update OpenAPI spec for POST /predictions/{id}/cancel with details and schema#102
Conversation
WalkthroughThe OpenAPI specification for the Changes
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 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: 0
🧹 Nitpick comments (1)
src/libs/Replicate/openapi.yaml (1)
878-878: Use YAML block scalar for multiline description
Currently thedescriptionis a quoted string with embedded newlines, backticks, and quotes—this is error‐prone and hard to maintain. Consider switching to a|block scalar to preserve formatting and avoid escaping.Example diff:
- description: "Cancel a prediction that is currently running.\n\nExample cURL request that creates a prediction and then cancels it:\n\n```console\n# First, create a prediction\nPREDICTION_ID=$(curl -s -X POST \\\n -H \"Authorization: Bearer $REPLICATE_API_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"input\": {\n \"prompt\": \"a video that may take a while to generate\"\n }\n }' \\\n https://api.replicate.com/v1/models/minimax/video-01/predictions | jq -r '.id')\n\n# Echo the prediction ID\necho \"Created prediction with ID: $PREDICTION_ID\"\n\n# Cancel the prediction\ncurl -s -X POST \\\n -H \"Authorization: Bearer $REPLICATE_API_TOKEN\" \\\n https://api.replicate.com/v1/predictions/$PREDICTION_ID/cancel\n```" + description: | + Cancel a prediction that is currently running. + + Example cURL request that creates a prediction and then cancels it: + + ```console + # First, create a prediction + PREDICTION_ID=$(curl -s -X POST \ + -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{"input": {"prompt": "a video that may take a while to generate"}}' \ + https://api.replicate.com/v1/models/minimax/video-01/predictions | jq -r '.id') + + # Echo the prediction ID + echo "Created prediction with ID: $PREDICTION_ID" + + # Cancel the prediction + curl -s -X POST \ + -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ + https://api.replicate.com/v1/predictions/$PREDICTION_ID/cancel + ```
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsCancel.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsCancel.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Replicate/openapi.yaml(2 hunks)
🔇 Additional comments (1)
src/libs/Replicate/openapi.yaml (1)
890-893: Explicit response schema is consistent and clear
Great addition—this makes the200response for the cancel operation explicitly return theschemas_prediction_responseobject, aligning with the GET endpoint and improving client code generation.
Summary by CodeRabbit