fix(tasks): correct enum variant ordering for deserialization (#634)
Move CustomRequest and CustomResult to end of their respective untagged enums to ensure specific task variants match before catch-all custom types. Add deny_unknown_fields to GetTaskInfoResult to prevent matching arbitrary JSON objects. Fixes issue where tasks/get, tasks/list, tasks/result, and tasks/cancel incorrectly deserialized as CustomRequest instead of their typed variants.
This commit is contained in:
parent
d84573a617
commit
32a68aa239
4 changed files with 21 additions and 18 deletions
|
|
@ -862,9 +862,6 @@
|
|||
{
|
||||
"$ref": "#/definitions/RequestOptionalParam4"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CustomRequest"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/Request9"
|
||||
},
|
||||
|
|
@ -876,6 +873,9 @@
|
|||
},
|
||||
{
|
||||
"$ref": "#/definitions/Request11"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CustomRequest"
|
||||
}
|
||||
],
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -862,9 +862,6 @@
|
|||
{
|
||||
"$ref": "#/definitions/RequestOptionalParam4"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CustomRequest"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/Request9"
|
||||
},
|
||||
|
|
@ -876,6 +873,9 @@
|
|||
},
|
||||
{
|
||||
"$ref": "#/definitions/Request11"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CustomRequest"
|
||||
}
|
||||
],
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -857,7 +857,8 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"Icon": {
|
||||
"description": "A URL pointing to an icon resource or a base64-encoded data URI.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
|
||||
|
|
@ -2452,9 +2453,6 @@
|
|||
{
|
||||
"$ref": "#/definitions/EmptyObject"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CustomResult"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CreateTaskResult"
|
||||
},
|
||||
|
|
@ -2466,6 +2464,9 @@
|
|||
},
|
||||
{
|
||||
"$ref": "#/definitions/TaskResult"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CustomResult"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -857,7 +857,8 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"Icon": {
|
||||
"description": "A URL pointing to an icon resource or a base64-encoded data URI.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
|
||||
|
|
@ -2452,9 +2453,6 @@
|
|||
{
|
||||
"$ref": "#/definitions/EmptyObject"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CustomResult"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CreateTaskResult"
|
||||
},
|
||||
|
|
@ -2466,6 +2464,9 @@
|
|||
},
|
||||
{
|
||||
"$ref": "#/definitions/TaskResult"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/CustomResult"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue