Schema Validation in Postman for NetSuite Responses

Schema validation ensures that your API response from NetSuite maintains expected structure.

How to implement:

  1. 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);
});
  1. Send the request.
  2. Confirm test passes, indicating the response is structurally valid.

Use case: Helps detect unexpected schema changes in NetSuite SuiteTalk or RESTlet responses.

Leave a comment

Your email address will not be published. Required fields are marked *