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

Wrong type for Collection `fields`

Open iksi opened this issue 1 year ago • 1 comments

The Collection interface seems to have the wrong type in src/api/types/Collection.ts:

/** The list of fields in the Collection */
fields: Record<string, unknown>;

It seems that this should be an array of Field (from src/api/types/Field.d.ts):

fields: Field[];

Currently I’m getting this warning when running webflowClient.collections.get:

Failed to validate.
  - response.fields: Expected object. Received list.

iksi avatar Apr 26 '24 09:04 iksi

Also see https://github.com/webflow/js-webflow-api/issues/138#issue-2227378133

iksi avatar Apr 26 '24 09:04 iksi

Closing as this is fixed with the latest version of the SDK.

iksi avatar Jul 18 '24 15:07 iksi