This directory contains GABP messages that should fail validation against the schemas. These represent malformed, incorrect, or prohibited messages that implementations must reject.
- Missing required fields - Messages lacking mandatory properties
- Wrong field types - Fields with incorrect data types
- Invalid field values - Values outside allowed ranges or patterns
- Extra fields - Additional properties where not allowed
- Conflicting fields - Messages with mutually exclusive properties
- Invalid combinations - Field combinations that violate protocol rules
- Wrong message structure - Incorrect envelope format
- Missing version - Messages without the required
vfield - Wrong version - Messages with invalid version strings
- Missing ID - Messages without unique identifiers
- Invalid message types - Unknown or incorrect
typevalues - Method formatting - Malformed method names
- Response errors - Responses with both
resultanderrorfields
When implementations encounter these messages they should:
- Reject the message during parsing or validation
- Return an error (if it's a request message)
- Log the issue appropriately
- Not crash or enter an invalid state
Test that these messages fail validation as expected:
# Test invalid messages (should fail with --invalid flag)
ajv -s ../../../SCHEMA/1.0/envelope.schema.json -d '*.json' --invalidThe --invalid flag tells AJV that validation failures are expected and desired.
Invalid test files describe what's wrong:
invalid-missing-version.json- Missing required version fieldinvalid-wrong-type.json- Incorrect message typeinvalid-both-result-error.json- Response with both result and errorinvalid-malformed-method.json- Improperly formatted method name
Each test case should document:
- What makes the message invalid
- What error should be reported
- Which schema rule is being violated
Use these tests to verify your implementation:
- Parsing robustness - Handles malformed JSON gracefully
- Validation accuracy - Catches all schema violations
- Error reporting - Provides clear, actionable error messages
- Security - Doesn't crash or leak information on bad input
These tests help ensure your GABP implementation is robust and secure when handling incorrect or malicious input.