-
I have a situation where a single operation will have to return responses in many different shapes, for legacy reason. In this single endpoint, the responses can look like the following {
"contact":true,
"input":false,
"license":false,
"credentials":false,
"camera-exist":false
} {
"request":"OK",
"camera_api_version":"3.4.0",
"product_version":"1.6.15",
"product":"DataManager",
"time":1653485942
} ok 1516342680.0 {
"status": "CM_OK",
"date": "1516342680.0"
} I tried using |
Beta Was this translation helpful? Give feedback.
Answered by
kubukoz
Nov 27, 2022
Replies: 1 comment 6 replies
-
I think you can use a union, but with the @Untagged trait. Your output type will still be a struct, but it'll have one member annotated with @httpPayload. |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
Baccata
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you can use a union, but with the @Untagged trait. Your output type will still be a struct, but it'll have one member annotated with @httpPayload.