js-webflow-api icon indicating copy to clipboard operation
js-webflow-api copied to clipboard

Validation Error: Invalid field type: Boolean

Open iksi opened this issue 1 year ago • 0 comments

When attempting to create a boolean field on a collection using

await webflow.collections.fields.create(collection.id, {
	displayName: 'Has children',
	type: 'Boolean',
})

The following error is returned:

{"error":{"statusCode":400,"body":{"message":"Validation Error: Invalid field type: Boolean","code":"validation_error","externalReference":null,"details":[]}}}

When creating a switch field manually, the following is returned where the field type is “Switch”:

 {
    "id": "6259467f67141676b0e7327f1d73446d",
    "isEditable": true,
    "isRequired": false,
    "type": "Switch",
    "slug": "has-children",
    "displayName": "Has children",
    "helpText": null,
    "validations": null
}

iksi avatar May 02 '24 13:05 iksi