All notable changes to this project will be documented in this file. Updates should follow the Keep a CHANGELOG principles.
- Button to copy
Body
content in api console
- Handler tag wrapper has changed class from
btn
tolabel
- Allowed equal definitions in different handlers in OpenAPIHandler
- Support for symfony/yaml ^5.0 and ^6.0
- Support for JsonSerializable payload in JsonApiResponse
- Support for latte/latte ^3.0 (Added Latte extension for ApiLink)
- Fix null
$body
for php 8.0
- Allow to set expiration to false in JsonApiResponse and XmlApiResponse
- Render body of response if there is a debug message: Tracy Debug Bar
- Fixed request url separator if url already contain some param
- Support for generating examples for RawInputParam by OpenApiHandler
- PHP 8.1 support (
league/fractal
0.20.1) - PHP 8.2 support
- Support for
league/fractal
~0.17 (Possible BC if you use Fractal classes, you have to update typehints)
- If output doesn't match any output schema, error is just logged and output is returned in production mode
- Missing expiration params in XmlApiResponse
- Missing body request for PUT methost
- ApiLinkMacro now uses latte filter to avoid use presenter context (BC break in nette/application 3.1)
- BaseUrl in OpenApiHandler
- RedirectResponse which implements ResponseInterface
- Available values now can have description in Console and OpenApiHandler. Just use associative array - keys are available values, values are their description
- Yaml format for OpenApiHandler is available only if symfony/yaml is installed
- RedirectOutput use new RedirectResponse
- Property with name
type
is now available in json schema
- Use relaxed TokenRepositoryInterface in BearerTokenAuthorization (more info here)
- Empty console input fixed by adding checkbox for each parameter
- Handling wrong input for Get and Post InputParam
- File and cookie parameters in Open API handler
- Correct error shown when putting non-OutputInterface into ApiHandlerInterface::outputs()
- User can set own form renderer for API console and own template file(s) for API console and for API listing
- Added RateLimit to ApiDecider::addApi
- Form in API console is rendered with BootstrapVerticalRenderer instead of BootstrapRenderer (labels are over fields instead of left side)
-
Added API key authentication (query, header, cookie) - see https://swagger.io/docs/specification/authentication/api-keys/
-
Added missing strict_types declarations
-
Open API handler warnings about unused security schemes
-
ApiPresenter detailed error unit test
-
Compatibility with latte 2.9.0
- Added Basic authentication
- Rewritten ApiPresenter
- Added API rate limit
- Added custom headers to API console
- Added field for timeout to API console
- OpenAPI handler
- Information about RESTful urls
- Fixed sending empty string in multi params
- UrlEncoding values sending through get param inputs
- Fixed static url part
/api/
in console - Fixed generating urls in console for RESTful urls using ApiLink and EndpointInterface
- Fixed return types for ConsoleRequest::processParam() and ConsoleResponse::getResponseHeaders()
- Updated nette libs to version 3.0.0 (BC break)
- Added typehints (BC break)
- Splitted InputParam to multiple subclasses (BC break)
- Removed type TYPE_POST_JSON_KEY (BC break)
- Wrong input now returns code 400 instead of 500 (BC break if somebody checks return code)
- Replaced handler information array triplet (endpoint, handler, authorization) with class Api (BC break for API console usage)
- Renamed some methods from ApiDecider (BC break)
- Pretty JSON output in API console - without escaping unicode and slashes
- Added type JsonInputParam with scheme as replacement for type TYPE_POST_JSON_KEY
- Detailed error for wrong input if debugger is enabled
- Added summary (short description), description, tags and deprecated flag for API handlers
- Added description, default value and example for input params
- Added output validator
- Removed support for PHP 5.6, 7.0 and hhvm (BC Break)
- Removed deprecated class ApiResponse (BC Break)
- Detailed error message enabled only for non production mode
- Added ApiLink Macro
- Added possibility to set own scope to Manager
- Added JSON validation - if JSON is invalid, throw "wrong input" error instead of setting params to null
- Added possibility to set own headers for CorsPreflightHandler
- Added expiration to JsonApiResponse
- Removed names of components because of commit in nette/component-model (https://github.com/nette/component-model/commit/1fb769f4602cf82694941530bac1111b3c5cd11b)
- Fixed console for POST_JSON_KEY(s)
- New InputParam type - POST_JSON_KEY for parsing key from json data in post body
- Updated leaguge/fractal and other packages minor upgrade
- Fixed console POST FIELDS output for integer values
- Fixed parsing headers on nginx - missing method
getallheaders
- Added possibility to send current PHPSESSID via API Web Console
- Removed Content-Type from CORS headers
- Added X-Requested-With header to Cors handler
- Added possibility to send empty fields via console request
- Added support for PUT fields
- Updated league/fractal library to 0.14.0
- Added cors headers - Access-Control-Allow-Headers and Access-Control-Allow-Methods
- Added default CORS preflight handler
- Added possibility to enable global preflight handler for all handlers with
enableGlobalPreflight()
onApiDecider
- InputParam validation of multi params, if available values are defined
- End of support for php < 5.6
- Service of type Tomaj\NetteApi\Misc\IpDetectorInterface is no more required if service of type Tomaj\NetteApi\Logger\ApiLoggerInterface is not configured and used
- Service of type Tomaj\NetteApi\Logger\ApiLoggerInterface need not be named "apiLogger"
- Added Content-Length header to Json and Xml responses
- ApiPresenter: getRequestDomain() returns port as well
- Updated JsonApiResponse - separate charset from content type as changed in nette/application 2.3.12
- Also change nette/application minimal version to 2.3.12
- changed rendering in API console when available values are set
- fixed negative values for response time in API web console
- added tracy for error logging from ApiPresenter
- added tests for ApiPresenter
- New ability to send new input types:
- send RAW POST data
- send COOKIES
- send FILEs
- (more info in readme section Inputs)
- all new types are available in test console for easy testing api calls
- Added CORS support to ApiPresenter. Available options:
- 'auto' - send back header Access-Control-Allow-Origin with domain that made request
- '' - send header with '' - this will work fine if you dont need to send cookies via ajax calls to api with jquery $.ajax with xhrFields: { withCredentials: true } settings
- 'off' - will not send any CORS header
- other - any other value will be send in Access-Control-Allow-Origin header
- Rewritten few internal functions
- Fixed parsing array variables from GET and POST when using multi InputParam
First version that can be used for api. Contains
- Authorization
- Handling api request
- Logging
- UI Control for api listing
- UI Control for web console to test api endpoints
- Api versioning