xvilo / track-api-server
Requires
- php: >=5.4
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- jms/serializer-bundle: ^2.0
- symfony/framework-bundle: ^3.3|^4.1
- symfony/validator: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- hoa/regex: ~1.0
- phpunit/phpunit: ~4.8
- satooshi/php-coveralls: ~1.0
- squizlabs/php_codesniffer: ~2.6
- symfony/browser-kit: *
This package is auto-updated.
Last update: 2022-05-15 21:33:11 UTC
README
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
This Symfony bundle is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Build package: org.openapitools.codegen.languages.PhpSymfonyServerCodegen
Requirements
PHP 5.4.0 and later
Installation & Usage
To install the dependencies via Composer, add the following repository to composer.json
of your Symfony project:
{ "repositories": [{ "type": "path", "url": "//Path to your generated openapi bundle" }], }
Then run:
composer require xvilo/track-api-server:dev-master
to add the generated openapi bundle as a dependency.
Tests
To run the unit tests for the generated bundle, first navigate to the directory containing the code, then run the following commands:
composer install
./vendor/bin/phpunit
Getting Started
Step 1: Please follow the installation procedure first.
Step 2: Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Xvilo\Track\ApiServer\OpenAPIServerBundle(), // ... ); }
Step 3: Register the routes:
# app/config/routing.yml open_api_server: resource: "@OpenAPIServerBundle/Resources/config/routing.yml"
Step 4: Implement the API calls:
<?php // src/Acme/MyBundle/Api/AdministrationApiInterface.php namespace Acme\MyBundle\Api; use Xvilo\Track\ApiServer\Api\AdministrationApiInterface; class AdministrationApi implements AdministrationApiInterface // An interface is autogenerated { // Other operation methods ... }
Step 5: Tag your API implementation:
# src/Acme/MyBundle/Resources/services.yml services: # ... acme.my_bundle.api.administration: class: Acme\MyBundle\Api\AdministrationApi tags: - { name: "open_api_server.api", api: "administration" } # ...
Now you can start using the bundle!
Documentation for API Endpoints
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
AdministrationApiInterface | listTotalsForYearAndWeek | GET /api/v1/totals/{year}/{week} | List all timers |
TimersApiInterface | listTimers | GET /api/v1/timers | List all timers |
Documentation For Models
Documentation For Authorization
All endpoints do not require authorization.