mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
[PowerShell] add more fields to be customized (#6835)
* more fields to be customized * set powershell version * fix psData
This commit is contained in:
@@ -9,3 +9,4 @@ additionalProperties:
|
||||
packageName: PSPetstore
|
||||
powershellGalleryUrl: https://www.powershellgallery.com/packages/PSPetstore
|
||||
apiNamePrefix: PS
|
||||
powershellVersion: "5.0"
|
||||
|
||||
@@ -501,6 +501,12 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
cliOptions.add(new CliOption("commonVerbs", "PS common verb mappings. e.g. Delete=Remove:Patch=Update to map Delete with Remove and Patch with Update accordingly."));
|
||||
cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC));
|
||||
cliOptions.add(new CliOption("discardReadOnly", "Set discardReadonly to true to generate the Initialize cmdlet without readonly parameters"));
|
||||
|
||||
// default value in the template
|
||||
additionalProperties.put("powershellVersion", "6.2"); // minimal PS version
|
||||
additionalProperties.put("author", "OpenAPI Generator Team");
|
||||
additionalProperties.put("companyName", "openapitools.org");
|
||||
additionalProperties.put("psData", null);
|
||||
}
|
||||
|
||||
public CodegenType getTag() {
|
||||
|
||||
@@ -44,16 +44,24 @@ $FunctionPath = 'Api', 'Model', 'Client' | ForEach-Object {Join-Path "$ScriptDir
|
||||
$Manifest = @{
|
||||
Path = "$ScriptDir\src\{{{packageName}}}\{{{packageName}}}.psd1"
|
||||
|
||||
Author = 'OpenAPI Generator Team'
|
||||
CompanyName = 'openapitools.org'
|
||||
Author = '{{{author}}}'
|
||||
CompanyName = '{{{companyName}}}'
|
||||
Description = '{{{packageName}}} - the PowerShell module for {{{appName}}}'
|
||||
|
||||
{{#psData}}
|
||||
PrivateData = @{
|
||||
PSData = @{
|
||||
{{{.}}}
|
||||
}
|
||||
}
|
||||
|
||||
{{/psData}}
|
||||
ModuleVersion = '{{{packageVersion}}}'
|
||||
|
||||
RootModule = '{{{packageName}}}.psm1'
|
||||
Guid = '{{packageGuid}}' # Has to be static, otherwise each new build will be considered different module
|
||||
|
||||
PowerShellVersion = '3.0'
|
||||
PowerShellVersion = '{{{powershellVersion}}}'
|
||||
|
||||
FunctionsToExport = $FunctionPath | Get-ChildItem -Filter *.ps1 | Get-FunctionsToExport
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ This PowerShell module is automatically generated by the [OpenAPI Generator](htt
|
||||
|
||||
<a name="frameworks-supported"></a>
|
||||
## Frameworks supported
|
||||
- PowerShell 5.0 or later
|
||||
- PowerShell {{{powershellVersion}}} or later
|
||||
|
||||
<a name="dependencies"></a>
|
||||
## Dependencies
|
||||
|
||||
@@ -59,7 +59,7 @@ $Manifest = @{
|
||||
RootModule = 'PSPetstore.psm1'
|
||||
Guid = 'a27b908d-2a20-467f-bc32-af6f3a654ac5' # Has to be static, otherwise each new build will be considered different module
|
||||
|
||||
PowerShellVersion = '3.0'
|
||||
PowerShellVersion = '5.0'
|
||||
|
||||
FunctionsToExport = $FunctionPath | Get-ChildItem -Filter *.ps1 | Get-FunctionsToExport
|
||||
|
||||
|
||||
Reference in New Issue
Block a user