webflow / openapi-spec

OpenAPI specification for the Webflow REST API
http://developers.webflow.com
MIT License
11 stars 2 forks source link

`/collections/{collection_id}/items` POST requires `id`? #4

Open p2004a opened 4 days ago

p2004a commented 4 days ago

The id field is marked as required for the /collections/{collection_id}/items POST, but even the example in the schema definition doesn't have the id set, an my understanding is that id is assigned by WebFlow, not user.

That again has implications for the webflow js library.

zplata commented 3 days ago

Hey @p2004a - thanks for raising. While the schema has id marked as required here, the property should have a readOnly attribute so that it isn't required on creation, and the latest version of the SDK should reflect this. Are you seeing otherwise?

p2004a commented 3 days ago

You are totally right @zplata! I've missed the readOnly attribute. So it looks like it's a bug on the js SDK side and not spec as createItem takes CollectionItem that is fully shared between read and write paths, requiring (and allowing) the same fields.