codeforboston / codeforboston/police-data-trust

[BUG] API doc incorrect (register new account)

Open
#437 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
64
Forks
102
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
The API doc directs users to include "first_name" and "last_name" in the body, however [the code](https://github.com/codeforboston/police-data-trust/blob/main/backend/routes/auth.py#L86C13-L87C37) consumes "firstname" and "lastname"

**To Reproduce**

> import requests
>
> base_url = "http://127.0.0.1:5001/api/v1/"
>
> headers = {
> "accept": "application/json",
> "content-type": "application/json"
> }
>
> url = base_url + "auth/register"
> payload = {
> "email": "test@gmail.com",
> "password": "password",
> "first_name": "Firsty",
> "last_name": "McLast",
> "phone_number": "800-555-1234"
> }
>
> response = requests.post(url, json=payload, headers=headers)

Returns missing field errors for "firstname" and "lastname"

@DMalone87

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.