Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializer #19

Merged
merged 22 commits into from
Jun 16, 2020
Merged

Serializer #19

merged 22 commits into from
Jun 16, 2020

Conversation

ppanero
Copy link
Member

@ppanero ppanero commented Jun 12, 2020

Requires #16
Closes #15 - Many record/invenio specific things have been moved to invenio-resources. See more at inveniosoftware/invenio-records-resources#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:

  • In a resources folder?
  • In the corresponding files of the views folder?

The answer will depend from and be treated in #18

Naming 🎊

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

@ppanero ppanero force-pushed the serializer branch 3 times, most recently from ff54e76 to b4dd095 Compare June 12, 2020 15:30
@ppanero ppanero marked this pull request as ready for review June 15, 2020 14:26
@ppanero ppanero mentioned this pull request Jun 15, 2020
Copy link
Contributor

@fenekku fenekku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's talk tomorrow about how we want to procede with these PRs that are incremental/experimental. There are a lot of things that we know we will revisit, so it's hard to tell what we are settling...

It's mergeable if we agree to revisit a lot of aspects... 🤷

run-tests.sh Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@fenekku
Copy link
Contributor

fenekku commented Jun 16, 2020

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

@fenekku fenekku force-pushed the serializer branch 2 times, most recently from 2520d40 to aa2e05b Compare June 16, 2020 20:04
Copy link
Contributor

@fenekku fenekku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving just to get things moving.

@fenekku fenekku merged commit 2e22953 into inveniosoftware:master Jun 16, 2020
@ppanero ppanero deleted the serializer branch June 17, 2020 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants