Home / Companies / Postman / Blog / Post Details
Content Deep Dive

Create reusable tests and scripts with OpenAPI reusable components

Blog post from Postman

Post Details
Company
Date Published
Author
Joyce
Word Count
1,127
Company Posts That Month
16
Language
English
Hacker News Points
-
Post removed?
No
Summary

Historically, hacking referred to making a system perform unintended functions, but today it can also mean creating inelegant solutions or workarounds to problems. Despite its negative connotations, hacking can be a productive way to utilize public APIs for customizing solutions when standard user interfaces fall short. Developers often seek methods to reuse tests and scripts in Postman, a popular API development tool, even though Postman does not provide a direct feature for storing reusable scripts. This article explores using OpenAPI's reusable components to store and execute scripts within Postman. It involves creating custom components in an OpenAPI definition, storing scripts within these components, and using the Postman API to retrieve and execute them, albeit with security risks associated with using functions like eval(). The strategy allows for organizing script groups and sharing them within a team but lacks syntax highlighting and poses potential security vulnerabilities. Other alternatives for storing and accessing scripts, such as using global variables or accessing local files, are also discussed as potential solutions.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.