Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-28253

[REST] As a frontend developer I would like to get information about field type in the CurrentVersion object

    Details

    • Sprint:
      Sprint 6
    • Story Points:
      1

      Description

      As a frontend developer I would like to get information about field type in the CurrentVersion object.
      Now, I get only:

      • fieldDefinitionIdentifier,
      • fieldValue,
      • id,
      • languageCode.

      I'm missing the fieldTypeIdentifier, because basing on the fieldDefinitionIdentifier is non-deterministic and might lead to errors in the frontend. For instance, I'm looking for an ezimage field and the image field can be of ezstring type or an ezimage field type. Both are named with the same identifier. Detecting ezimage field might be difficult.

      Sample endpoints:

      search query

      POST http://ezplatform.prod/api/ezp/v2/views
       
      {
        "ViewInput": 
        {
          "identifier":"subitems-load-content-info-98,100,101,102,103,104,105,106,107,108",
          "public":false,
          "ContentQuery":
          {
            "Criteria":{},
            "FacetBuilders":{},
            "SortClauses":{},
            "Filter": { "ContentIdCriterion":"98,100,101,102,103,104,105,106,107,108" },
            "limit":10,
            "offset":0
          }
        }
      }
      

        Activity

        Hide
        Bertrand Dunogier added a comment -

        basing on the fieldDefinitionIdentifier is non-deterministic

        It isn't meant to be. Doing so would really have a lot of implications.

        The "proper" (API) way to do this is clearly to map the Content's field definition identifiers to the Content Type's. We can nonetheless consider such an addition, but I'd first like to understand why we can't / won't cover that using the Content Type.

        Show
        Bertrand Dunogier added a comment - basing on the fieldDefinitionIdentifier is non-deterministic It isn't meant to be. Doing so would really have a lot of implications. The "proper" (API) way to do this is clearly to map the Content's field definition identifiers to the Content Type's. We can nonetheless consider such an addition, but I'd first like to understand why we can't / won't cover that using the Content Type.
        Hide
        Bertrand Dunogier added a comment -

        This small change will reduce amount of REST calls in sub-items

        OK, with this context it does make sense. I'd rather go with adding the FieldType to the Field then. Does it work for all of you ?

        Show
        Bertrand Dunogier added a comment - This small change will reduce amount of REST calls in sub-items OK, with this context it does make sense. I'd rather go with adding the FieldType to the Field then. Does it work for all of you ?
        Hide
        Andrzej Longosz added a comment -

        I'd rather go with adding the FieldType to the Field then. Does it work for all of you ?

        For me perfectly

        Show
        Andrzej Longosz added a comment - I'd rather go with adding the FieldType to the Field then. Does it work for all of you ? For me perfectly
        Hide
        Bertrand Dunogier added a comment -

        Added a subtask for the Public API part. Feel free to make it a story if you prefer, as I believe it has value on its own. Maybe what we could do is update this story to be about the API in general, and keep the subtask for the Public API implementation.

        Is it good for all of you ? Ping Sławomir Uchto for approval.

        Show
        Bertrand Dunogier added a comment - Added a subtask for the Public API part. Feel free to make it a story if you prefer, as I believe it has value on its own. Maybe what we could do is update this story to be about the API in general, and keep the subtask for the Public API implementation. Is it good for all of you ? Ping Sławomir Uchto for approval.
        Hide
        Sławomir Uchto added a comment -

        Bertrand Dunogier: "You have my axe"

        Show
        Sławomir Uchto added a comment - Bertrand Dunogier : "You have my axe"
        Hide
        Andrzej Longosz added a comment - - edited
        Show
        Andrzej Longosz added a comment - - edited PR: https://github.com/ezsystems/ezpublish-kernel/pull/2168 merged into 6.13@f640741 and up.

          People

          • Assignee:
            Unassigned
            Reporter:
            Piotr Nalepa
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile