What is the meaning of an empty "content" definition? #2875
-
For a Request Body Object, the "content" attribute must be defined. But what if no media type mappings are specified? Is an empty "content" definition valid? If so, what does it mean? Equivalent to "content undefined", i.e. an error? That any kind of content data is acceptable? The same question arises for the "content" of a Response Object (although "content" is optional there) and a Parameter Object |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
From what I recall, Parameter Object - the documentation states that one and only one media type must be in the map, so no problem there. Request Body Object - I believe there's an oversight here. I think we should have mentioned that by minimum, a single map entry is required. The reason being is that Request Body Object is not a required field in an operation, and if you specify it, it means that there's necessarily a payload. If there's necessarily a payload, you need to define what kind of payload it is. Maybe some more feedback from the @OAI/tsc is needed here, but I think that's a clarification we can put in v3.1.1. Response Object - unlike request bodies, responses don't necessarily have a payload even when you define them, which is why |
Beta Was this translation helpful? Give feedback.
From what I recall,
content
is available in three places - Parameter Object, Request Body Object and Response Object.Parameter Object - the documentation states that one and only one media type must be in the map, so no problem there.
Request Body Object - I believe there's an oversight here. I think we should have mentioned that by minimum, a single map entry is required. The reason being is that Request Body Object is not a required field in an operation, and if you specify it, it means that there's necessarily a payload. If there's necessarily a payload, you need to define what kind of payload it is. Maybe some more feedback from the @OAI/tsc is needed here, but I think that's a clari…