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

Ensure properly typed json payloads #280

Open
jsamoocha opened this issue Nov 30, 2022 · 3 comments
Open

Ensure properly typed json payloads #280

jsamoocha opened this issue Nov 30, 2022 · 3 comments

Comments

@jsamoocha
Copy link
Collaborator

Some endpoints (e.g., /activities/{id} with PUT method) expect a JSON payload with boolean parameters. These are now "serialized" in the client by converting them to 1/0 integer values. While these are accepted for now by Strava, "1" or "true" are not valid boolean literals in JSON.

The requests library now has a json kwarg that correctly serializes a python dict into JSON. As an alternative, the solution proposed in #248 may also help.

@lwasser
Copy link
Collaborator

lwasser commented Feb 12, 2024

@jsamoocha again i'm just cleaning things up. was this issue addressed with our pydantic migration? or do you want to keep it open? it's from november 2022 so it's been open for some time!

@lwasser lwasser added the pending-response A label to track issues where we are waiting for a user response label Feb 12, 2024
@jsamoocha
Copy link
Collaborator Author

This is not solved yet, as we don't use pydantic for creating requests.

@jsamoocha jsamoocha added bug deprecation risk and removed pending-response A label to track issues where we are waiting for a user response labels Feb 12, 2024
@lwasser
Copy link
Collaborator

lwasser commented Feb 13, 2024

cool thanks. i see that now. i left a message in slack to get more info. what would it look like to convert to pydantic in this case? i'm interested in working on this to better contribute to the API. i've used pydantic but not to generate json / perform API calls. i know i could work on other infrastructure things but i've been looking for a smaller issue where i could actually work on the code a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants