webflow / js-webflow-api

Node.js SDK for the Webflow Data API
https://www.npmjs.com/package/webflow-api
296 stars 95 forks source link

Wrong type for Collection `fields` #141

Closed iksi closed 2 months ago

iksi commented 5 months ago

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 commented 5 months ago

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

iksi commented 2 months ago

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