I'm trying to return a complicated object via JSON:RPC and I'm getting an error.
My code looks like this (simplified):
public function execute(ParameterBag $params) {
$public_key_credential_creation_options = PublicKeyCredentialCreationOptions::create(
$rp_entity,
$user_entity,
$challenge,
[],
return $public_key_credential_creation_options;
}
public static function outputSchema(): array {
return ['type' => 'object'];
}
And I'm getting this error:
Error: Cannot modify readonly property Webauthn\PublicKeyCredentialOptions::$challenge in JsonSchema\Constraints\ObjectConstraint->getProperty() (line 164 of /var/www/html/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php).
I don't think that's the root error. If I return a string (return json_encode($public_key_credential_creation_options);
), then I get the object returned as a string. But how can I return the object as a JSON object?
Do I need to provide a full schema in outputSchema()
?
Active
2.0
Documentation