As automation is becoming more common in the insurance industry, many systems now read documents like PDFs and convert them into structured JSON data. This helps different systems use the data easily without manual effort.

But extracting data is only one part of the process. The bigger responsibility is to make sure that the extracted JSON is correct, properly organized, and matches the original document. This is where testing plays a very important role.

In this blog, I’ll explain in a simple and practical way how to validate JSON output for two common insurance documents: policy documents and loss run reports.

Why Validation of JSON is Important

When a document is processed, it usually goes through multiple steps:
PDF or Image → Data Extraction → JSON Output → Used by System

At any stage, errors can happen. If incorrect data is passed forward:

  • Policy details might be wrong
  • Premium calculations can be affected
  • Claims data may become unreliable

For example, if a coverage limit is extracted incorrectly, it can impact decisions like underwriting or pricing. That is why validation is necessary to ensure the system works correctly and gives reliable results.

Understanding the Types of Documents

Before starting validation, it is important to understand what type of document you are working with.

Policy Documents

A policy document is basically the agreement between the insurance company and the customer. It contains important details, such as:

  • Policy number
  • Name and address of the insured
  • Coverage details
  • Premium and deductibles
  • Policy start and end dates

In simple terms, it answers the question:
What is covered under this policy?

Loss Run Reports

A loss run report shows the claim history of a policy. It includes:

  • Claim numbers
  • Dates of loss
  • Paid amounts
  • Reserve amounts
  • Total incurred
  • Cause of loss

In simple terms, it answers:
What claims have happened in the past?

How to Validate JSON Output

Now, let’s understand how to validate JSON step by step.

1. Check the Document Type First

The first thing to verify is whether the system has correctly identified the document.

For example:

  • A policy document should be labeled as “Policy.”
  • A loss run report should be labeled as “Loss Run.”

If this is incorrect, the rest of the data will also be structured incorrectly. So this is always the first check.

2. Verify the JSON Structure

JSON data is usually divided into sections or groups.
For example, a policy JSON may contain sections like:
Insured Information
Policy Information
Location Details
Coverage Information

Each section has a specific purpose. While validating, you should check:

  • Are all required sections present?
  • Is the data placed in the correct section?

If data is placed in the wrong section, it may still look correct but will create problems when used by other systems.

3. Compare JSON with the Original Document

This is the most important step.
You need to carefully compare the values in the JSON with the values in the document. This includes:

  • Policy number
  • Names and addresses
  • Dates
  • Coverage limits
  • Premium values

Even small differences should not be ignored. For example:

  • A missing digit in a policy number
  • A spelling mistake in a name
  • A wrong date

These small errors can cause major issues later.

4. Validate Coverage Details

For policy documents, coverage validation is very important.
Each coverage has details like:

  • Coverage name
  • Limit
  • Deductible

You need to ensure that all these values match exactly with the document.

There is one important case to remember:
If the document shows “Included”, it should remain “Included” in JSON and should not be converted to 0.

This is because “Included” means the coverage is part of the policy without a separate cost.

5. Validate Loss Run Data (Claims)

For loss run reports, the focus is on claims.
Each claim should be checked for:

  • Correct claim number
  • Correct dates
  • Paid amount
  • Reserve amount

A very important check is:
Total Incurred = Paid + Reserve
If this does not match, it means there is an issue in the data.

6. Check Financial Values Carefully

Any field related to money needs extra attention.
This includes:

  • Premium
  • Deductibles
  • Paid amounts

While validating, make sure:

  • Values are not missing
  • Values are not incorrectly set to zero
  • Format is correct

Incorrect financial data can directly impact business decisions.

7. Handle Edge Cases

In real projects, documents are not always perfect.
You may come across:

  • Missing values
  • Multiple names
  • Repeated sections
  • OCR errors (like confusing 0 and O)

A good tester always checks how the system handles such situations.

8. Validate API Response

If you are using tools like Postman, you should also check:

  • Whether the API is returning the correct status code
  • Whether there are any errors in the response

For example, errors like “Invalid transaction_id” should be properly handled.

Common Issues Found During Testing

While testing, you may find issues such as:

  • Data was placed in the wrong section
  • Missing fields
  • Incorrect values
  • Premium shown as 0 instead of “Included.”
  • Wrong calculations in claims

These are very common and should be reported clearly.

Final Thoughts

Validating JSON output is not just about checking data. It is about making sure that:

  • The data is correct
  • The structure is correct
  • The system logic is correct

Whether you are working on policy documents or loss run reports, your role as a tester is to ensure that the final output is accurate and reliable.

Simple Takeaway

Always compare the JSON output with the original document and make sure everything is correctly mapped and structured.