diff --git a/crates/bevy_remote/src/lib.rs b/crates/bevy_remote/src/lib.rs index e1ff833053..81dd2e0185 100644 --- a/crates/bevy_remote/src/lib.rs +++ b/crates/bevy_remote/src/lib.rs @@ -133,7 +133,8 @@ //! //! `params`: //! - `data`: -//! - `components` (optional): An array of [fully-qualified type names] of components to fetch. +//! - `components` (optional): An array of [fully-qualified type names] of components to fetch, +//! see _below_ example for a query to list all the type names in **your** project. //! - `option` (optional): An array of fully-qualified type names of components to fetch optionally. //! - `has` (optional): An array of fully-qualified type names of components whose presence will be //! reported as boolean values. @@ -142,8 +143,8 @@ //! on entities in order for them to be included in results. //! - `without` (optional): An array of fully-qualified type names of components that must *not* be //! present on entities in order for them to be included in results. -//! - `strict` (optional): A flag to enable strict mode which will fail if any one of the -//! components is not present or can not be reflected. Defaults to false. +//! - `strict` (optional): A flag to enable strict mode which will fail if any one of the +//! components is not present or can not be reflected. Defaults to false. //! //! `result`: An array, each of which is an object containing: //! - `entity`: The ID of a query-matching entity. @@ -152,6 +153,8 @@ //! - `has`: A map associating each type name from `has` to a boolean value indicating whether or not the //! entity has that component. If `has` was empty or omitted, this key will be omitted in the response. //! +//! +//! //! ### bevy/spawn //! //! Create a new entity with the provided components and return the resulting entity ID. @@ -567,6 +570,26 @@ pub struct RemoteWatchingRequests(Vec<(BrpMessage, RemoteWatchingMethodSystemId) /// } /// } /// ``` +/// Or, to list all the fully-qualified type paths in **your** project, pass Null to the +/// `params`. +/// ```json +/// { +/// "jsonrpc": "2.0", +/// "method": "bevy/list", +/// "id": 0, +/// "params": null +///} +///``` +/// +/// In Rust: +/// ```ignore +/// let req = BrpRequest { +/// jsonrpc: "2.0".to_string(), +/// method: BRP_LIST_METHOD.to_string(), // All the methods have consts +/// id: Some(ureq::json!(0)), +/// params: None, +/// }; +/// ``` #[derive(Debug, Serialize, Deserialize, Clone)] pub struct BrpRequest { /// This field is mandatory and must be set to `"2.0"` for the request to be accepted.