[Feature]: Response Validation Sampling

Open
#1,142 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
32/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
api, testing

Research direction

The issue names no files, tests, or entry points. Start by locating the response validator and its array-handling tests, then determine how an optional sampling setting should apply to nested arrays. Done means the option limits validation to random array items while preserving existing full-validation behavior when it is not enabled.

Written by the indexing model from the issue text.

Description

kind/enhancement
Suggested Behavior

An option that can be passed which has the validator just take a small sample of random items in arrays

Why is this needed?

When validating responses which contain large arrays the validation process slows by quite a bit. Anecdotally, for responses which contain a nested array which is holding ~8k objects, parsing takes approximately 11 seconds. If there was an option to randomly sample a few entries in arrays that would drastically cut down processing time while still allowing some spot checking of responses

References

No response

Would you like to implement a feature?

None

Dominant language
Python
Stars
368
Forks
140
PR merge metrics
No merged PRs in 30d

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.

More from python-openapi/openapi-core

All issues in python-openapi/openapi-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.