Skip to content

Commit

Permalink
Add Link spec
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigozhou committed Aug 30, 2024
1 parent 9fb1eaa commit 4d0ed52
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,25 @@ properties:
Describes the current state of an operation.
```

### Links

The `Link` object represents a link to which the receiver can use and associate the operation.
The object MUST adhere to the given schema:

```yaml
type: object
properties:
url:
type: url
description: |
The URL the link is pointing to.
type:
type: string
description: |
Type provides additional information about the URL that can be used to parse it.
```

## Endpoint Descriptions

### Start Operation
Expand All @@ -97,6 +116,10 @@ Headers that start with the `Nexus-Callback-` prefix are expected to be attached
the handler. The callback request must strip away the `Nexus-Callback-` prefix. E.g if a Start Operation request
includes a `Nexus-Callback-Token: some-token` header, the callback request would include a `Token: some-token` header.

The header `Nexus-Link` contains a `Link` object encoded the same way as the HTTP header `Link` described
[here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link). The handler can use it to associate
the operations to the links sent by the caller. You can pass multiple `Nexus-Link` header to send multiple links.

#### Request Body

The body may contain arbitrary data. Headers should specify content type and encoding.
Expand All @@ -111,11 +134,13 @@ The body may contain arbitrary data. Headers should specify content type and enc

**Body**: Arbitrary data conveying the operation's result. Headers should specify content type and encoding.

- `201 Created`: Operation was started and will complete asynchronously.
- `201 Created`: Operation was started and will complete asynchronously. It may return `Nexus-Link` headers that
contain information about the operations done by the handler.

**Headers**:

- `Content-Type: application/json`
- `Nexus-Link: <url>; type="..."`

**Body**: A JSON serialized [`OperationInfo`](#operationinfo) object.

Expand Down

0 comments on commit 4d0ed52

Please sign in to comment.