API Validation Using JSON Test Scripts
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for validating REST API calls are often obscured by programming language syntax and require cumbersome construction of test data, especially when dealing with JSON, which complicates the intent and behavior of tests.
Innovation Solution
A system and method for validating REST API calls using a computer-readable medium with instructions that parse and execute test scripts in JSON format, allowing direct expression of API inputs and outputs without cumbersome programming language boilerplate, and supporting prototype inheritance for easier reuse and concise testing.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If traditional programming language syntax is used for validating REST API calls, then the validation can be performed, but the test construction becomes cumbersome and the intent is obscured
Solution Approach 1:
The patent introduces JSON as an intermediary format for expressing API inputs and outputs. Instead of using programming language syntax directly, the test data is constructed in JSON format which naturally mirrors the API data structures, making the tests more readable and easier to construct while maintaining validation capability
Solution Approach 2:
The patent changes the parameter representation from programming language objects to JSON format. This parameter change allows direct expression of API inputs and outputs in a format that matches the actual data being validated, reducing the need for cumbersome construction and improving clarity
2Productivity
If programming language boilerplate is used, then validation logic can be implemented, but the clarity and speed of validation processes are reduced
Solution Approach 1:
The patent extracts the essential validation logic from programming language boilerplate and expresses it directly in JSON format. By taking out the unnecessary syntactic overhead, the validation process becomes faster and clearer while maintaining the core validation functionality
Solution Approach 2:
The patent uses JSON format that copies the structure and semantics of the actual API data being validated. This copying approach eliminates the need for complex mapping and transformation logic, thereby increasing validation speed and reducing complexity
Data Source
AI summary
A system that validates an application programming interface (API) call is provided. A key and a value associated with the key are read from a test script containing a script. The key and the value are separated by a colon. The key is included in first double quotes, and the value is included in second double quotes. Whether the key matches a plurality of keys defined for an API call is determined. Based on the key matching the plurality of keys defined for the API call, the API call is configured using the key and the value without any of the colon, the first double quotes, or the second double quotes. The configured API call is executed.


