PolicyEngine / PolicyEngine/policyengine-api

API allows submission of garbage data to /{country_id}/household POST endpoint

Open
#415 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
18
Forks
33
Avg merge
23h 40m
Merged PRs (30d)
22

Description

While doing some manual testing in order to build out the OpenAPI specs, I emitted the following to the /uk/household POST endpoint via Postman:

{ "label": "testValue", "data": { "dataPoint1": "testValue" } }

This data was successfully added to the database as household_id 30573. I'm not sure if this is even really an issue, but it may be beneficial to add data field requirements to the data object and validate on the server before emitting to the database.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the request against the /{country_id}/household POST endpoint using the payload shown in Postman, then inspect the endpoint's OpenAPI definition and server-side validation. Done means malformed data is rejected before it reaches the database, with the required data fields reflected in the API specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python
Domain
api, backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.