'Unable to parse JSON' error in 'Validate Against OpenAPI Documentation' Assertion
search cancel

'Unable to parse JSON' error in 'Validate Against OpenAPI Documentation' Assertion

book

Article ID: 449839

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

When using the Validate Against OpenAPI Documentation assertion in Broadcom Layer7 API Gateway, requests fail with the following error:

validation.request.parameter.schema.invalidJson
Unable to parse JSON - Unrecognized token 'token_value': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')

This occurs even when the OpenAPI document is correctly defined and the URI being tested (e.g., /v1/key/test) appears valid.

Environment

  • Product: Layer7 API Gateway
  • Versions: 11.1.1, 11.1.3, 11.2.0

Cause

This issue is caused by a defect in the underlying validation library (tracked as DE683418). The assertion incorrectly attempts to parse certain string-based path parameters as JSON tokens. When a path parameter (like "test") is not a valid JSON primitive, the parser fails with an "Unrecognized token" error.

Resolution

This issue is resolved in the following releases:

1. Upgrade to Gateway 11.2.1

The fix is natively included in API Gateway version 11.2.1 and higher. Upgrading to this version provides a permanent resolution.

2. Maintenance Update for 11.1.x

For customers remaining on the 11.1 branch, the fix is included in the Gateway 11.1.4 July MSP (Monthly Support Patch) update. It is also incorporated into Gateway 11.1.5.