Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter type name field to spec #396

Merged
merged 2 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ Informs the client about parameters. Only supported if the server declares the `
- `parameters`: array of:
- `name`: string, name of the parameter
- `value`: number | boolean | string | number[] | boolean[] | string[]
- `type`: "byte_array" | undefined. If the type is `byte_array`, `value` shall be interpreted as base64 encoded string.
- `id`: string | undefined. Only set when the [getParameters](#get-parameters) or [setParameters](#set-parameters) request's `id` field was set

#### Example
Expand All @@ -183,6 +184,7 @@ Informs the client about parameters. Only supported if the server declares the `
{ "name": "/float_param", "value": 1.2 },
{ "name": "/string_param", "value": "foo" },
{ "name": "/node/nested_ints_param", "value": [1, 2, 3] }
{ "name": "/byte_array_param", "value": "QUJDRA==", "type": "byte_array" },
],
"id": "request-123"
}
Expand Down Expand Up @@ -396,6 +398,7 @@ Set one or more parameters. Only supported if the server previously declared tha
- `parameters`: array of:
- `name`: string
- `value`: number | boolean | string | number[] | boolean[] | string[] | undefined. If the value is not set (`undefined`), the parameter shall be unset (removed).
- `type`: "byte_array" | undefined. If the type is `byte_array`, `value` shall be a base64 encoded string.
- `id`: string | undefined, arbitrary string used for identifying the corresponding server [response](#parameter-values). If this field is not set, the server may not send a response to the client.

#### Example
Expand All @@ -405,7 +408,8 @@ Set one or more parameters. Only supported if the server previously declared tha
"op": "setParameters",
"parameters": [
{ "name": "/int_param", "value": 3 },
{ "name": "/float_param", "value": 4.1 }
{ "name": "/float_param", "value": 4.1 },
{ "name": "/byte_array_param", "value": "QUJDRA==", "type": "byte_array" }
],
"id": "request-456"
}
Expand Down
1 change: 1 addition & 0 deletions typescript/ws-protocol/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export type ClientPublish = {
export type Parameter = {
name: string;
value: number | boolean | string | number[] | boolean[] | string[] | undefined;
type?: "byte_array";
};

export type ServerMessage =
Expand Down