feat: add JSON Schema validation for API requests
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start by reading the CLI entry point and how API requests are persisted, then check the existing tests and README. The issue suggests adding schema.json, using the jsonschema library, adding a validate command and test_validation.py, and documenting the schema; done means requests are validated before persistence and invalid saved requests are rejected by the command.
Written by the indexing model from the issue text.
Description
Context
git-api persists API requests as JSON in a git repository, but it does not support request validation. Users can create requests with invalid JSON, missing required fields, or incorrect content types, which are only discovered when the request is replayed.
Motivation
Early validation would catch errors before they are committed to the repository. A JSON Schema-based validation would ensure that all requests have the required fields (method, url, headers, body) and that the values are of the correct type.
Acceptance Criteria
- Define a JSON Schema for API requests
- Validate requests before persisting them
- Add a
validateCLI command to check existing requests - Add a test that verifies invalid requests are rejected
- Document the schema in
README.md
Suggested Implementation
- Define a JSON Schema in
schema.json - Use
jsonschemalibrary to validate requests - Add a
validateCLI command - Add a
test_validation.pywith valid and invalid requests
Related
- No existing issue covers request validation
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 37m
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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.
More from yunaremaia/git-api
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yunaremaia/git-api#60 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
yunaremaia/git-api#59 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
yunaremaia/git-api#58 ·
Maintainers usually reply within 1 day
-
bug: a request name containing `-f` silently arms `--force` and overwrites an existing saved requestOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
yunaremaia/git-api#52 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yunaremaia/git-api#49 ·
Maintainers usually reply within 1 day
All issues in yunaremaia/git-api
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
sergey-miryanov/gcmon#230 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Azure-Samples/azure-search-openai-demo#3249 ·
Maintainers usually reply within 1 day
-
[BUG] Failed archive extraction deletes the dataset cachePossibly taken @dajiaohuang claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
alibaba/GraphScope#4674 ·