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
- We had no e2e test that was making this request(solved by #3498219: Missing E2E test for Publish button hides bugs)
-
requestBodyultimately 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
Issue fork experience_builder-3499649
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
Comment #2
tedbowComment #3
wim leersYep, and that's exactly the sort of thing I just pushed back on over at #3486203: Integrate saving sections with the backend: (de)normalize Pattern config entities using the client-side data model, and where @TravisCarden just pointed to #3472617: Document where the cut-off lies of where OpenAPI validation ends and entity validation begins over at #3472617: Document where the cut-off lies of where OpenAPI validation ends and entity validation begins.
Comment #5
tedbowrerunning e2e test. Hopefully it was a random fail
Comment #6
tedbowComment #8
wim leersComment #10
wim leers