Overview

Discovered in #3498219: Missing E2E test for Publish button hides bugs

  '/xb/api/content-update/{entityTypeId}/{entityId}':
    patch:
      parameters:
        - $ref: '#/components/parameters/entityTypeId'
        - $ref: '#/components/parameters/entityId'
      requestBody:
        $ref: '#/components/requestBodies/Layout'

requestBody here is wrong
This was added in !498 (diffs) but I pretty sure it was wrong at the time. Because since #3493889: Change ApiContentUpdateForDemoController to save from auto-save instead of request data the request no longer needed the layout preview

The reason it wasn't failing I think is 2 reasons

  1. We had no e2e test that was making this request(solved by #3498219: Missing E2E test for Publish button hides bugs)
  2. requestBody ultimately pointed to `#/components/schemas/LayoutPreview` but if you look there none of the properties are actually required. So the 1 test where we had teste this `\Drupal\Tests\experience_builder\Functional\ApiContentUpdateForDemoControllerTest` it just sent a empty request. ['headers' => ['Content-Type' => 'application/json'], 'body' => json_encode(new \stdClass())],

Proposed resolution

Determine if #/components/schemas/LayoutPreview should have require properties.
Determine if xb/api/content-update/{entityTypeId}/{entityId} needs a documented requestBody test body

We should keep in mind thatxb/api/content-update/{entityTypeId}/{entityId} is just temporary so maybe we can skip that problem.

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tedbow created an issue. See original summary.

tedbow’s picture

Title: open #/components/schemas/LayoutPreview should require properties » openpi.yml #/components/schemas/LayoutPreview should require properties
wim leers’s picture

tedbow’s picture

Assigned: Unassigned » tedbow

rerunning e2e test. Hopefully it was a random fail

tedbow’s picture

Assigned: tedbow » Unassigned
Status: Active » Needs review

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

  • wim leers committed 3820590f on 0.x authored by tedbow
    Issue #3499649 by tedbow, wim leers, traviscarden: openapi.yml #/...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.