Skip to content

edit Response Payload Example #1187

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

Closed
wants to merge 1 commit into from

Conversation

krishahn
Copy link
Contributor

No description provided.

@@ -2046,15 +2046,15 @@ ColorSelection:

Would produce three links with the `colorName` of `red`, `green`, and `blue`:

As with all links, it is at the clients' discretion to follow them, neither
permissions nor the ability to make a successful call to that link is guaranteed
Clients follow all links, including these, at their own discretion. Neither
Copy link
Contributor

Choose a reason for hiding this comment

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

Can drop ', including these," here. I think.

@@ -2280,7 +2280,7 @@ components:
href: 'https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{$response.body#/username}'
```

Note that in the use of `operationRef`, the _escaped forward-slash_ is necessary when
Prefixing `operationRef` using the _escaped forward-slash_ is necessary when
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs clarification because the URL includes both escaped and unescaped forward slashes.

The URL (right hand side) here is a reference to the path /2.0/repositories/ and the / characters in that path are escaped by converting them to the character sequence ~1. (that is a tilde and the numeral one), yielding the JSON path element ~12.0~1repositories~1 . These forward slashes are escaped because this part of the JSON reference refers to an element in the JSON document with the key /2.0/repositories/ -- a child of the paths object in that OpenAPI document.

The / characters in the other part of the href, namely https://na2.gigantic-server.com/#/paths/ should not be escaped because the first part is the ___location of an OpenAPI document and #/paths/ is the path to the children of the paths object.

The final forward slash in {$response.body#/username} is not escaped because that is a second (nested) JSON reference which refers to the top-level username attribute in the runtime response body, such as

{
   "id" : "u284230",
  "username" : "darrelmiller"
}

Forward slashes would be necessary here if and only if items in the response body themselves contain forward slashes, such as accessing the members in the the following JSON response body:

{
  "codeNames" : {
     "mi/0" : "darrelmiller",
     "mi/6" : "u284230",
   }
}

If one wanted to insert the value associated with "mi/6" into the link URL, that forward slash would have to be escaped: {$response.body#/codeNames/mi~16}

Again, @darrelmiller please confirm. Perhaps this level of detail is not necessary, but some explanation of slash escaping should be here.

@@ -2280,7 +2280,7 @@ components:
href: 'https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{$response.body#/username}'
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this should be operationRef: not href: - @darrelmiller please confirm.

@darrelmiller
Copy link
Member

Much of this has changed in in my #1103 PR

@webron webron closed this Jun 14, 2017
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.

4 participants