Skip to content

Error when generating an API plugin #4715

Closed

Description

What are you generating using Kiota, clients or plugins?

Kiota plugin

In what context or format are you using Kiota?

Windows executable

Client library/SDK language

None

Describe the bug

I'm able to search and find the GitHub OpenAPI description and select the endpoints I care about, which are:

  • /repos/{owner}/{repo}#GET
  • /repos/{owner}/{repo}#PATCH
  • /repos/{owner}/{repo}#DELETE

When trying to generate an "API Plugin" for the above endpoints, I got the following error:
image

In the output folder, both generated files (plugin and sliced openapi) are wrong.
Plugin file has no functions nor runtimes objects.

{
  "schema_version": "v2",
  "name_for_human": "GitHub v3 REST API",
  "description_for_human": "GitHub\u0026apos;s v3 REST API.",
  "description_for_model": "GitHub\u0026apos;s v3 REST API.",
  "logo_url": "https://api.apis.guru/v2/cache/logo/https_twitter.com_github_profile_image.jpeg",
  "namespace": "githubrepo",
  "capabilities": {
    "localization": {}
  }
}

The sliced OpenAPI description has no "paths".

openapi: 3.0.1
info:
  title: GitHub v3 REST API
  description: GitHub's v3 REST API.
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  version: '1.1.4'
  x-apisguru-categories:
    - collaboration
    - developer_tools
  x-github-plan: api.github.com
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_twitter.com_github_profile_image.jpeg
  x-origin:
    - format: openapi
      url: https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json
      version: '3.0'
  x-providerName: github.com
  x-serviceName: api.github.com
servers:
  - url: https://api.github.com
paths: { }
components: ...

Using the same extension version I'm able to correctly generate an API Plugin for other GitHub endpoints, like /search node.
Also, after getting the above error, I'm not able to load a new OpenAPI description. For that, I need to close and reopen VS Code.

Expected behavior

I should be able to generate an API plugin with functions and runtime for the selected endpoints as well as have a sliced OpenAPI description with only the selected endpoints in the paths

How to reproduce

Just try to generate a plugin for all the following endpoints:

  • /repos/{owner}/{repo}#GET
  • /repos/{owner}/{repo}#PATCH
  • /repos/{owner}/{repo}#DELETE

Open API description file

No response

Kiota Version

plugin feature

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

No response

Configuration

No response

Debug output

Click to expand log ```
</details>


### Other information

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

type:bugA broken experience

Type

No type

Projects

  • Status

    Done ✔️

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions