JMAP Test Data Files#
This directory contains comprehensive JSON test files for the JMAP protocol (RFC 8620 Core + RFC 8621 Mail).
Directory Structure#
test/data/
├── core/ # RFC 8620 Core Protocol test files (22 files)
└── mail/ # RFC 8621 Mail Protocol test files (28 files)
Core Protocol Files (22 files)#
Basic Methods#
- request_echo.json - Core/echo request with arbitrary test data
- response_echo.json - Core/echo response echoing the request
Foo/get Method#
- request_get.json - Generic Foo/get request with properties filter
- response_get.json - Foo/get response with objects and notFound
Foo/changes Method#
- request_changes.json - Foo/changes request with sinceState
- response_changes.json - Foo/changes response with created/updated/destroyed
Foo/set Method (Create)#
- request_set_create.json - Foo/set with create operations
- response_set_create.json - Foo/set response with created objects
Foo/set Method (Update)#
- request_set_update.json - Foo/set with update (PatchObject) operations
- response_set_update.json - Foo/set response with updated objects
Foo/set Method (Destroy)#
- request_set_destroy.json - Foo/set with destroy operations
- response_set_destroy.json - Foo/set response with destroyed ids
Foo/copy Method#
- request_copy.json - Foo/copy request between accounts
- response_copy.json - Foo/copy response with created objects
Foo/query Method#
- request_query.json - Foo/query with complex filters and sort
- response_query.json - Foo/query response with ids and total
Foo/queryChanges Method#
- request_query_changes.json - Foo/queryChanges with sinceQueryState
- response_query_changes.json - Foo/queryChanges response with added/removed
Error Handling#
- error_method.json - Method-level error response (unknownMethod)
Session & Push#
- session.json - Complete Session object with capabilities and accounts
- push_state_change.json - StateChange push notification
- push_subscription.json - PushSubscription object
Mail Protocol Files (28 files)#
Mailbox Methods#
- mailbox_get_request.json - Mailbox/get request
- mailbox_get_response.json - Mailbox/get response with mailboxes (INBOX, Sent, Drafts, Trash, custom)
- mailbox_query_request.json - Mailbox/query with filters
- mailbox_query_response.json - Mailbox/query response
- mailbox_set_request.json - Mailbox/set with create/update/destroy
- mailbox_set_response.json - Mailbox/set response
Thread Methods#
- thread_get_request.json - Thread/get request
- thread_get_response.json - Thread/get response with emailIds
Email Methods (Basic)#
- email_get_request.json - Email/get with minimal properties
- email_get_response.json - Email/get response with basic email metadata
Email Methods (Full)#
- email_get_full_request.json - Email/get with all body properties
- email_get_full_response.json - Email/get response with full bodyStructure, attachments, bodyValues
Email Query#
- email_query_request.json - Email/query with complex filters (mailbox, sender, keywords, date)
- email_query_response.json - Email/query response
Email Set#
- email_set_request.json - Email/set creating drafts and updating emails
- email_set_response.json - Email/set response
Email Import#
- email_import_request.json - Email/import request with blobIds
- email_import_response.json - Email/import response
Email Parse#
- email_parse_request.json - Email/parse request for blob parsing
- email_parse_response.json - Email/parse response with parsed email
Search Snippet#
- search_snippet_request.json - SearchSnippet/get request
- search_snippet_response.json - SearchSnippet/get response with highlighted matches
Identity#
- identity_get_request.json - Identity/get request
- identity_get_response.json - Identity/get response with identities and signatures
Email Submission#
- email_submission_get_request.json - EmailSubmission/get request
- email_submission_get_response.json - EmailSubmission/get response with delivery status
Vacation Response#
- vacation_response_get_request.json - VacationResponse/get request
- vacation_response_get_response.json - VacationResponse/get response with out-of-office settings
Features Demonstrated#
Core Protocol Features#
- Invocations: All requests/responses use proper 3-tuple invocation format
- Request/Response Objects: Proper using, methodCalls, sessionState
- Standard Methods: Get, Changes, Set (create/update/destroy), Copy, Query, QueryChanges
- Filters: Complex nested FilterOperator with AND/OR/NOT
- Sorting: Comparator with collation support
- PatchObject: JSON Pointer path updates in Set/update
- Error Handling: Method-level errors with proper error types
- Session Object: Complete capabilities, accounts, primaryAccounts
- Push Notifications: StateChange and PushSubscription
Mail Protocol Features#
- Mailbox: All roles (inbox, sent, drafts, trash), myRights, counters
- Thread: Email grouping with thread IDs
- Email Metadata: All header fields, keywords, mailboxIds
- Email Body: Full bodyStructure with multipart/mixed, multipart/alternative
- Attachments: Proper MIME part representation
- Body Values: Text and HTML body content with encoding flags
- Query Filters: Mail-specific filters (inMailbox, from, subject, keywords, date ranges)
- Import: Importing RFC 5322 messages from blobs
- Parse: Parsing RFC 5322 messages without importing
- Search Snippets: Highlighted search results with tags
- Identity: Sender identities with text/HTML signatures
- Email Submission: SMTP envelope, delivery status, DSN/MDN
- Vacation Response: Out-of-office auto-reply configuration
Data Characteristics#
All JSON files include:
- ✓ Valid, well-formed JSON
- ✓ Proper JMAP data types (UTCDate in RFC 3339 format with Z timezone)
- ✓ Realistic sample data (not just placeholders)
- ✓ All REQUIRED fields per specification
- ✓ Key OPTIONAL fields demonstrated
- ✓ Proper Id format (strings, min 1, max 255 chars)
- ✓ State strings for synchronization
- ✓ Consistent accountId usage across related calls
Usage#
These files can be used for:
- Parser Testing: Validate JMAP parser implementations
- Type Checking: Verify type definitions match spec
- Integration Testing: Test JMAP client/server interactions
- Documentation: Reference examples for JMAP implementation
- Validation: Compare against RFC 8620 and RFC 8621 specifications
Validation#
All JSON files have been validated for:
- JSON syntax correctness
- Well-formed structure
- Proper UTF-8 encoding
To validate:
python3 -m json.tool file.json
References#
- RFC 8620: The JSON Meta Application Protocol (JMAP) Core
- RFC 8621: The JSON Meta Application Protocol (JMAP) for Mail
- /workspace/stack/jmap/JMAP_RFC8620_MESSAGE_TYPES_ANALYSIS.md