Download the PHP package appserver-io/restapi without Composer
On this page you can find all versions of the php package appserver-io/restapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download appserver-io/restapi
More information about appserver-io/restapi
Files in appserver-io/restapi
Package restapi
Short Description Servlet based library that provides basic functionality to implement an API that is compatible with the OpenAPI 2.0 specification.
License OSL-3.0
Homepage https://github.com/appserver-io/restapi
Informations about the package restapi
RESTFul API
Introduction
RESTFul API provides a simple framework that makes the implemention of a OpenApi 2 (verion 3 is still to come) server pretty simple.
Actually the library only supports a subset of the OpenApi 2 functionality, but we'll add additional during the time.
Installation
If you want to write an application that uses RESTFul API, you have to install it using Composer. To do this, simply add it to the dependencies in your composer.json
Configuration
Simply register the two servlets AppserverIo\RestApi\Servlets\SwaggerServlet
and AppserverIo\RestApi\Servlets\ApiServlet
in the WEB-INF/web.xml
file. The main
description of your webservices can be done through the annotations of Rob Allens library zircote/swagger-php.
The Servlet Configuration
The configuration has to be done in the WEB-INF/web.xml
file as shown in this example
Annotate the Beans
After the web application has been configured, simple annotate the classes that you want to expose as webserver with the necessary annotations like
Usage
Open the browser and enter the URL http://127.0.0.1:9080/my-api/swagger.do which should result in rendering the Swagger configuration.
All versions of restapi with dependencies
jms/serializer Version ~1.0
zircote/swagger-php Version 2.0.*
appserver-io-psr/di Version 3.0.*
appserver-io-psr/servlet Version ~4.0
appserver-io/description Version 13.0.*