Skip to content

Comments

Add component info to BRP registry schema#23102

Open
splo wants to merge 2 commits intobevyengine:mainfrom
splo:brp-schema-component-info
Open

Add component info to BRP registry schema#23102
splo wants to merge 2 commits intobevyengine:mainfrom
splo:brp-schema-component-info

Conversation

@splo
Copy link
Contributor

@splo splo commented Feb 21, 2026

Objective

Add component metadata to the BRP registry.schema method.

The following data related to components is missing and this PR adds it:

  • Whether the component is mutable or not.
  • Type paths of required components.
  • Whether the component is a relationship or relationship target.

Other metadata could easily be added, basically everything in the ComponentInfo type.

Solution

  • Once per type, use World::components to obtain an eventual ComponentId and ComponentInfo.
  • Use it to fill the new component_info field.
  • It doesn't introduce a breaking change, as the new field is optional and hidden for non-component types.

Testing

  • I added a unit test. It verifies mutability, required components, and relationship kind for a few test components.
  • I also called BRP to retrieve a schema and verify the returned data is correct.

Showcase

Here are a few example of the returned JSON schema when calling the BRP registry.schema method:

{
"bevy_ecs::hierarchy::ChildOf": {
  "componentInfo": {
    "mutable": false,
    "relationshipKind": "Relationship"
  },
  // Other fields hidden for brevity.
},
"bevy_ecs::hierarchy::Children": {
  "componentInfo": {
    "mutable": true,
    "relationshipKind": "RelationshipTarget"
  },
  // Other fields hidden for brevity.
},
"bevy_transform::components::transform::Transform": {
  "componentInfo": {
    "mutable": true,
    "requiredComponentTypes": [
      "bevy_transform::components::global_transform::GlobalTransform",
      "bevy_transform::components::transform::TransformTreeChanged"
    ]
  },
  // Other fields hidden for brevity.
}

@splo
Copy link
Contributor Author

splo commented Feb 21, 2026

This PR relates to issue #23076 but it doesn't fix it: this PR adds the missing component info to BRP while the issue is about adding it to reflect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant