Hello,
I think there is a bug in the interpretation of explode: false
for query parameters.
From the OpenAPI reference:
explode
(true/false) specifies whether arrays and objects should generate separate parameters for each array item or object property.
Given the following OpenAPI definition:
{
"openapi": "3.0.3",
"paths": {
"/mesh/": {
"get": {
"tags": [
"Mesh"
],
"summary": "Get all meshes",
"description": "Get all meshes",
"operationId": "list_mesh",
"parameters": [
{
"name": "fields[mesh]",
"in": "query",
"description": "Specifies the specific fields should be returned. The value **MUST** be a comma-separated\n(U+002C COMMA, “,”) list that refers to the name(s) of the fields to be returned. An empty value\nindicates that no fields should be returned.",
"required": false,
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"primitives",
"weights",
"name"
]
},
"nullable": true
},
"explode": false
},
my GPT will attempt to run the action with the following query string:
/mesh/?fields%5Bmesh%5D=name&fields%5Bmesh%5D=primitives
Which is obviously wrong, since it should be:
/mesh/?fields%5Bmesh%5D=name,primitives
But it gets worse: most of the time, the GPT won’t even go as far as trying to query my server: it will fail early during what I assume is the validation of the action’s query against the provided OpenAPI definition for that action.
When I try to debug this kind of parameter in the GPT editor, it is apparently properly understood. But when I try to actually run the corresponding action it does not work:
There is an inconsistency between how the OpenAPI definition is validated and how the query parameters are effectively serialized:
{
"domain": "mesh.api.gltf.live",
"method": "get",
"path": "/mesh/",
"operation": "list_mesh",
"operation_hash": "01efab8c08c1af6b81c63ba697c420153dc6ca20",
"is_consequential": false,
"params": {
"fields[mesh]": "name,primitives",
"include": "primitives"
}
}
{
"response_data": "ApiTypeError: Expected fields[mesh] to be a list"
}
IMHO "fields[mesh]": "name,primitives"
is valid, so the ApiTypeError
is a false positive and it’s a bug.