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

spec: Allow specifying service schema names & encodings #563

Merged
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
28 changes: 23 additions & 5 deletions docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,21 @@ Informs the client about available services. Only supported if the server declar
- `op`: string `"advertiseServices"`
- `services`: array of:
- `id`: number. The server may reuse ids when services disappear and reappear, but only if the services keeps the exact same name, type, and schema. Clients will use this unique id to cache schema info and deserialization routines.
- `name`: string
- `type`: string
- `requestSchema`: string
- `responseSchema`: string
- `name`: string, name used to identify the service.
- `type`: string, type of the service. May be used to derive request & response schema names if `request` or `response` are not given.
- `request`: object describing the request. Required if `requestSchema` is not given.
- `encoding`: string, type of encoding used for request message encoding.
- `schemaName`: string, name of the request schema.
- `schemaEncoding`: string, type of encoding used for schema encoding.
- `schema`: string, schema definition in a format matching the `schemaEncoding`.
- `response`: object describing the response. Required if `responseSchema` is not given.
- `encoding`: string, type of encoding used for response message encoding.
- `schemaName`: string, name of the response schema.
- `schemaEncoding`: string, type of encoding used for schema encoding.
- `schema`: string, schema definition in a format matching the `schemaEncoding`.
- `requestSchema`: string | undefined, request schema definition. The schema encoding will be derived from the [`supportedEncodings`](#server-info) sent by the server. Required if `request` is not given. Field is present for backwards compatibilty, prefer using `request` instead.
- `responseSchema`: string | undefined, response schema definition. The schema encoding will be derived from the [`supportedEncodings`](#server-info) sent by the server. Required if `response` is not given. Field is present for backwards compatibilty, prefer using `response` instead.


#### Example

Expand All @@ -218,9 +229,16 @@ Informs the client about available services. Only supported if the server declar
{
"id": 1,
"name": "foo",
"type": "std_srvs/srv/Empty",
"type": "std_srvs/Empty",
"requestSchema": "",
"responseSchema": ""
},
{
"id": 2,
"name": "set_bool",
"type": "std_srvs/SetBool",
"request": { "encoding": "ros1", "schemaName": "std_srvs/SetBool_Request", "schemaEncoding": "ros1msg", "schema": "bool data" },
"response": { "encoding": "ros1", "schemaName": "std_srvs/SetBool_Response", "schemaEncoding": "ros1msg", "schema": "bool success\nstring message" }
}
]
}
Expand Down
Loading