use com\example\ObjectId;
use web\frontend\{Handler, Get};
#[Handler('/posts')]
class Posts {
#[Get('/{id}')]
public function get(ObjectId $id) {
return ['id' => $id->string()];
}
}
This would previously raise the following error: Argument 1 ($id) must be of type com\example\ObjectId, string given. This pull request makes this library behave consistently with https://github.com/xp-forge/rest-api
Example:
This would previously raise the following error: Argument 1 ($id) must be of type com\example\ObjectId, string given. This pull request makes this library behave consistently with https://github.com/xp-forge/rest-api