withSchema

Learn how to include the content schema in the response metadata.

This method includes the content schema in the response metadata.

Signature

This method has the following signature:

public function withSchema(bool $includeSchema = true): self

This method returns a copy of the options with the change applied, leaving the original unchanged.

Example

Here is a basic example of how to use this method:

<?phpuse Croct\Plug\FetchOptions;
$options = FetchOptions::defaults()->withSchema();

Parameters

The following list describes the supported parameters:

includeSchema(optional)
boolean

Whether to include the content schema in the response metadata.

Default:true