Skip to content

Commit

Permalink
DRIVERS-2789 Convert Versioned API Spec to Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Sep 11, 2024
1 parent d6d190d commit 2256fe0
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 264 deletions.
1 change: 1 addition & 0 deletions source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
- [Server Wire version and Feature List](./wireversion-featurelist.md)
- [Sessions Specification](sessions/driver-sessions.md)
- [Snapshot Reads Specification](sessions/snapshot-sessions.md)
- [Stable API For Drivers](versioned-api/versioned-api.md)
- [Transactions Specification](transactions/transactions.md)
- [URI Options Specification](uri-options/uri-options.md)
- [Unified Test Format](unified-test-format/unified-test-format.md)
Expand Down
2 changes: 1 addition & 1 deletion source/mongodb-handshake/handshake.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ MongoDB uses the `hello` or `isMaster` commands for handshakes and topology moni
preferred command. `hello` must always be sent using the `OP_MSG` protocol. `isMaster` is referred to as "legacy hello"
and is maintained for backwards compatibility with servers that do not support the `hello` command.

If a [server API version](../versioned-api/versioned-api.rst) is requested or `loadBalanced: True`, drivers MUST use the
If a [server API version](../versioned-api/versioned-api.md) is requested or `loadBalanced: True`, drivers MUST use the
`hello` command for the initial handshake and use the `OP_MSG` protocol. If server API version is not requested and
`loadBalanced: False`, drivers MUST use legacy hello for the first message of the initial handshake with the `OP_QUERY`
protocol (before switching to `OP_MSG` if the `maxWireVersion` indicates compatibility), and include `helloOk:true` in
Expand Down
2 changes: 1 addition & 1 deletion source/run-command/run-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ it is a write and MUST NOT attach a `txnNumber`.
The command sent MUST attach stable API fields as configured on the MongoClient.

- See Stable API's section on
[Generic Command Helper Behaviour](https://github.com/mongodb/specifications/blob/master/source/versioned-api/versioned-api.rst#generic-command-helper)
[Generic Command Helper Behaviour](../versioned-api/versioned-api.md#generic-command-helper)

##### Client Side Operations Timeout

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The client monitors servers using the hello or legacy hello commands. In MongoDB
MongoDB \<= 4.2, a monitor uses the [Polling Protocol](#polling-protocol) pausing heartbeatFrequencyMS between
[checks](#check). Clients check servers sooner in response to certain events.

If a [server API version](../versioned-api/versioned-api.rst) is requested, then the driver must use hello for
If a [server API version](../versioned-api/versioned-api.md) is requested, then the driver must use hello for
monitoring. If a server API version is not requested, the initial handshake using the legacy hello command must include
`helloOk: true`. If the response contains `helloOk: true`, then the driver must use the `hello` command for monitoring.
If the response does not contain `helloOk: true`, then the driver must use the legacy hello command for monitoring.
Expand Down
2 changes: 1 addition & 1 deletion source/unified-test-format/unified-test-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ The structure of this object is as follows:
- `deprecationErrors`: Optional boolean.
See the [Stable API](../versioned-api/versioned-api.rst) spec for more details on these fields.
See the [Stable API](../versioned-api/versioned-api.md) spec for more details on these fields.
#### collectionData
Expand Down
45 changes: 16 additions & 29 deletions source/versioned-api/tests/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
================
Stable API Tests
================
# Stable API Tests

.. contents::
______________________________________________________________________

----
## Notes

Notes
=====
This directory contains tests for the Stable API specification. They are implemented in the
[Unified Test Format](../../unified-test-format/unified-test-format.md), and require schema version 1.1. Note that to
run these tests, the server must be started with both `enableTestCommands` and `acceptApiVersion2` parameters set to
true.

This directory contains tests for the Stable API specification. They are
implemented in the `Unified Test Format <../../unified-test-format/unified-test-format.md>`__,
and require schema version 1.1. Note that to run these tests, the server must be
started with both ``enableTestCommands`` and ``acceptApiVersion2`` parameters
set to true.
## Testing with required API version

Testing with required API version
=================================
Drivers MUST run their test suite against a cluster with the `requireApiVersion` parameter enabled and also requires
authentication.

Drivers MUST run their test suite against a cluster with the
``requireApiVersion`` parameter enabled and also requires authentication.
To run this test, proceed as follows: - Start a standalone mongod instance

To run this test, proceed as follows:
- Start a standalone mongod instance
- Connect to the standalone instance and run the following command on the `admin` database:
`{ setParameter: 1, requireApiVersion: true }`
- Declare an API version for the test run through the `MONGODB_API_VERSION` environment variable.
- If the environment variable is set, all clients created in tests MUST declare the `ServerApiVersion` specified.

- Connect to the standalone instance and run the following command on the
``admin`` database: ``{ setParameter: 1, requireApiVersion: true }``

- Declare an API version for the test run through the ``MONGODB_API_VERSION``
environment variable.

- If the environment variable is set, all clients created in tests MUST declare
the ``ServerApiVersion`` specified.

Only standalone servers must be tested. The tests should run for each server
version >= 5.0, including ``latest``.
Only standalone servers must be tested. The tests should run for each server version >= 5.0, including `latest`.
Loading

0 comments on commit 2256fe0

Please sign in to comment.