experteam/api-base-bundle

Base functionality bundle for APIs

Installs: 7 521

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

3.4.2 2024-04-02 20:24 UTC

README

Base Services for APIs in Symfony 5.1+
It includes:

  • Params Client: Service to obtain the value of parameters defined in api-companies.
  • JSend Response: Sets the format of the JSON response according to the JSEND specification (https://github.com/omniti-labs/jsend).
  • Request Util: Request validation service.

Install

  1. Run de following composer command:
composer require experteam/api-base-bundle
  1. Create the configuration file through any of the following options:

    a. Manually copy the example file in the package root to the folder config/packages/.

    b. Copy the vendor_copy.php file to the root of the project and configure the scripts in the composer.json file:

    "scripts": {
         "vendor-scripts": [
             "@php vendor_copy.php -s vendor/experteam/api-base-bundle/experteam_api_base.yaml.example -d config/packages/experteam_api_base.yaml --not-overwrite --ignore-no-source"
         ],
         "post-install-cmd": [
             "@vendor-scripts"
         ],
         "post-update-cmd": [
             "@vendor-scripts"
         ]
     },
    
  2. Edit the bundle configuration file config/packages/experteam_api_base.yaml:

experteam_api_base:
    params:
        remote_url: [Remote URL]
        defaults:
            [PARAM NAME]: [Value]
            [PARAM NAME]: [Value]

Update

Run de following composer command:

composer update experteam/api-base-bundle

License

MIT license.