Getting strange UnrecognizedKwargsError error

Same thing also happened to me;

So this was the initial openapi that doesn’t work and returns UnrecognizedKwargsError: requestArgs

"/api/v1/me/example": {
  "post": {
    "summary": "Just a redacted example",
    "operationId": "executeExample",
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "recordIdOrSlug"
            ],
            "properties": {
              "idOrSlug": {
                "oneOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "description": "The ID of the record to find. In UUID format.",
                    "examples": [
                      "090abc6e-0e19-466d-8549-83dd24c5c8e5"
                    ]
                  },
                  {
                    "type": "string",
                    "description": "The slug of the record to run.",
                    "examples": [
                      "myRecord"
                    ]
                  }
                ]
              },
              "requestArgs": {
                "type": "object",
                "description": "The request arguments to pass to the record in a form of an object.",
                "additionalProperties": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "responses": {
      "200": {
        "description": "Successfully ran the record",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiSuccess"
            }
          }
        }
      },
      "400": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      }
    }
  }
},

Tried updating requestArgs as following, but no success.

"requestArgs": {
  "type": "object",
  "description": "The request arguments to pass to the record in a form of an object.",
  "additionalProperties": true
}

Multiple attempts after, tried with this;

"requestArgs": {
  "type": "object",
  "description": "The request arguments to pass to the record in a form of an object.",
  "properties": {},
  "additionalProperties": true
}

And it started working. Weird…

1 Like

This solved my issue, thank you a million. It seems if you define a type as an object it must have a properties field, even if its just an empty dictionary value.

  "properties": {},

Otherwise you will get the UnrecognizedKwargsError

1 Like

Hi, do you have an example?
thanks a lot