Skip to content

feat: support tv4 as a inbuilt lib #4589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

poojabela
Copy link
Contributor

@poojabela poojabela commented Apr 30, 2025

Description

Added tv4 as a built-in library in Bruno to support JSON Schema validation in scripts.

Example usage in Bruno scripts:

const tv4 = require("tv4")

const schema = {
  type: 'object',
  properties: {
    name: { type: 'string' },
    age: { type: 'number' }
  }
};

const isValid = tv4.validate(res.getBody(), schema);
console.log('Validation result:', isValid);
if (!isValid) {
  console.log('Validation errors:', tv4.error);
}

JIRA Ref

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Apr 30, 2025
@helloanoop helloanoop merged commit 2852c07 into usebruno:main May 7, 2025
2 checks passed
pooja-bruno pushed a commit to pooja-bruno/bruno that referenced this pull request May 12, 2025
pooja-bruno pushed a commit to pooja-bruno/bruno that referenced this pull request May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants