ApiConfigControllers::post() should detect a conflicting ID and throw a 409 exception

Created on 4 February 2025, about 1 month ago

Overview

Reported by @balintbrews at #3503547-2: Display validation errors in code component dialogs โ†’ .

Creating multiple code components in the UI with the same name results in a 500 response.

Proposed resolution

Match what JSON:API does:

    // Return a 409 Conflict response in accordance with the JSON:API spec. See
    // http://jsonapi.org/format/#crud-creating-responses-409.
    if ($this->entityExists($parsed_entity)) {
      throw new ConflictHttpException('Conflict: Entity already exists.');
    }

User interface changes

๐Ÿ› Bug report
Status

Active

Version

0.0

Component

Internal HTTP API

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

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