Skip to content

Collection Item lastPublished should be nullable ? #8

@woodcipher

Description

@woodcipher

Summary

The Collection Item schema in v2.yml defines lastPublished as a required, non-nullable string. In practice, the Webflow API returns null for this field on unpublished items. It seems the schema should reflect this by marking the field as nullable.

Location in the spec

v2.yml, around line 16618:

required:
  - id
  - fieldData
  - lastPublished
  - lastUpdated
  - createdOn
lastPublished:
  type: string
  format: date-string
  readOnly: true
  example: '2023-03-17T18:47:35.560Z'
  description: The date the item was last published

Suggestion

Add nullable: true to lastPublished
Note: The customDomains[].lastPublished property elsewhere in the spec already includes nullable: true

Impact

Code generators (e.g. datamodel-codegen) produce a non-optional str field from this schema, which causes validation errors when the API returns null:

Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions