Skip to content

How should file-information be returned in element and collection endpoints? #446

@Syndesi

Description

@Syndesi

Currently individual elements as well as collections of elements return data in the following schema:

{
  "type": "Comment",
  "id": "74a8fcd9-6cb0-4b0d-8d42-0b6c3c54d1ac",
  "data": {
    "created": "2025-09-27T10:39:51+00:00",
    "name": "Blue",
    "updated": "2025-09-27T10:39:51+00:00",
    "content": "Blue is ..."
  }
}

We now have two different options to represent file data:

Option A: As data properties

{
  "type": "Comment",
  "id": "74a8fcd9-6cb0-4b0d-8d42-0b6c3c54d1ac",
  "data": {
    "created": "2025-09-27T10:39:51+00:00",
    "name": "Blue",
    "updated": "2025-09-27T10:39:51+00:00",
    "content": "Blue is ...",
    "file": {
      "contentLength": 1234,
      ...
    }
  }
}

Option B: As a new root level property

{
  "type": "Comment",
  "id": "74a8fcd9-6cb0-4b0d-8d42-0b6c3c54d1ac",
  "data": {
    "created": "2025-09-27T10:39:51+00:00",
    "name": "Blue",
    "updated": "2025-09-27T10:39:51+00:00",
    "content": "Blue is ..."
  },
  "file": {
    "contentLength": 1234,
    ...
  }
}

Acceptance criteria

  • Create pro- / contra-list of both variants
  • Think about side effects, e.g. Elasticsearch serialization, search, event listeners to block users from directly modifying file properties, ...
  • Define the chosen variant
  • Implement chosen variant

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureIntroducing new capabilities.QuestionSeeking clarifications or information.

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions