NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #4288 most downloaded on Packagist
Hypermedia framework for object as a service
Latest stable
1.34.1
Last release 2 months ago
10 Sep 2026
Release timing varies
gaps range from 9 days to 3 months
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
149 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
[Add] OptionsMethodHeaderModule #197
<img src="https://user-images.githubusercontent.com/529021/61419621-fe86fc00-a939-11e9-94be-f11f31f36a99.png" width=300> 唐獅子図 - 狩野永徳
Nothing published for this version
Fix HTTP header Content-Type #194
Fix HTTP header Content-Type #194
Change log level by the request method
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Change log level by the request method
JSON Shcema validation for HAL link #158 #165
ResourceLogger #179 #189OPTION method output #159toString (former error is E_USER_WARNING) #168 #172newInstance() set method get #171HEAD method #177http resource #187$this->install(new FakeJsonModule);
$this->install(new CamelCakeKeyModule);
use BEAR\Resource\Annotation\ContextSchema
class FooModule
{
/**
* {@inheritdoc}
*/
protected function configure()
// ...
$this->bind()->annotatedWith(ContextSchema::class)->toInstance('app://self');
}
}
Log only when the method is "UNSAFE". (POST, PUT, etc)
$this->install(new ProdLoggerModule);
Log all request as well as response.
$this->install(new DevLoggerModule);
You may want to log login_id or special request/response information in a particular case. In that case, you can bind your own logger. The logger was called in each resource request.
$this->bind(LoggerInterface::class)->to(YourLogger::class);
Nothing published for this version
Fix dependent package version #154, #155
@kght6123 Thanks for the reporting issue!
Nothing published for this version
Fix missing method (not to change) #152
* [ADD] NullObjects #151 * [FIX] add options method #150
[ADD] JsonSchemaLinkHeaderModule #149 for JSON schema-ed resource response.
Link: <http://example.com/schema/tickets.json>; rel="describedby"
See more about Link: rel="describedby" header at http://json-schema.org/latest/json-schema-core.html#rfc.section.10.1
Thanks, @jingu, and @ryoryo !
Empty array query in default #146
Add new eager request syntax #144
New eager request syntax
$this->resource->post('page://self/index', ['name' => 'bear'])
* [Fix] Link list bug #143 Thanks @madapaja !
Thanks @madapaja !
[UPDATE] E_USER_WARNING when exception caught while resource object is rendering and improve error message (Exception class name included) #142
JsonSchemalModule to JsonSchemaModule (no "l")
Thanks @kumamidori !
Drop Request serialization support #137
Nothing published for this version
[Extract] NamedParamMetas named parameter meta class
Refactor
Nothing published for this version
[FIX] Valid Json Schema validation in status code 201 #126
Thanks @dragonwwwwww for the reporting issue !
[ADD] Resource request property access #123
Thanks @sosuke-ito !
[FIX] quick fix for ImportAppModule (ImportSchemeCollectionProvider) #121
[CHANGE] PrettyJsonis default in ResourceModule
PrettyJsonis default in ResourceModuleFor those who want use old version of Json renderer, bind JsonRenderer in your app.
$this->bind(RenderInterface::class)->to(JsonRenderer::class)->in(Scope::SINGLETON);
This release drop support PHP 5.6 and hhvm.
This release drop support PHP 5.6 and hhvm.
[FIX] the crawl link issue #118
Thanks @ryo88c !
[ADD] @Link title as comment #117
@Link title as comment #117[ADD] OPTIONS method return json schema by @JsonSchema annotation #116
Example:
Resource class
use BEAR\Resource\Annotation\JsonSchema;
use BEAR\Resource\ResourceObject;
class User extends ResourceObject
{
/**
* User
*
* Returns a variety of information about the user specified by the required $id parameter
*
* @param string $id User ID
*
* @JsonSchema(schema="user.json")
*/
public function onGet($id)
{
// $this->body = '$user;
return $this;
}
}
Json Schema
user.json
{
"type": "object",
"properties": {
"name": { "$ref": "name.json#/definitions/name"},
"age": {
"description": "Age in years",
"type": "integer",
"minimum": 20
}
},
"required": ["name", "age"]
}
name.json
{
"title": "Name",
"definitions": {
"name": {
"type": "object",
"properties": {
"firstName": {"type": "string"},
"lastName": {"type": "string"}
},
"required": ["firstName", "lastName"]
}
}
}
Request
OPTIONS /user
Response includes request and response meta information .
{
"GET": {
"summary": "User",
"description": "Returns a variety of information about the user specified by the required $id parameter",
"request": {
"parameters": {
"id": {
"type": "string",
"description": "User ID"
}
},
"required": [
"id"
]
},
"schema": {
"type": "object",
"properties": {
"name": {
"$ref": "name.json#/definitions/name"
},
"age": {
"type": "integer",
"description": "Age in years",
"minimum": 20
}
},
"required": [
"name",
"age"
]
}
}
}
Install
$this->install(JsonSchemalModule($jsonSchemaDir, $jsonValidateDir))
[ADD] json-schema index key #111
bug #109 conflict for phpdocumentor/reflection-docblock 3.2
Nothing published for this version
[NEW] @JsonSchema validation #106
@JsonSchema validation #106null default and performance improved #105 ]OPTION method allow parameter are capitalized. (GET, POST)This release update nocarrier/hal package ^0.9.12 to support curries.
This release update nocarrier/hal package ^0.9.12 to support curries.
This release fix #103 "Allow" ucword.
This release fix #103 "Allow" ucword.
[ADD] RFC 2616 OPTIONS method payload #95 #99
withQuery() query #98RFC 2616 - HTTP/1.1 specification section 9.2 page 51 OPTIONS
The response body, if any, SHOULD also include information about the communication options. The format for such a body is not defined by this specification, but might be defined by future extensions to HTTP.
The payload of OPTIONS method is generated from method signature and PHPDOC. You would not need extra work to provide specifications.
/**
* Todos list
*
* Returns the todos list specified by status
*
* @param string $status todo status
*/
public function onGet(string $status = null) : ResourceObject
{
// ....
}
/**
* Create todo
*
* Create todo and add to todos list
*
* @param string $title todo title
*
*/
public function onPost(string $title) : ResourceObject
{
// ....
}
The result of http OPTIONS method request.
curl -i -X OPTIONS http://127.0.0.1:8080/
HTTP/1.1 200 OK
Host: 127.0.0.1:8080
Date: Tue, 16 May 2017 03:48:50 +0200
Connection: close
X-Powered-By: PHP/7.1.0
Content-Type: application/json
allow: GET, POST
200 OK
Content-Type: application/json
allow: GET, POST
{
"GET": {
"summary": "Todos list",
"description": "Returns the todos list specified by status",
"parameters": {
"status": {
"description": "todo status",
"type": "string"
}
}
},
"POST": {
"summary": "Create todo",
"description": "Create todo and add to todos list",
"parameters": {
"title": {
"description": "todo title",
"type": "string"
}
},
"required": [
"title"
]
}
}
An options command works in console as well as web.
php bootstrap/web.php options /
200 OK
Content-Type: application/json
allow: GET, POST
{
"GET": {
@ResourceParam supports uri template.
The result of resource request app://self/rparam/login{?name}#nickname is injected to theid parameter.
/**
* @ResourceParam(param="id", uri="app://self/rparam/login{?name}#nickname", templated=true)
*/
public function onPost($id, $name)
{
`php class Holder extends ResourceObject { public function __construct(ResourceInterface $resource) { $resource->get->uri('app://self/author?id=1')->e
This release fix the issue #94
class Holder extends ResourceObject
{
public function __construct(ResourceInterface $resource)
{
$resource->get->uri('app://self/author?id=1')->eager->request();
}
public function onPost()
{
return true;
}
}
When constructor has another resource request, request method was shared with two resource request client because it is injected as a singleton. This PR fix the issue.
This issue is appeared when the form which has resource request in init() injected resource client.
This release fix the embed resource cache issue #93 An embedded resource request is serialized only the result of resource request invocation.
This release fix the embed resource cache issue #93 An embedded resource request is serialized only the result of resource request invocation.
This release improve the performance of ResourceModule. #92
This release improve the performance of ResourceModule. #92
A get request should be set after each request.
This release fix the bug #90
A get request should be set after each request.
This release support default method request (get). #90
This release support default method request (get). #90
Here are various way to request get resource.
$ro = $this->resource->get->uri('page://self/index')->withQuery(['id' => 'bear'])->eager->request();
$ro = $this->resource->get->uri('page://self/index?id=bear')->eager->request();
// short syntax with query
$ro = $this->resource->get->uri('page://self/index')(['id' => 'bear']); // php7
// short syntax without query
$ro = $this->resource->get->uri('page://self/index?id=bear')(); // php7
// omit the default get method
$ro = $this->resource->uri('page://self/index')() // v1.4.3 and up
``
This release clean up @Link annotation. #89
This release clean up @Link annotation. #89
This release updates dependencies #88
This release updates dependencies #88
This release drop support PHP 5.5 (unsupported)
This release drop support PHP 5.5 (unsupported)
[Add] ResourceObject implements ToStringInterface #84
[Add] ResourceObject implements ToStringInterface #84
This release fix the PHP minimum version requirement.
This release fix the PHP minimum version requirement.
@KYfactory @yoseiyoseiyosei Thanks for the reporting issue !
This release support dashed URI.
This release support dashed URI.
app://self/user/admin-user is mapped User/AdminUser class.This release fix the issue for herf() in ResourceObject.
This release fix the issue for herf() in ResourceObject.
Hyper link method can use with last invoked resource. as well as in same resource.
/**
* @Link(rel="payment", href="app://self/payment{?order_id, credit_card_number}", method="put")
*/
public function onPost($drink)
{
$payment = ['order_id' => $orderId, ' credit_card_number' => $card];
$this->href('payment', $payment);
This release prevent version conflict issue for rize/uri-template.
This release prevent version conflict issue for rize/uri-template.
Nothing published for this version
This release fix import application compile issue. #71
This release fix import application compile issue. #71
This release deprecate @LogicCache annotation. Devs does not need care about this change.
This release deprecate @LogicCache annotation. Devs does not need care about this change.
This release keep uri in ResourceObject in Uri class not a string, which things make easier.
This release keep uri in ResourceObject in Uri class not a string, which things make easier.
This release provides ImportAppModule, which imports other application into self application with specified host name.
This release provides ImportAppModule, which imports other application into self application with specified host name.
Nothing published for this version
Nothing published for this version
This release add or modify magic objects of ResourceObject. When serialize or json_encode ResourceObject, All Resource\Request is evaluated and URI ob
This release add or modify magic objects of ResourceObject. When serialize or json_encode ResourceObject, All Resource\Request is evaluated and URI object is convert to simple URI string.
Any properties except uri, code, headers, body and view will be omitted at serialization. It makes sure ResourceObject 100% serializable. For PHP 5.6, __debugInfo() also added to show only limited properties.
From this release, license is changed to MIT license.
このリリースでは serialize や json_encode でシリアライズするときに特定の uri, code, headers, body and view以外の全てのプロパティを除去します。これにより全てのResourceObjectがシリアライズ可能ということが保証されます。
This release add missing contet-type header to JsonRenderer.
This release add missing contet-type header to JsonRenderer.
This release fixes a bug for the response code. [#56] [#57]
This release fixes a bug for the response code. [#56] [#57]
arigato @madapaja 👍
Nothing published for this version
Nothing published for this version
One column per quarter.