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:
apexlnc 2026-01-29 20:30:53 -05:00 • committed by GitHub
commit 32a68aa239
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 18 deletions

View file

@ -862,9 +862,6 @@
{
"$ref": "#/definitions/RequestOptionalParam4"
},
{
"$ref": "#/definitions/CustomRequest"
},
{
"$ref": "#/definitions/Request9"
},
@ -876,6 +873,9 @@
},
{
"$ref": "#/definitions/Request11"
},
{
"$ref": "#/definitions/CustomRequest"
}
],
"required": [

View file

@ -862,9 +862,6 @@
{
"$ref": "#/definitions/RequestOptionalParam4"
},
{
"$ref": "#/definitions/CustomRequest"
},
{
"$ref": "#/definitions/Request9"
},
@ -876,6 +873,9 @@
},
{
"$ref": "#/definitions/Request11"
},
{
"$ref": "#/definitions/CustomRequest"
}
],
"required": [

View file

@ -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"
}
]
},

View file

@ -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"
}
]
},