Include a custom extension in the sliced OpenAPI description
- Dominant language
- C#
- Stars
- 3.8k
- Forks
- 333
- Avg merge
- 16h 29m
- Merged PRs (30d)
- 116
Description
As part of the Kiota generation for both clients and plugins, Kiota slices the OpenAPI description based on pre-selection of endpoints provided by the user (both in Kiota CLI and Kiota VS Code)
We should add a custom extension to identify those OpenAPI descriptions created by Kiota:
> x-generator: kiota/1.8 kiota-vs/1.8.1
DevProxy does something like this when generating an OpenAPI:
```jsonc
"x-ms-generated-by": {
"toolName": "Dev Proxy",
"toolVersion": "0.17.1"
}
```
This can helps us understanding which Kiota version was used to slice the OpenAPI and identify errors.
**Acceptance Criteria**
- [ ] Add a custom extension "x-generator" when slicing the OpenAPI description on the top of the document if there is none
- [ ] Modify an existing extension by adding our information to the front of the list if it was not there
- [ ] Modify an existing extension by updating our information if it already was there
- [ ] Update the custom extension with the Kiota and VS Code extension version every time a specific client/plugin is re-generated
- [ ] The custom extension should only be updated when there was a regeneration for that specific client/plugin
Contributor guide
Research direction
No files or tests are named. Start by tracing the OpenAPI slicing and regeneration entry points used by the Kiota CLI and Kiota VS Code integration, then inspect how document extensions are preserved. Done means the x-generator information is created or updated only for the specifically regenerated client or plugin, including the Kiota and VS Code extension versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, openapi, vscode
- Domain
- api, developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100