The format is based on Keep a Changelog
- Update sqlalchemy 1.3.10 -> 1.3.23
- Update marshmallow 3.2.2 -> 3.12.1
- Update apispec 3.1.0 -> 3.3.2
- Fix Pipfile parser in setup.py
- Unused exceptions
ApiViewer
resource (swagger ui)
- Fixed many typing issues, code simplified
- Function
generate_documentation
replaced withApiResource
class - Updated
marshmallow
andapispec
dependencies to latest versions Resource.Meta
now object of classResourceMeta
- Documentation now don't create
swagger.yaml
file. Now it stored in memory
get_readme
,empty_response
functions
- Move args parsing to FilterItem dataclass
- Fix typing issues
- Fix code duplication in validate_create_request
- Fix bug in ReadContext imports
- Argument
resp: falcon.Response
removed from functionsvalidate_create_request
andvalidate_update_request
- Read logic moved to
ReadContext
class
- Class for database config
- Move cached_property to deps
- Now we use Python 3.7
- Fix receiving field from relative model
Resource.Meta.skip_doc = True
was generating broken swagger.yml
- Added lt and gt operators in filtering.
- pipenv implemented.
- mypy implemented.
awokado.response.Response
class added. Read more- method
awokado.resource.BaseResource.read__serializing
now usesawokado.response.Response
class to serialize data. Take a look at the code if you already override this method
awokado.utils.ReadContext
moved toawokado.request.ReadContext
awokado.utils.empty_response
function removed (useawokado.response.Response
instead)
- Added documentation.
- Added ability to use any resource field as "id" field. Currently only for read logic. This field can be specified as
id_field
attribute of resource'sMeta
class - Added schema validation for POST requests with a friendly message about the exception
Updated falcon from 1.4.1 to 2.0.0 (Falcon 2 Changelog), which led to following changes:
application.req_options.auto_parse_qs_csv
param is nowFalse
by default, so you'll need to manually set it toTrue
application.req_options.strip_url_path_trailing_slash
param is nowFalse
by default, so you'll need to manually set it toTrue
- For direct data read from request
req.bounded_stream
is now used instread ofreq.stream
.
- Added pre-commit hook to run black formatting checks
- Added ability to specify full database url in settings
- Fixed "load_only" fields appearing in read request results
- Fixed “awokado_debug” setting being always required in settings
- Fixed attribute “auth” being mandatory in resource.Meta
- Fixed method “auth” being mandatory to overwrite in resource
- Fixed method “audit_log” being mandatory to overwrite in resource
- Functions
set_bearer_header
,get_bearer_payload
andAWOKADO_AUTH_BEARER_SECRET
var are removed
- Fixed documentation generation for bulk operations
No backward compatibility. Need to change custom delete() and can_create() methods.
delete
method supports bulk delete.- add
payload
attribute tocan_create
method.
select_from
attribute in class Meta, allows you to specifysqlalchemy.select_from()
arguments. Example:
class AuthorResource(Resource):
class Meta:
model = m.Author
name = "author"
methods = (CREATE, READ, UPDATE, BULK_UPDATE, DELETE)
auth = None
select_from = sa.outerjoin(
m.Author, m.Book, m.Author.id == m.Book.author_id
)
join
argument in the resource field
-
ability to make list of joins in resource field
book_titles = fields.List( fields.Str(), resource="author", model_field=sa.func.array_remove(sa.func.array_agg(m.Book.title), None), join=[ OuterJoin( m.Tag, m.M2M_Book_Tag, m.Tag.id == m.M2M_Book_Tag.c.tag_id ), OuterJoin( m.M2M_Book_Tag, m.Book, m.M2M_Book_Tag.c.book_id == m.Book.id ), ], )
- Automated SQL generation for
POST/PATCH
requests
bulk_create
method in base resource
create
method (is going to be replaced with bulk_create)
- API simple workflow diagram
disable_total
attr for Resource.Meta. Set it toTrue
to avoid adding total column:sa.func.count().over()
. Useful forhistorical
tables, where pagination based on date instead of limit / offset to not overload SQL database
- Fixed
description
arg forToMany
andToOne
fields (was broken)
- Documentation generation for API resources
- Automated SQL generation for
GET
requests (including ToOne and ToMany relation fields) - AWOKADO_DEBUG handle traceback exception in API response
- all
Forbidden
exceptions now raise HTTP_403 instead of HTTP_401