You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Polymorphic responses ignore the spec discriminator: ERROR probe results parse as UnsupportedProbeResult #496
createProbe returns a polymorphic result. The spec (probes.yaml, ProbeResult) declares a discriminator on outcome with a mapping, and every variant has additionalProperties: false. The generated parser ignores both:
UnsupportedProbeResult.from_dict accepts any payload carrying outcome and worker, so an ERROR response is returned as UnsupportedProbeResult and its message is dropped. Reproduced by feeding {"outcome": "ERROR", "worker": "w", "message": "boom"} through create_probe._parse_response: the result is UnsupportedProbeResult with outcome == "ERROR".
The ErrorProbeResult branch in examples/probe.py (added in #494) therefore never runs against a real ERROR response.
Suggested direction: make union parsing dispatch on the declared discriminator (a generator hook, not a hand edit of generated code), and fall back to the current try-each-variant order only when there is none. Check the other x-polymorphic-schema responses for the same problem. Add a regression test using the payload above.
Activity