docler-labs / api-client-base
SDK Generator - API Client Base
Installs: 28 055
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 17
Forks: 1
Open Issues: 0
Requires
- php: ^7.0
- ext-json: *
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-12-14 20:15:26 UTC
README
This library provides the base classes and interfaces for the generated clients made by api-client-generator.
Description
Base classes of the generated client are:
- ClientFactory - responsible for creating the client object with all of the necessary dependencies.
- Client - main class containing all of the methods needed to send API requests according to specification.
- Request - encapsulates incoming request parameters.
- RequestMapper - translates the request parameters suitable for the base Guzzle client.
- ResponseHandler - decides the appropriate response based on the returned response status code (specific exception on the error status code).
- ResponseMapperRegistry - simple container for the response mappers.
- ResponseMapper - maps raw response into the easy-to-use schema objects.
- Schema - entity objects within the scope of the client (e.g. Post).
This base client repository provides the static, reusable parts of this client structure: RequestMapper, ResponseHandler, Exceptions, etc.
Development
Setup
composer install
Testing
vendor/bin/phpunit
See test reports in test-reports
directory.
Contributing
Create a branch and open PR.
All notable changes to this project are documented in the CHANGELOG.md file, it must be maintained.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.