Skip to content

Commit

Permalink
DRIVERS-2789 Convert Extended JSON spec to markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed May 29, 2024
1 parent fd27420 commit c48b67d
Show file tree
Hide file tree
Showing 6 changed files with 621 additions and 844 deletions.
2 changes: 1 addition & 1 deletion source/bson-corpus/bson-corpus.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pseudo-specification provides such tests.
## Specification

The specification for BSON lives at <http://bsonspec.org>. The `extjson` format specification is
[here](../extended-json.rst).
[here](../extended-json.md).

## Test Plan

Expand Down
1,448 changes: 610 additions & 838 deletions source/extended-json.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions source/extended-json.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

.. note::
This specification has been converted to Markdown and renamed to
`extended-json.md <extended-json.md>`_.
2 changes: 1 addition & 1 deletion source/gridfs/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GridFS. These tests utilize the [Unified Test Format](../../unified-test-format/
The unified test format allows binary stream data to be expressed and matched with `$$hexBytes` (for uploads) and
`$$matchesHexBytes` (for downloads), respectively; however, those operators are not supported in all contexts, such as
`insertData` and `outcome`. When binary data must be expressed as a base64-encoded string
([Extended JSON](../../extended-json.rst) for a BSON binary type), the test SHOULD include a comment noting the
([Extended JSON](../../extended-json.md) for a BSON binary type), the test SHOULD include a comment noting the
equivalent value in hexadecimal for human-readability. For example:

```yaml
Expand Down
1 change: 1 addition & 0 deletions source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [Driver Mantras](./driver-mantras.md)
- [Driver Sessions Specification](sessions/driver-sessions.md)
- [Driver Transactions Specification](transactions/transactions.md)
- [Extended JSON](./extended-json.md)
- [FaaS Automated Testing](faas-automated-testing/faas-automated-testing.md)
- [GridFS Spec](gridfs/gridfs-spec.md)
- [Handling of DBRefs](./dbref.md)
Expand Down
8 changes: 4 additions & 4 deletions source/unified-test-format/unified-test-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -2634,7 +2634,7 @@ Note: the test runner is not required to validate the type or value of a `$$plac
### Evaluating Matches

Expected values in tests (e.g. [operation.expectResult](#operation_expectResult)) are expressed as either relaxed or
canonical [Extended JSON](../extended-json.rst).
canonical [Extended JSON](../extended-json.md).

The algorithm for matching expected and actual values is specified with the following pseudo-code:

Expand Down Expand Up @@ -2680,7 +2680,7 @@ The rules for comparing documents and arrays are discussed in more detail in sub
*other* than documents and arrays, test runners MAY adopt any of the following approaches to compare expected and actual
values, as long as they are consistent:

- Convert both values to relaxed or canonical [Extended JSON](../extended-json.rst) and compare strings
- Convert both values to relaxed or canonical [Extended JSON](../extended-json.md) and compare strings
- Convert both values to BSON, and compare bytes
- Convert both values to native representations, and compare accordingly

Expand Down Expand Up @@ -3015,8 +3015,8 @@ tests.

The instructions in this section apply for each test file loaded by the test runner.

Test files, which may be YAML or JSON files, MUST be interpreted using an [Extended JSON](../extended-json.rst) parser.
The parser MUST accept relaxed and canonical Extended JSON (per [Extended JSON: Parsers](../extended-json.rst#parsers)),
Test files, which may be YAML or JSON files, MUST be interpreted using an [Extended JSON](../extended-json.md) parser.
The parser MUST accept relaxed and canonical Extended JSON (per [Extended JSON: Parsers](../extended-json.md#parsers)),
as test files may use either.

Upon loading a file, the test runner MUST read the [schemaVersion](#schemaVersion) field and determine if the test file
Expand Down

0 comments on commit c48b67d

Please sign in to comment.