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

Pageable next link #1197

Closed
mcardosos opened this issue May 6, 2017 · 2 comments
Closed

Pageable next link #1197

mcardosos opened this issue May 6, 2017 · 2 comments

Comments

@mcardosos
Copy link
Contributor

In the Graph swagger, lets take this operation as example...

"/{tenantID}/{nextLink}?Applications_ListNext": {
      "get": {
        "tags": [
          "Applications"
        ],
        "operationId": "Applications_ListNext",
        "description": "Gets a list of applications from the current tenant.",
        "parameters": [
          {
            "name": "nextLink",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Next link for the list operation.",
            "x-ms-skip-url-encoding": true
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "$ref": "#/parameters/tenantIDInPath"
          }
        ],
        "responses": {
          "200": {
            "description": "OK. The operation was successful.",
            "schema": {
              "$ref": "#/definitions/ApplicationListResult"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/GraphError"
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "odata.nextLink",
          "operationName": "Applications_ListNext"
        }
      }
    },

Something cool to see here would be a relation between the nextLink parameter, and odata.nextLink from x-ms-pageable. Right now, to use this pageable operations, you have to guess that whatever comes in odata.nextLink goes into nextLink. Linking this two things (and making AutoRest cooperate) could produce easier to use SDKs. Thoughts?
@marstr @jhendrixMSFT

@mcardosos mcardosos added the Graph label May 6, 2017
@lmazuel
Copy link
Member

lmazuel commented May 8, 2017

That's a good point. Note to add points in the discussion that currently in Python we assume that if the initial operation has "operationName", then the parameter is called "nextLink" (Azure/autorest#1420). This allowed us to generate correctly this specific client. Would be better to have an explicit relation, more than an assumption
@fearthecowboy @olydis

@olydis
Copy link
Contributor

olydis commented May 8, 2017

maybe that's actually something OpenAPI 3.0 can model (like, without x-ms- stuff or funny assumptions). 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants