inveniosoftware / flask-resources

REST APIs for Flask
https://flask-resources.readthedocs.io
MIT License
3 stars 21 forks source link

Serializer #19

Closed ppanero closed 4 years ago

ppanero commented 4 years ago

Requires #16 Closes #15 - Many record/invenio specific things have been moved to invenio-resources. See more at https://github.com/inveniosoftware/invenio-resources/issues/8. Closes #4 - The resource class does not abort anymore. It returns the error code. How to treat it properlly needs to be addressed in #9 (see more below).

Errors and serialization Note that the default resource returns a 405 code with no content and then the views call make_response by default. The default views are made to work with the resource test case (A.K.A. How would a user create an API with this). However, changes in this area are needed to: 1- Support the behaviour of the default resource, i.e. return a 405 forbidden error. 2- Do the distinction from error and successful response somewhere. Could we benefit from some other abstraction present in Flask/Other library?

This questions will and the whole error serialization will be treated separatelly in #3

Resources file hierarchy

The resource.py currently contains the Resource, the CollectionResource, the SingletonResource and the ResourceConfig classes. Should they be separated into different files? If yes:

The answer will depend from and be treated in https://github.com/inveniosoftware/flask-resources/issues/18

Naming 🎊

The SerializerMixin uses the word object, which is reserved. Any suggestions for a change?

fenekku commented 4 years ago

Rebasing and merging to get everything together. Once we do, it will be easier to know what to change/what is missing.