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

Prevent REST hrefs without prefix in payloads

    XMLWordPrintable

Details

    • Aconcagua Sprint 3
    • 1

    Description

      Situation in 5.0 & 5.1

      Due to the dual router situation we've had in 5.1 & 5.2, it is possible to ignore the REST prefix (/api/ezp/v2) when referencing elements in REST payloads:

      This will be accepted:

      POST /api/ezp/v2/content/objects/42/locations HTTP/1.1
      
      <?xml version="1.0" encoding="UTF-8"?>
      <LocationCreate>
        <ParentLocation href="/content/locations/1/43" />
      </LocationCreate>
      

      While this is the correct one:

      POST /api/ezp/v2/content/objects/42/locations HTTP/1.1
      
      <?xml version="1.0" encoding="UTF-8"?>
      <LocationCreate>
        <ParentLocation href="/api/ezp/v2/content/locations/1/43" />
      </LocationCreate>
      

      Our documentation in regards to this is a bit of a grey area. The spec, that acts as a reference doc, doesn't even have the concept of a prefix.

      Actions

      Update the spec

      • add an introduction paragraph that explains this prefix, and reminds the basics of HATEOAS.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bertrand.dunogier@ibexa.co Bertrand Dunogier
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 day Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 3 hours
                1d 3h