shift-org / shift-org/shift-docs
Use JSON Schema to validate request JSON
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 30
- Forks
- 25
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
Use JSON Schema on the backend to validate inbound JSON from client requests. This would provide a relatively easy way to check that request data is in the correct shape and follows basic validation rules (required/optional, data types, max length, etc), without cluttering up the application code with repetitive validations. We will still need to perform some validations of our own, for business logic as well as corners that JSON Schema doesn’t handle, but it gets us a lot in one go.
You can write a schema from scratch without too much trouble, but there are also tools online that can take example JSON output and create a skeleton schema from that. (example generator)
Might also be able to use it to generate per field documentation for each endpoint. (e.g. JSON Schema for Humans)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the backend entry points that receive client request JSON and reviewing how request validation is currently handled. Identify the endpoints and request shapes that need schemas, then confirm that required fields, types, and length rules are covered while business-logic validation remains separate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100