How to represent dynamic type in response body ? #4427
-
Hello, guys! thanks for your contribution! I am new to OpenAPI, hope you guys can help me to understand this question: I have a legacy API like this:
for example:
while
and there are many other types ... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If you know up-front which values |
Beta Was this translation helpful? Give feedback.
-
I'm going to close this as answered (and addressed more deeply in the moonwalk repo) |
Beta Was this translation helpful? Give feedback.
Yes, I agree with @ralfhandl . If that is not feasible, you just have to use a
oneOf
oranyOf
schema and there's no real way to correlate the path parameter and the response type. This is something we are working to fix in OAS 4.0 a.k.a. "Moonwalk", and you can follow the discussions in the OAI/sig-moonwalk repository if you are interested.