From d962b6c377190404c6b5619f03219b0985ce9cd4 Mon Sep 17 00:00:00 2001 From: Jeremy LaCivita Date: Wed, 13 Dec 2023 08:52:28 -0500 Subject: [PATCH] Latest changes --- requirements/specifications/general/rpc.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/requirements/specifications/general/rpc.md b/requirements/specifications/general/rpc.md index 909afaa58..21bd67602 100644 --- a/requirements/specifications/general/rpc.md +++ b/requirements/specifications/general/rpc.md @@ -48,6 +48,8 @@ Firebolt implementations **MUST** support all aspects of the JSON-RPC specificat Firebolt implementations **MUST** send only one response for each request. +Firebolt implementations **MUST** treat all named OpenRPC fields, i.e. fields with a `"name"` attribute, as case-senstitive values, including, but not limited to methods and params. + **TODO**: Add note about case sensitivity ### 3.1. OpenRPC Documents @@ -119,7 +121,7 @@ For standard JSON-RPC interactions, the module name is simply part of the method Some Firebolt-specific OpenRPC extensions use the module name to refer to an entire group of methods within the module. -Firebolt OpenRPC allows one or zero module names, e.g. `Module.foo` and `foo` are valid method names, but `Module.Submodule.foo` is not. +Firebolt OpenRPC allows zero or more module names, e.g. `foo` and `Module.foo`, and `Module.Submodule.foo` are all valid method names. ### 3.3. Asynchronous Events Asynchronous events, aka "notifications," **MUST** be handled by leveraging the common "duplex" pattern where both the Firebolt App & the Firebolt Implementation act as a JSON-RPC Server *and* a JSON-RPC client. @@ -224,16 +226,13 @@ The Application OpenRPC definition for the notification **MUST** have an `x-even } ], "params": [ - ], - "result": { - "type": "void" - } + ] } ] } ``` -The notifer method **MUST** a result type of `void`, since no response is expected. +The notifer method **MUST** have no `"result"` defined, since no response is expected or allowed. If an OpenRPC method tagged as a "notifier" does not have a `x-event` attribute on the tag, then the value **MUST** be generated by the Firebolt OpenRPC tooling to match the pattern: `.on`, e.g. a method named `Sky.sunrise` would have the `x-event` value set to `Sky.onSunrise`. @@ -342,8 +341,8 @@ class myApp implements Lifecycle.IApplication, Lifecycle.IActivatable { const app = new myApp() -Sky.provideSun(app) -Sky.provideSun(app) +Lifecycle.provideApplication(app) +Lifecycle.provideActivatable(app) ``` ## 4. Transport @@ -353,5 +352,5 @@ The RPC Protocol **MUST** be handled over a WebSocket. The Firebolt API Version *and* protocol **MUST** be passsed as part of the Sec-WebSocket-Protocol header: ```http -Sec-WebSocket-Protocol: firebolt.v2.0.0, json-rpc +Sec-WebSocket-Protocol: firebolt.v2.0.0, jsonrpc ```