add support for overlays in kiota
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.8k
- Forks
- 333
- Avg merge
- 16h 29m
- Merged PRs (30d)
- 116
Description
OpenAPI overlays allow people to maintain patches to an OpenAPI description in a separate document.
This is especially useful when the person generating a client is not the one authoring the OpenAPI description, and they don't want to maintain in sync their own modified copy.
This topic has come in discussions times and times again see: #6687 #6451 #5073 #3406 #411 and many more.
To implement overlays we first need to:
declare a new option
Name "overlay".
Supports multiple values.
Defaults to an empty array/list.
full name --overlay
Short name --ov
use that option in commands
- generate command https://github.com/microsoft/kiota/blob/0772a6e5746ae8a264fcda6626a7d667bbf55916/src/kiota/KiotaHost.cs#L436
- add command for clients https://github.com/microsoft/kiota/blob/0772a6e5746ae8a264fcda6626a7d667bbf55916/src/kiota/KiotaClientCommands.cs#L32
- edit command for clients https://github.com/microsoft/kiota/blob/0772a6e5746ae8a264fcda6626a7d667bbf55916/src/kiota/KiotaClientCommands.cs#L107
- edit command for plugins https://github.com/microsoft/kiota/blob/0772a6e5746ae8a264fcda6626a7d667bbf55916/src/kiota/KiotaPluginCommands.cs#L120
- add command for plugins https://github.com/microsoft/kiota/blob/0772a6e5746ae8a264fcda6626a7d667bbf55916/src/kiota/KiotaPluginCommands.cs#L73
pass the option to handlers
Example with generate
- https://github.com/microsoft/kiota/blob/0772a6e5746ae8a264fcda6626a7d667bbf55916/src/kiota/Handlers/KiotaGenerateCommandHandler.cs#L64
- https://github.com/microsoft/kiota/blob/0772a6e5746ae8a264fcda6626a7d667bbf55916/src/kiota/Handlers/KiotaGenerateCommandHandler.cs#L101
- https://github.com/microsoft/kiota/blob/0772a6e5746ae8a264fcda6626a7d667bbf55916/src/kiota/Handlers/KiotaGenerateCommandHandler.cs#L135
(do the same with client/plugin add/edit commands)
Add the option to the generation configuration
Add the option to the RPC server
(same for plugins)
add the option in the TypeScript API
(same for plugins)
add the dependency to the csproj
Add BinkyLabs.OpenAPI.Overlays to src/kiota.builder/kiota.builder.csproj
Intercept the loading and apply the overlays
Add some unit tests
store the overlays with the workspace service (caching)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the option definitions and command entry points in src/kiota/KiotaHost.cs, KiotaClientCommands.cs, and KiotaPluginCommands.cs, then trace the generate handler into GenerationConfiguration.cs. Review OpenApiDocumentDownloadService.cs and WorkspaceManagementService.cs, along with the RPC server and TypeScript API entry points. Done means overlays are accepted across the listed commands and APIs, applied during document loading, cached, and covered by OpenApiDocumentDownloadServiceTests.cs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, openapi, typescript
- Domain
- api, backend, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100