Swagger UI / Open API

As mentioned on the Basic API, Tina uses Swagger & OpenAPI UI. It is highly recommended to annotate your code for flexibility. As an example, if someone else were to look and your code, would they be able to read it and add/make changes?

A simple way to annotate routers:

* @description A description for your end point
* @summary group1,group2
* @tags 

\Tina4\Get::add("/hello/world", function(\Tina4\Response $response, \Tina4\Request $request){  
    return $response("Hello World", HTTP_OK, TEXT_HTML);

//Inline Params
\Tina4\Get::add("/hello/world/{id}", function($id, \Tina4\Response $response, \Tina4\Request $request){
    return $response("Hello World {$id}", HTTP_OK, TEXT_HTML);

//Other methods you can test




//You guessed it - It takes every method - GET, POST, DELETE, PUT, PATCH, OPTIONS

Next spin up a Web-Server and go to this address in your browsers URL bar to bring up the Swagger UI:

Powered by ComboStrap