Given any version of the spec (I'm using 3.0.3, but would be happy to change that to whatever), and given a particular path & method, e.g., post to /auth, does the openapi spec have anything to say about whether it is allowed for a 200 response to be text/plain while other error responses are of type application/json?
I'm using a yaml definition with the Python Connexion framework . I've posted an issue on their github to see if anyone has ideas about whether it's a bug in the framework; however, I was hoping someone here might be able to say whether the spec has an opinion on this.
Yes, OpenAPI 3 supports this. Media type and schemas can vary per HTTP status code, and it's even possible to define multiple media types with different schemas for the same status code. For example, this is a valid OpenAPI 3 definition:
description: Plain text or XML
The issue you're seeing seems to be a bug or limitation of the Connexion framework. Please follow up with them to troubleshoot the issue.
Helen Kosova SmartBear Documentation Team Lead ________________________ Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️