You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] API Response body & schema validations #21561
Let us know what functionality you'd like to see in Playwright and what your use case is.
I want to be able to validate an api response body matches a provided schema.json file. I know that it can be done using external libraries in TypeScript (or any other language binding) but it makes sense for playwright to have this as a built-in feature (as well as validating the entire body content not just extracting values from it).
Do you think others might benefit from this as well?
YES! Anyone who does API Test Automation will definitely need to validate the response body content against a file, and the response schema as well.
Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.
If you have additional information not present in this issue that you think will help prioritizing it, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.
Hi Playwright team,
I would like to contribute built-in schema validation support for API testing.
My Proposal
Use AJV as the validation engine (industry standard, well-maintained)
Implement as a built-in fixture similar to request
Support JSON Schema, Open API 3 and Swagger 2 formats.
Provide clear error messages in the test reports.
I have already did a similar kind of implementation in cypress in one of my project and I am happy to submit a PR if this aligns with Playwright's direction. Would love to hear your thoughts!
Activity
pavelfeldman commentedon Sep 8, 2025
Why was this issue closed?
Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.
If you have additional information not present in this issue that you think will help prioritizing it, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.
hariprasathvs commentedon Nov 21, 2025
Hi Playwright team,
I would like to contribute built-in schema validation support for API testing.
My Proposal
Use AJV as the validation engine (industry standard, well-maintained)
Implement as a built-in fixture similar to
requestSupport JSON Schema, Open API 3 and Swagger 2 formats.
Provide clear error messages in the test reports.
I have already did a similar kind of implementation in cypress in one of my project and I am happy to submit a PR if this aligns with Playwright's direction. Would love to hear your thoughts!