Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Link spec
Browse files Browse the repository at this point in the history
rodrigozhou committed Aug 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9fb1eaa commit e5c2e4b
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
@@ -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
@@ -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.
@@ -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.

0 comments on commit e5c2e4b

Please sign in to comment.