JSON API driven by aiohttp
This project heavily inspired by py-jsonapi (author is Benedikt Schmitt). Some parts of this project is improved and refactored dev-schema branch of py-jsonapi. At beginning of aiohttp-json-api this branch was a great, but not finished implementation of JSON API with schema controllers. Also, py-jsonapi is not asynchronous and use inside self-implemented Request/Response classes.
Some of base entities of py-jsonapi was replaced with aiohttp server’s objects, some of it was divided into new separate entities (e.g. RequestContext or Registry).
- Free software: MIT license
- Documentation: https://aiohttp-json-api.readthedocs.io
- Example application
- Features description
- Customizable payload keys inflection (default is dasherize <-> underscore)
- Support for JSON API extensions (bulk creation etc.)
- Improve serialization result default keys creation
- Refactor schema serializer to fix bug with no resource link in result
- Clean-up validation of expected ID in pre-validaiton of resource
- Use status property of ErrorList in error middleware to return HTTP status
- Remove default getter from Link field, because it doesn’t used anymore
- Migrate to trafaret >= 0.11.0
- Fix requirement of trafaret to version greater than 0.11.0
- Properly handle missing values in deserialization and validation
- Add support for validation of Relationships ID field
- Normalize resource_id parameter usage in all mutation methods.
- Add fetch_resource schema coroutine to receive resource instance by ID.
- Add separate method for mapping deserialized data to schema.
- Context is required parameter for deserialization schema method.
- Move docs to ABC schema.
- Properly handle allow_none parameter for UUID field
- Fix arguments passed to validators
- Pass context to value setter in update methods
- Strict member names and type checking to conform JSON API requirements (routes and schema level). See also: http://jsonapi.org/format/#document-member-names
- Strict check for overrides of handlers
- Improve debug logging
- Initialize default relationships links in meta-class, to avoid bug with empty names of relationships fields
- Rename resource ID parameter of query_resource schema’ method.
- Pagination is initialized from request by default. Remove separate class method of BasePagination to initialize pagination instance
- Improve value validation error for absent fields
- Improve validation error of string field with choices
- Customisable JSON API handlers support
- DRY in handlers
- Move context builder from middleware to jsonapi_handler decorator
- Request context receive optional resource_type now
- Revert back to asynchronous setters, because it’s used in update relationships and it might want to query DB, for example
- Base Registry class from UserDict, so Registry is a dict with ensure_identifier method.
- More strict typing checks on setup.
- Fix bug with mutation not cloned resource in method for delete relationship
- Require JSON API content type on delete relationships
- Method for update return original and updated resource as result. Updated resource is created via deepcopy. It will be useful to determine returned HTTP status
- Fix bug with enumeration (choices) in String field
- Fix bug with context event setup for OPTIONS, HEAD and another request methods not used in JSON API
- Mass refactoring of schema, fields, validation and decorators
- Generic approach to setup Schema decorators is used (inspired by Marshmallow)
- Fields are used only for encode/decode now (with pre/post validation). Additional validators for fields must be created on schema level
- Custom JSON encoder with support JSONPointer serialization
- Remove boltons from requirements
- No more remap input data dictionary with key names to underscores conversion.
- Add helpers “first” and “make_sentinel” (cherry-picked from boltons)
- Fix enumeration (choices) support in String field
- Setup content-type validation on mutation API methods (application/vnd.api+json is required)
- Properly get and encode relationships fields
- Update docs and typing for ensure_identifier Registry’s method
- Fix bugs related to Python 3.5
- Generation of documentation on RTD is fixed
- Python 3.5 compatibility changes
- Handle aiohttp-json-api exceptions and errors in middleware. If exceptions is not related to JSON API errors, then exception is reraised
- Huge refactoring of RequestContext
- No more use of boltons cachedproperties, instead use parsing static methods related to each request context’ entity
- Update docs for RequestContext methods
- Add typings to RequestContext
- Properly handle error with wrong relation name (raise HTTP 400)
- Fix bdist_wheel python tag to support Python 3.5
- Python 3.5 support (avoid usage of Python 3.6 format strings)
- Registry is plain object now
- Custom Registry support (registry_class parameter in aiohttp_json_api.setup_jsonapi method)
- Log debugging information at start about registered resources, methods and routes
- Use OrderedDict inside SchemaMeta
- Fix bug with JSONPointer when part passed via __truediv__ is integer
- Validate relationship object before adding relationship in ToMany field
- Fix bugs with validation of resource identifier in relationships fields
- Add typings for base fields
- Setup of JSON API must be imported from package directly
- Fix bugs with decode fields and allow None values
- Update HISTORY
- Fix bug with Enum choices of String field
- Return resource in update method of Schema class. This will be helpful in inherit classes of Schemas.
- Setup auto-deploy to PyPI in Travis CI
- Initial release on PyPI
- Improve documentation
- Don’t use attrs package anymore
- Refactor requirements (move it into setup.py)
- Schema imports refactoring (e.g. don’t use aiohttp_json_api.schema.schema.Schema anymore)
- Upgrade requirements
- Fix setup.py
- Add test for Decimal trafaret field
- Dirty initial version
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size aiohttp_json_api-0.19.1-py35.py36-none-any.whl (49.7 kB)||File type Wheel||Python version py35.py36||Upload date||Hashes View|
|Filename, size aiohttp_json_api-0.19.1.tar.gz (50.6 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for aiohttp_json_api-0.19.1-py35.py36-none-any.whl