Package: aiohttp-json-api
JSON APIimplementation foraiohttpIntroductionThis project heavily inspired bypy-jsonapi(author isBenedikt Schmitt).
Some parts of this project is improved and refactoreddev-schemabranch
ofpy-jsonapi. At beginning ofaiohttp-json-apithis branch
was a great, but not finished implementation of JSON API withschema controllers. Also,py-jsonapiis not asynchronous and use inside
self-implemented Request/Response classes.Some of base entities ofpy-jsonapiwas replaced withaiohttpserver’s objects, some of it was divided into new separate entities
(e.g.JSONAPIContextorRegistry).Free software: MIT licenseDocumentation:https://aiohttp-json-api.readthedocs.ioRequirementsPython 3.6or neweraiohttpinflectionmultidictjsonpointerdateutiltrafaretpython-mimeparseTodoTutorialsImprove documentationTestsFeatures descriptionCustomizable payload keys inflection (default isdasherize<->underscore)Support for JSON API extensions (bulk creation etc.)Polymorphic relationshipsCreditsThis package was created withCookiecutterand thecookiecutter-pypackageproject template.History0.37.0 (2018-03-03)Drop Python 3.5 supportUpdate documentation0.36.1 (2018-03-03)Fix bug with content negotiationAdd cherry-picked and improved helpers frompython-mimeparse0.36.0 (2018-03-02)Improve content negotiation (fix #185) with python-mimeparseUpdate requirements0.35.2 (2017-12-13)Fix bug with wrong query parameters of links in compound documents0.35.1 (2017-12-12)Fixtrafaretrequirement to 1.0.2 (includedrfc3339.Date)0.35.0 (2017-12-11)BREAKING CHANGES!Schema is separated into Schema (marshaller) and ControllerRequest context instantiated in handlers and was renamed toJSONAPIContextChange signature of setup JSON API method in application (now we should pass a mapping between schemas and controllers)New abstract base class for ControllerSchema and Controller must be initialized with only one parameter —JSONAPIContextPassing a context to almost each method of Schema no more required (context is accessible from Schema or Controller instance directly)Remove decorator for JSON API handlers (content negotiation moved to middleware)Refactored fields and schema modulesImproved fetching of compound documentsExamples are updated to conform with all changes in this release0.33.1 (2017-12-06)Fix bug with no Accept header in request0.33.0 (2017-12-06)Improve content type negotiationImprove documentationAdd field for DateAdd example based onfantasy databaseIntroduce JSON API integration test suite (not done yet!)Improve collections helpersNo more links normalization by defaultMove meta object at top level of result document0.32.0 (2017-11-21)Constants, enums and structs refactoring(backward incompatible)Add useful typingsDocumentation fixesExtend development requirements0.31.0 (2017-11-14)Improve performance of URL resolving again. At this time with usage of standard Python urllibUpgrade requirements0.30.0 (2017-11-13)Improve performance of URL resolving in Link field (withcachetools)Upgrade requirements0.29.2 (2017-11-02)Documentation improvements0.29.1 (2017-11-02)Update READMEUpgrade requirements0.29.0 (2017-11-02)Simple example of usage is addedFix bug in handler of relationship query0.28.3 (2017-11-02)Fix bug with wrong read-only field errorDon’t require setup ID field in Schema to update a resource0.28.2 (2017-11-01)Addmultidictto requirements and to README0.28.1 (2017-10-31)Fix small bug with wrong empty sorting in RequestContext0.28.0 (2017-10-31)Add support for customizable inflection of fields from query string.Convert static methods of RequestContext to class methodsUpdate docs of RequestContext methods0.27.1 (2017-10-31)Fix packaging of ABCs and compats0.27.0 (2017-10-31)Abstract base classes refactoring (separate Field and Schema ABCs)Fix bug with compound documents in case models has no property “resource_id”Remove buggy helper to check subclass of any instanceDecompose setup application method to increase readabilityProperly error raised in jsonapi_handler decoratorUse one field instead of two to check what type of relation have the field0.26.0 (2017-10-30)Properly use abstract base classes. Inherit SchemaABC from ABC.Rename resource validation methods(backward incompatible)0.25.0 (2017-10-18)Add Tuple fieldFix bug with List field items enumerationFix wrong conversion of Decimal field to string on deserializationAddyarl(>=0.13) to requirements0.24.1 (2017-10-12)Add support for length range specifying for List field0.24.0 (2017-10-04)Convert document render utility to async coroutine(backward incompatible)Rename Error class property “json” to “as_dict” to clarify0.23.0 (2017-10-03)Use MultiDict for request context filters and FilterRule tuple(backward incompatible)Debug info on request context creation0.22.2 (2017-09-27)Add support for nullable List field0.22.1 (2017-09-25)Fix bug with wrong exit from compound documents fetch utility (“return” instead of “break”)0.22.0 (2017-09-22)Remove recursive fetching of compound documents. Replace it with simple loop.0.21.2 (2017-09-22)Fix bug with fetching compound documents when query parameter “include” contains the same relation twice and more.0.21.1 (2017-09-19)Fix bug with non-underscored relation name in relationship handlers0.21.0 (2017-09-19)Add support for field names conversion passed to “include” request contextUpdate development requirements0.20.2 (2017-08-30)Avoid assertion in Registry ensure identifier methodMake Schema getter of object id staticAvoid to filter out empty fields of rendered documents (less memory and faster)Get id field of schema more safely in URI resource ID validator0.20.1 (2017-08-15)Add support for load only fields (like a Marshmallow)0.20.0 (2017-08-14)Asynchronous validators supportRoutes namespace can be customizedRelative links support0.19.1 (2017-08-10)Improve serialization result default keys creation0.19.0 (2017-08-10)Refactor schema serializer to fix bug with no resource link in resultClean-up validation of expected ID in pre-validaiton of resourceUse status property of ErrorList in error middleware to return HTTP statusRemove default getter from Link field, because it doesn’t used anymore0.18.1 (2017-08-09)Migrate to trafaret >= 0.11.0Fix requirement of trafaret to version greater than 0.11.00.18.0 (2017-08-09)Properly handle missing values in deserialization and validation0.17.1 (2017-07-31)Add support for validation of Relationships ID field0.17.0 (2017-07-28)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 field0.16.2 (2017-07-24)Fix arguments passed to validators0.16.1 (2017-07-24)Pass context to value setter in update methods0.16.0 (2017-07-22)Strict member names and type checking to conform JSON API requirements (routes and schema level). See also:http://jsonapi.org/format/#document-member-namesStrict check for overrides of handlersImprove debug logging0.15.2 (2017-07-21)Initialize default relationships links in meta-class, to avoid bug with empty names of relationships fields0.15.1 (2017-07-19)Rename resource ID parameter of query_resource schema’ method.0.15.0 (2017-07-18)Pagination is initialized from request by default. Remove separate class method of BasePagination to initialize pagination instanceImprove value validation error for absent fieldsImprove validation error of string field with choices0.14.0 (2017-07-13)Customisable JSON API handlers supportDRY in handlersMove context builder from middleware to jsonapi_handler decoratorRequest context receive optional resource_type now0.13.0 (2017-07-12)Revert back to asynchronous setters, because it’s used in update relationships and it might want to query DB, for example0.12.0 (2017-07-12)Base Registry class from UserDict, so Registry is a dict with ensure_identifier method.More strict typing checks on setup.0.11.1 (2017-07-11)Fix bug with mutation not cloned resource in method for delete relationshipRequire JSON API content type on delete relationships0.11.0 (2017-07-11)Method for update return original and updated resource as result. Updated resource is created via deepcopy. It will be useful to determine returned HTTP statusFix bug with enumeration (choices) in String fieldFix bug with context event setup for OPTIONS, HEAD and another request methods not used in JSON API0.10.0 (2017-07-10)Mass refactoring of schema, fields, validation and decoratorsGeneric 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 levelCustom JSON encoder with support JSONPointer serializationRemove boltons from requirementsNo 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 field0.9.3 (2017-07-06)Setup content-type validation on mutation API methods (application/vnd.api+json is required)Properly get and encode relationships fieldsUpdate docs and typing for ensure_identifier Registry’s method0.9.2 (2017-07-06)Fix bugs related to Python 3.5Generation of documentation on RTD is fixed0.9.1 (2017-07-06)Python 3.5 compatibility changes0.9.0 (2017-07-06)Handle aiohttp-json-api exceptions and errors in middleware. If exceptions is not related to JSON API errors, then exception is reraisedHuge refactoring of RequestContextNo more use of boltons cachedproperties, instead use parsing static methods related to each request context’ entityUpdate docs for RequestContext methodsAdd typings to RequestContext0.8.2 (2017-07-05)Properly handle error with wrong relation name (raise HTTP 400)0.8.1 (2017-07-05)Fix bdist_wheel python tag to support Python 3.50.8.0 (2017-07-05)Python 3.5 support (avoid usage of Python 3.6 format strings)Registry is plain object nowCustom Registry support (registry_classparameter inaiohttp_json_api.setup_jsonapimethod)Log debugging information at start about registered resources, methods and routesUse OrderedDict inside SchemaMeta0.7.2 (2017-07-04)Fix bug with JSONPointer when part passed via __truediv__ is integerValidate relationship object before adding relationship in ToMany field0.7.1 (2017-07-04)Fix bugs with validation of resource identifier in relationships fieldsAdd typings for base fields0.7.0 (2017-07-03)Setup of JSON API must be imported from package directlyFix bugs with decode fields and allow None values0.6.2 (2017-06-29)Update HISTORY0.6.1 (2017-06-29)Fix bug with Enum choices of String field0.6.0 (2017-06-29)Return resource in update method of Schema class. This will be helpful in inherit classes of Schemas.0.5.5 (2017-06-15)Setup auto-deploy to PyPI in Travis CI0.5.4 (2017-06-15)Initial release on PyPI0.5.3 (2017-06-14)Improve documentation0.5.0 (2017-06-14)Don’t useattrspackage anymoreRefactor requirements (move it intosetup.py)0.4.0 (2017-06-13)Schema imports refactoring (e.g. don’t useaiohttp_json_api.schema.schema.Schemaanymore)0.3.0 (2017-06-13)Upgrade requirements0.2.0 (2017-05-26)Fix setup.pyAdd test for Decimal trafaret field0.1.1 (2017-05-26)Dirty initial version