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

For show/download can we fallback to a registry's cached copy if the origin URL fails? #1897

Closed
darrelmiller opened this issue Oct 16, 2022 · 2 comments · Fixed by #1901
Closed
Assignees
Labels
enhancement New feature or request fixed generator Issues or improvements relater to generation capabilities.

Comments

@darrelmiller
Copy link
Member

This fails

kiota show -k apisguru::polygon.io

but the copy maintained by apisguru is valid

https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/polygon.io/1.0.0/swagger.yaml
@baywet
Copy link
Member

baywet commented Oct 16, 2022

Is the URL of the copy somewhere in the index file?

@baywet baywet added generator Issues or improvements relater to generation capabilities. enhancement New feature or request labels Oct 16, 2022
@baywet baywet added this to Kiota Oct 16, 2022
@baywet baywet moved this to Todo in Kiota Oct 16, 2022
@darrelmiller
Copy link
Member Author

Looking at this index https://api.apis.guru/v2/list.json the polygon entry

"polygon.io": {
    "added": "2017-11-26T16:58:20.000Z",
    "preferred": "1.0.0",
    "versions": {
      "1.0.0": {
        "added": "2017-11-26T16:58:20.000Z",
        "info": {
          "contact": {
            "x-twitter": "polygon_io"
          },
          "description": "The future of fintech.",
          "title": "Polygon",
          "version": "1.0.0",
          "x-apisguru-categories": [
            "financial"
          ],
          "x-logo": {
            "url": "https://api.apis.guru/v2/cache/logo/https_twitter.com_polygon_io_profile_image.jpeg"
          },
          "x-origin": [
            {
              "format": "swagger",
              "url": "https://polygon.io/docs/swagger.json",
              "version": "2.0"
            }
          ],
          "x-providerName": "polygon.io"
        },
        "updated": "2017-11-27T13:03:31.000Z",
        "swaggerUrl": "https://api.apis.guru/v2/specs/polygon.io/1.0.0/swagger.json",
        "swaggerYamlUrl": "https://api.apis.guru/v2/specs/polygon.io/1.0.0/swagger.yaml",
        "openapiVer": "2.0"
      }
    }
  },

When doing kiota show -k apisguru::polygon.io it is trying to download from the x-origin instead of downloading from the swaggerUrl. The SwaggerUrl contains the apis.guru version that has corrections made. We should consider always reading from the apis-guru version.

@baywet baywet assigned baywet and unassigned darrelmiller Oct 17, 2022
@baywet baywet added the fixed label Oct 17, 2022
@baywet baywet moved this from Todo to In Progress in Kiota Oct 17, 2022
baywet added a commit that referenced this issue Oct 17, 2022
Repository owner moved this from In Progress to Done in Kiota Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed generator Issues or improvements relater to generation capabilities.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants