-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/master' into 1.9
- Loading branch information
Showing
87 changed files
with
1,063 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
#OroApiBundle | ||
OroApiBundle | ||
============ | ||
|
||
The goal of this bundle is to make a creation of different kinds of APIs as easy as possible. | ||
|
||
The main idea of this bundle is to provide some default implementation of API which can be reused and easily changed for any entity if required. | ||
|
||
To achieve this, this bundle is implemented based on two ORO components: [ChainProcessor](../../Component/ChainProcessor/) and [EntitySerializer](../../Component/EntitySerializer/). The ChainProcessor component is responsible to organize data processing flow. The EntitySerializer component provides the fast access to entities data. | ||
|
||
**Notes**: | ||
- For now only GET requests for REST and JSON.API are implemented. | ||
- This documentation is not full and it will be completed soon. | ||
|
||
Table of Contents | ||
----------------- | ||
- [Configuration](./Resources/doc/configuration.md) | ||
- [Debug commands](./Resources/doc/debug_commands.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Configuration | ||
------------- | ||
|
||
By default API for all entities, except custom entities, dictionaries and enumerations are disabled. To enable API for any entity you can use `Resources/config/oro/api.yml` file. For example, to make `Acme\Bundle\ProductBundle\Product` entity accessible through API you can write the following configuration: | ||
|
||
```yaml | ||
oro_api: | ||
entities: | ||
Acme\Bundle\ProductBundle\Product: ~ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
Debug commands | ||
-------------- | ||
|
||
### oro:api:debug | ||
This command shows details about registered API actions and processors. | ||
|
||
If you want to know all actions run this command without parameters: | ||
|
||
```bash | ||
php app/console oro:api:debug | ||
``` | ||
|
||
If you want to know which processors are registered for a particular action run this command with the action name as an argument: | ||
|
||
```bash | ||
php app/console oro:api:debug get_list | ||
``` | ||
|
||
The `request-type` option can be used to see the processors which will be executed for a particular request type: | ||
|
||
```bash | ||
php app/console oro:api:debug get_list --request-type=rest --request-type=json_api | ||
``` | ||
|
||
### oro:api:resources:dump | ||
This command shows all API resources. | ||
|
||
Run this command without parameters to see all available API resources: | ||
|
||
```bash | ||
php app/console oro:api:resources:dump | ||
``` | ||
|
||
or specify the `request-type` option if you need to know API resources for a particular request type: | ||
|
||
```bash | ||
php app/console oro:api:resources:dump --request-type=rest --request-type=json_api | ||
``` | ||
|
||
### oro:api:config:dump | ||
This command shows API configuration for a particular entity. | ||
|
||
Run this command and specify entity class or entity alias as an argument: | ||
|
||
```bash | ||
php app/console oro:api:config:dump "Oro\Bundle\UserBundle\Entity\User" | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
php app/console oro:api:config:dump users | ||
``` | ||
|
||
To see API configuration for a particular request type you can use the `request-type` option: | ||
|
||
```bash | ||
php app/console oro:api:config:dump users --request-type=rest --request-type=json_api | ||
``` | ||
|
||
If you want to see human-readable representation of an entity and its fields, you can use the `with-descriptions` option: | ||
|
||
```bash | ||
php app/console oro:api:config:dump users --with-descriptions | ||
``` | ||
|
||
The `section` option can be used to see a configuration of an entity when it is referenced by another entity: | ||
|
||
```bash | ||
php app/console oro:api:config:dump addresses --section=relations | ||
``` | ||
|
||
### oro:api:metadata:dump | ||
This command shows metadata for a particular entity. | ||
|
||
To see metadata run this command and specify entity class or entity alias as an argument: | ||
|
||
```bash | ||
php app/console oro:api:metadata:dump "Oro\Bundle\UserBundle\Entity\User" | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
php app/console oro:api:metadata:dump users | ||
``` | ||
|
||
If you want to see entity metadata that is used for a particular request type you can use the `request-type` option: | ||
|
||
```bash | ||
php app/console oro:api:metadata:dump users --request-type=rest --request-type=json_api | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.