open #/components/schemas/LayoutPreview should require properties

Created on 14 January 2025, 6 days ago

Overview

Discovered in πŸ“Œ Missing e2e for Publish button hides bugs Active

  '/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 πŸ“Œ Change ApiContentUpdateForDemoController to save from auto-save instead of request data Active 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 πŸ“Œ Missing e2e for Publish button hides bugs Active )
  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

πŸ› Bug report
Status

Active

Version

0.0

Component

Internal HTTP API

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024