-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Not Needed
Summary
When using the nodejs EJSON implementation in a browser we want to confirm that canonical EJSON can be used for data transfer to (at least) a Java backend.
AC
- Set up Java & Java bson library in nodejs BSON CI
- Jar files can be found here: https://repo1.maven.org/maven2/org/mongodb/bson/3.0.4/
- Generate EJSON output containing all possible values in canonical format
- Enumerate edge cases like numeric maximums and minimums
- Reuse example inputs from BSON corpus tests
- Assertions should follow these steps:
- Take EJSON strings created by Node.js's EJSON library
- parse those strings with Java's EJSON parser Document.parse(string)
- Output BSON bytes (hex or other non lossy format) from Java
- Check Java's BSON output against node's BSON output from the JS object that originated the EJSON string
- Note: perfect equality is not achievable for every case, canonical EJSON has limitations for data transfer, but we should encode those exceptions in testing. (Ex. NaN with payload, objects that have the same shape as a canonical EJSON value)
- Note: perfect BSON type information is always expected
- related to
-
NODE-4932 Large integer-like doubles generate an incorrect string
- Closed