Apitte Core

Core library of Apitte API framework

Build Status Code coverage Licence Downloads this Month Downloads total Latest stable PHPStan

 * @Path("/hello")
final class HelloController implements IController

     * @Path("/world")
     * @Method("GET")
    public function index(ApiRequest $request, ApiResponse $response): ApiResponse
        return $response->writeBody('Hello world!');


Discussion / Help

Join the chat


Need to start with Apitte

This knowledge could make your life easier

Playground with example applications


State Version Branch Nette PHP
dev ^0.7 master 3.0+ ^7.2
stable ^0.6 master 3.0+ ^7.2
stable ^0.5 master 2.4 >=7.1
stable ^0.3 master 2.4 >=5.6


Milan Felix Šulc

Marek Bartoš


The development is sponsored by Tlapnet

  • v0.6.0 v0.6.0

    Diff: v0.5...v0.6.0


    • Requires PHP 7.2
    • Nette 3 9fcff41
    • Plugins internal refactoring
      • uses nette/schema
      • getName() instead of NAME constant, getName() is now statical
      • Plugin is now class instead of interface, all plugins must inherit it ff6ed9f and 560dd94
  • v0.5 v0.5

    Diff: v0.4...v0.5


    • rewrited documentation
    • Apitte is now wrapped into own Application class which must be used for proper functioning (see documentation)
    • error handler
      • transforms all thrown errors into response
        • could be disabled by option catchException: false in debug mode
        • apitte/negotiation is used for error transformation instead, if installed
      • if an PSR-3 compatible logger (like Monolog) is register in DIC then all errors except our special ApiException and it's descendants (ServerErrorException, ClientErrorException, ...) are logged with error severity
        • also previous errors from ApiException ($exception->withPrevious($anotherException)) are logged
    • ClientErrorException and ServerErrorException have default error message 866418d
    • new Request, Response and OpenApi annotations (used by apitte/openapi) 31d7008
    • ApiResponse contain constants with all HTTP response codes 342311b
    • request parameters with type int and float accept numbers prefixed with + 969f9d5
    • apitte/playground merged with planette/playground


    • simplified ServiceHandler, overriding implementations need changes ccafbd4
    • FileResponseDecorator changed to static FileResponseAdjuster 2337b4e
    • IRequestEntity implementation is now optional for request mapper entities 38785e1
    • IDecorator splitted into strictly-typed interfaces 73597e7
    • ApiRequest and ApiResponse are now required by all layers instead of ServerRequestInterface and ResponseInterface d3c4ceb


    • support for alternative, undocumented syntax for most annotations e7fced3
    • Controller annotation, controllers are now required to only implement IController d0e38d9
    • Schema from request attributes, as it could be get from DIC 44c2e28


    • tags without value 028ee61
    • url suffixes used in apitte/negotiation now support urls with variable parameter at the end (like /users/{id}.debug) 5c0ea43
    • MessageException - default error code 1cf0d89
  • v0.4 v0.4

    Bump! 🎉

    Diff: v0.3...v0.4


    • Strict types and native typehints (#18)
    • phpstan 0.10
    • rewrited exceptions - more consistent and meaningful
    • normalized behavior for tags - all tags could have an optional value (#27)
    • router throws 405 instead of 404 for methods which are unsupported by endpoint (#54)
    • removed BadRequestException and RequestException (api should use ClientErrorException and ServerErrorException only) (#60)
    • fully implemented request parameters (#44, #40, #52)
      • check format of variable instead of magical typecasting
      • implemented datetime and boolean
      • removed scalar (use string instead) and object (not implemented)
      • removed support for custom types (in consistence with openapi - only object type may be returned in future)
    • validations
      • each request parameter in path must be defined in mask and each mask parameter must be defined in request parameters
      • check validity of request parameter attributes and validity of combination of these attributes
      • allow only one default suffix for response mappers and require all suffixes to be unique
      • check validity of negotiations (#28)
    • optimizations
      • check renderers, request and response entities validity in compile-time
    • fixes
      • fix case where non-last decorator returned null
      • Method::addArguments - arguments order (affects only very low-level usage)
  • v0.3 v0.3

    Bump! 🎃

    Diff: v0.2...v0.3


    • Mapping: normalize request parameter with respect to parameter IN [#14] (thanks @trejjam)
    • Openapi: extend configuration [#17] (thanks @trejjam)
    • Fix bug with required non-empty parameter [#15] (thanks @trejjam)

    This is last PHP 5.6 release.

  • v0.2 v0.2

    Bump! 🇫🇰

    Diff: v0.1.1...v0.2


    • added RequestMapper/ResponseMapper + validation
    • better ArraySerializator
    • added frequently used method to Endpoint
    • simplify events in Dispatcher
    • pass query parameters into attributes
    • validate only fullpath (GroupPath+ControllerPath+Path)
    • better exception [#13]
  • v0.1.1


    Diff: v0.1...v0.1.1


    • typo [#5]
    • allow prefixed annotations [#6, #7]
    • better RequestParameters [#8]
  • v0.1 v0.1

    First bump! 👊

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette