Is 'id' a reserved key in properties?

Created on 7 December 2024, 17 days ago

Problem/Motivation

Following the guide in https://www.drupal.org/docs/develop/theming-drupal/using-single-director... β†’

name: My Component
status: stable
group: Molecule/My Component
props:
  type: object
  properties:
    id:
      type: string
      title: Uh oh...

PHPstorm's intellisense reports Schema validation: Incompatible types. Required: string. Actual: object..

Changing the id property to any other string makes it happy. Is id a reserved / special identifier under props, or is PHPStorm just bugging out? πŸ€”

Steps to reproduce

On PHPStorm 2024.2.3, add this SDC.

$schema: 'https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json'
name: Accordion
status: stable
group: Molecule/Accordion
description: An accordion component
props:
  type: object
  properties:
    id:
      type: string
      title: Accordion content ID

and see these squiggles...

Proposed resolution

Add documentation about if ID is reserved...or maybe guidance on how to make phpstorm behave better?

User interface changes

Maybe new docs?

API changes

None

Data model changes

None

πŸ’¬ Support request
Status

Active

Version

11.1 πŸ”₯

Component

single-directory components

Created by

πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

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

Comments & Activities

Production build 0.71.5 2024