Skip to content

Running OpenAPI3 CodeGen removes some previous commits #90

@TriggerAu

Description

@TriggerAu

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

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions