OpenAPITools / OpenAPITools/openapi-generator

PowerShell Generator creates code snippets but the apiNamePrefix is ignored in the code snippets

Open
#18,391 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Version is 7.4.0
Description

Using the following command line:
java -jar .\openapi-generator-cli-7.4.0.jar generate -i .\openapi.json -o .\Module_Name -g powershell -c .\psopenapi.yaml

generatorName: powershell
inputSpec: openapi.json
outputDir: OutputDir
skipValidateSpec: true
removeOperationIdPrefix: true
minimalUpdate: true
packageName: Module_Name
packageVersion: 0.0.1
apiNamePrefix: LE
powershellVersion: "5.1"
powershellGalleryUrl: https://www.powershellgallery.com/packages/Module_Name

The PowerShell Module is created and has the necessary Markdown files for documentation purposes.

The documentation files are fantastic and comprehensive; the only issue is the code snippets.

image

You'll see in this code snippet that some of the commands are missing the apiNamePrefix.

  • Get-Configuration is actually Get-LEConfiguration
  • Initialize-AccountField is actually Initialize-LEAccountField
  • Initialize-AccountCreate is actually Initialize-LEAccountCreate

The OpenAPISpec attached.
openapiv6.json

Suggest a fix

Has the apiNamePrefix be consistent in the documentation too

PS. Thank you to everyone involved for all the hard work!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PowerShell generator templates or entry points that produce the Markdown code snippets, using the supplied openapiv6.json and psopenapi.yaml configuration. Regenerate the module with the shown command and compare snippet names with generated commands such as Get-LEConfiguration. Done means the documented snippets consistently include the configured LE apiNamePrefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, powershell
Domain
documentation, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.