-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Issue
In looking at an issue with the APIKey params I found a fix, but when I went looking for the line in the openapi3\codegen-templates\api_client.mustache path I found that this section from the OktaAPIClient.ps1 file
okta-powershell-cli/src/Okta.PowerShell/Private/OktaApiClient.ps1
Lines 82 to 86 in 411f0f6
| if ($Configuration.ApiKey -and $Configuration.ApiKeyPrefix) { | |
| $headers = @{ | |
| Authorization = "$($Configuration.ApiKeyPrefix) $($Configuration.ApiKey.apitoken)" | |
| } | |
| } |
I can see where these lines were added in this comit eb29511
This modifies the client file, but not the mustache file that generates the file
This means that when you run the codegen with openapi-generator-cli generate -g powershell -c config.json --skip-validate-spec it deletes this section of the OktaApiClient file.
Im currently writing a PR to fix that section of the file as it has a mistake in the variable name $headers which means the APIKey does not get passed or used
Scope
But on running the code gen I found it made changes to the following files that reverse commits to main:
modified: ../docs/OktaApplicationApi.md
modified: ../docs/OktaUserApi.md
modified: ../src/Okta.PowerShell/Private/OktaApiClient.ps1
Expected behavior
When running the OpenAPI Generator on a clean repository the output should match the state of the repository
To fix this the mustache files need to have the direct edits incorporated into them