openverse-api icon indicating copy to clipboard operation
openverse-api copied to clipboard

Remove `required` attribute from unidirectional serializers

Open dhruvkb opened this issue 3 years ago • 8 comments

Problem

Most serializers in the API are unidirectional, in that they serialize instances to JSON but not vice versa. These serializers have no use for the required attribute.

Solution

The required argument should be removed from all output serializers.

Additional context

To be fair, the required prop has a notable effect during serialization. If set to False fields with the value null are omitted entirely, which is counterintuitive and may be surprising, so we better leave it to the default value of True.

Implementation

  • [ ] 🙋 I would be interested in implementing this feature.

dhruvkb avatar May 03 '22 04:05 dhruvkb

Hi @dhruvkb, This issue seems to be a good initiation of my journey toward contribution to FOSS projects. Can you please assign this to me?

sahil-R avatar Sep 08 '22 18:09 sahil-R

Welcome, @sahil-R! I assigned the issue to you. Thank you for your interest in improving Openverse.

krysal avatar Sep 08 '22 19:09 krysal

@krysal @dhruvkb hey, I have cloned the repo and trying to build the server but pipenv isn't working and for some reason the curl as well for registration, I have edited the code but want to test it, the slack channel is also not working can I please get some heads help

sahil-R avatar Oct 17 '22 18:10 sahil-R

@krysal @dhruvkb i managed to run the django server anyways,Thank you.

sahil-R avatar Oct 17 '22 20:10 sahil-R

Hi @sahil-R, to build the server you do not need Pipenv. You can use the Docker-based development setup. Follow the steps in our Quickstart guide and comment here if you face any issues.

the slack channel is also not working

Can you elaborate on this? To the best of my knowledge the Slack channel is very active. If you post there, you will definitely receive a response.

dhruvkb avatar Oct 17 '22 20:10 dhruvkb

Hey Dhruv, I tried to get the verification code for the slack account but the email is not reaching my inbox, I have checked my spam emails as well but without confirmation, i cannot get into the slack account,can you please send me the invitation,i have a few more things to talk as well like the pipenv is not installing the pipfile,and other stuff regarding the installation for general API and stuff.

Regards, Sahil Rasaikar

On Tue, Oct 18, 2022 at 1:53 AM Dhruv Bhanushali @.***> wrote:

Hi @sahil-R https://github.com/sahil-R, to build the server you do not need Pipenv. You can use the Docker-based development setup. Follow the steps in our Quickstart guide https://wordpress.github.io/openverse-api/guides/quickstart.html and comment here if you face any issues.

the slack channel is also not working

Can you elaborate on this? To the best of my knowledge the Slack channel is very active. If you post there, you will definitely receive a response.

— Reply to this email directly, view it on GitHub https://github.com/WordPress/openverse-api/issues/674#issuecomment-1281446864, or unsubscribe https://github.com/notifications/unsubscribe-auth/APGJ2CKGZ7FD4CJAPQELEATWDWYSZANCNFSM5U5ZF5TQ . You are receiving this because you were mentioned.Message ID: @.***>

sahil-R avatar Oct 18 '22 05:10 sahil-R

@sahil-R it's not possible to invite you to the Making WordPress Slack workspace. You'll have to sign up for it by creating a WordPress.org account first and then following the instructions to join Slack on this page.

dhruvkb avatar Oct 18 '22 06:10 dhruvkb

Thank you very much,i'll get in touch.

sahil-R avatar Oct 18 '22 11:10 sahil-R

Dhruv, I have updated the tests, and all tests are working fine as messaged you on slack as well, ill be waiting for the next steps,Thankyou.

sahil-R avatar Nov 16 '22 10:11 sahil-R

Now that you've set up the local stack @sahil-R, the next step would be to remove the required prop from the serializers as mentioned in the original issue and open a PR with your changes.

dhruvkb avatar Nov 17 '22 07:11 dhruvkb