experteam/api-base-bundle

Base functionality bundle for APIs

Installs: 9 028

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

3.5.2 2024-11-18 16:04 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:
            enabled: [Enabled]
            url: [URL]
        defaults:
            [PARAM NAME]: [Value]
            [PARAM NAME]: [Value]

Update

Run de following composer command:

composer update experteam/api-base-bundle

License

MIT license.