I’ll provide a direct answer to your query, then a suggestion for what may be a better solution.
If your response references the schema ‘myResponse’ for your application/json , you can use this syntax:
title: My Response
description: A short or long response
title: Short Response
description: A shorter response
title: Long Response
description: A longer response
- type: object
This is a literal interpretation of your question.
However, many tools (like client code generators) do not
oneOf very well.
Another option is to not us a query parameter, but rather use
a profile in the Accept: request header media type
and a profile in the response. See https://www.w3.org/TR/dx-prof-conneg/
then the client can make the request and use
to ask for the shorter response, and
to ask for the longer response, using standard HTTP content type negotiation.