xvilo/track-api-server

v1.0 2020-08-15 11:34 UTC

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.

Author