Schema validation ensures that your API response from NetSuite maintains expected structure.
How to implement:
- In Postman > Tests tab of your request, paste:
javascript
const schema = {
type: "object",
properties: {
id: { type: "number" },
entityid: { type: "string" },
isperson: { type: "boolean" }
},
required: ["id", "entityid"]
};
pm.test("Schema is valid", () => {
pm.response.to.have.jsonSchema(schema);
});
- Send the request.
- Confirm test passes, indicating the response is structurally valid.
Use case: Helps detect unexpected schema changes in NetSuite SuiteTalk or RESTlet responses.