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 Nexus-Link header spec #8

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

rodrigozhou
Copy link
Contributor

Add Link to api spec.

@rodrigozhou rodrigozhou requested a review from bergundy August 29, 2024 21:16
@rodrigozhou rodrigozhou force-pushed the rodrigozhou/links branch 2 times, most recently from e5c2e4b to 4d0ed52 Compare August 30, 2024 17:05
SPEC.md Outdated
@@ -72,6 +72,25 @@ properties:
Describes the current state of an operation.
```

### Links
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't put this in the schema section. These objects are never serialized in JSON form.

I would add another section to the doc called Links after Predefined Handler Errors

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the new section you can borrow the text from MDN:

The Nexus-Link header field provides a means for serializing one or more links in HTTP headers. This header is encoded the same way as the HTTP header Link described
here.
Handlers and callers can specify links in different Nexus requests to associate an operation with arbitrary resources.

SPEC.md Outdated
Comment on lines 137 to 138
- `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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.
- `201 Created`: Operation was started and will complete asynchronously. It may return `Nexus-Link` headers to
associate resources to this operation.

SPEC.md Outdated
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can shorten this and link to the Links header.

Copy link
Contributor

@bergundy bergundy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodrigozhou I ended up editing this myself. It made more sense than to keep doing this back and forth.

@bergundy bergundy merged commit 7b4a6a3 into nexus-rpc:main Sep 25, 2024
1 check passed
@bergundy bergundy changed the title Add Link spec Add Nexus-Link header spec Sep 25, 2024
@rodrigozhou rodrigozhou deleted the rodrigozhou/links branch September 25, 2024 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants