Métriques du dépôt
- Stars
- (3 783 stars)
- Métriques de merge PR
- (Métriques PR en attente)
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