PHPackages                             tigron/skeleton-application-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tigron/skeleton-application-api

ActiveLibrary[API Development](/categories/api)

tigron/skeleton-application-api
===============================

Swagger API application for Skeleton

v4.0.5(8mo ago)09.1k↓30%1[1 issues](https://github.com/tigron/skeleton-application-api/issues)MITPHP

Since Jun 2Pushed 4mo ago3 watchersCompare

[ Source](https://github.com/tigron/skeleton-application-api)[ Packagist](https://packagist.org/packages/tigron/skeleton-application-api)[ RSS](/packages/tigron-skeleton-application-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (35)Used By (0)

skeleton-application-api
========================

[](#skeleton-application-api)

This skeleton applications will create an openapi application in your skeleton project. The openapi specification file will automatically created based on the code (using reflection and docblock). A SwaggerUI interface is automatically served so the API can be tested.

Installation
------------

[](#installation)

Installation via composer:

```
composer require tigron/skeleton-application-api

```

Setup the application
---------------------

[](#setup-the-application)

Your Openapi application should follow the following directory structure:

```
- App-directory from skeleton-core
  - Your app name
    - component
    - config
    - endpoint
    - exception (optional)
    - security (optional)

```

It is important to understand that every class that is created should be in their correct namespace. The following namespaces should be used:

```
component: \App\{APP_NAME}\Component
endpoint: \App\{APP_NAME}\Endpoint
exception: \App\{APP_NAME}\Exception
security: \App\{APP_NAME}\Security

```

Configuration
-------------

[](#configuration)

The following configurations can be set:

ConfigurationDescriptionDefault valueExample valuesapplication\_type(required)Sets the application to the required type\\Skeleton\\Application\\WebThis must be set to \\Skeleton\\Application\\Apihostnames(required)an array containing the hostnames to listen for. Wildcards can be used via `*`.\[\]\[ '[www.example.be](http://www.example.be), '\*.example.be' \]title(required)The title of the API'''Sample Pet Store App'descriptionA short description of the API. CommonMark syntax MAY be used for rich text representation'''This is a sample server for a pet store'termsA URL to the Terms of Service for the API. MUST be in the format of a URL.''''versionThe version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version)1.0.0contactArray with contact information. The following keys are supported: 'name', 'url', 'email'\[\]\[ 'name' =&gt; 'My name', 'url' =&gt; '', 'email' =&gt; ''\]Events
------

[](#events)

Events can be created to perform a task at specific key points during the application's execution. This application supports all available events described in [skeleton-core](https://github.com/tigron/skeleton-core). Additionally, the following events are available:

Endpoints
---------

[](#endpoints)

Endpoints will determine the tags and paths that will be created in the openapi application. Every endpoint needs to extend from \\Skeleton\\Application\\Api\\Endpoint Let's look at an example:

```
