Repository navigation
Describe streams and file uploads on generation OpenAPI - #575
tombeckenham merged 2 commits into
Conversation
GET /v1/openapi/{provider} was labeling every body application/json, so a client generated from it parsed SSE as one JSON value and sent file uploads as JSON.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
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. |
A success response that lists both types keeps both. The event schema is stored as its own schema version, and the generation document puts it on a second operation whose fragment is not sent, so hey-api emits an SSE client for the real URL. A boolean stream field no longer becomes an event-stream response.
Fixes #559
GET /v1/openapi/{provider}now uses the upstream media type. A file upload ismultipart/form-data. When the success response streams, the 200 content istext/event-stream(Anthropic is included when the request schema declaresstream: booleanand the spec only lists JSON). Audio andapplication/octet-streamstay on the response beside a stream.@hey-api/openapi-tsprefersapplication/jsonwhenever that type is also listed, thenJSON.parses the SSE body and sends a file as JSON. A streaming operation therefore publishes the stream type on its own. The stored JSON schema is unchanged and is the schema under that content type. Speech responses with no stored schema are{ type: string, format: binary }.The types live on
endpoints(request_content_type,response_content_types). Null means JSON, so a sync does not rewrite every row. Streaming and upload operations pick the new types up on the next spec sync.