forked from loafle/openapi-generator-original
use allVars to cover all properties (#5835)
This commit is contained in:
@@ -818,7 +818,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
||||
Map<String, Object> mo = (Map<String, Object>) _mo;
|
||||
CodegenModel cm = (CodegenModel) mo.get("model");
|
||||
|
||||
for (CodegenProperty cp : cm.vars) {
|
||||
for (CodegenProperty cp : cm.allVars) {
|
||||
cp.vendorExtensions.put("x-powershell-data-type", getPSDataType(cp));
|
||||
}
|
||||
}
|
||||
@@ -952,7 +952,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
||||
|
||||
example = "(Initialize-" + codegenModel.name;
|
||||
List<String> propertyExamples = new ArrayList<>();
|
||||
for (CodegenProperty codegenProperty : codegenModel.vars) {
|
||||
for (CodegenProperty codegenProperty : codegenModel.allVars) {
|
||||
propertyExamples.add("-" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps, processedModelMap));
|
||||
}
|
||||
example += StringUtils.join(propertyExamples, " ");
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}}
|
||||
|
||||
{{#vars}}
|
||||
{{#allVars}}
|
||||
.PARAMETER {{{name}}}
|
||||
{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}}
|
||||
|
||||
{{/vars}}
|
||||
{{/allVars}}
|
||||
.OUTPUTS
|
||||
|
||||
{{{classname}}}<PSCustomObject>
|
||||
@@ -23,13 +23,13 @@
|
||||
function Initialize-{{{apiNamePrefix}}}{{{classname}}} {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
{{#vars}}
|
||||
{{#allVars}}
|
||||
[Parameter(Position = {{vendorExtensions.x-index}}, ValueFromPipelineByPropertyName = $true{{#required}}, Mandatory = $true{{/required}})]
|
||||
[{{vendorExtensions.x-powershell-data-type}}]
|
||||
{{=<% %>=}}
|
||||
${<%name%>}<%^-last%>,<%/-last%>
|
||||
<%={{ }}=%>
|
||||
{{/vars}}
|
||||
{{/allVars}}
|
||||
)
|
||||
|
||||
Process {
|
||||
@@ -38,9 +38,9 @@ function Initialize-{{{apiNamePrefix}}}{{{classname}}} {
|
||||
|
||||
$PSO = [PSCustomObject]@{
|
||||
{{=<< >>=}}
|
||||
<<#vars>>
|
||||
<<#allVars>>
|
||||
"<<baseName>>" = ${<<name>>}
|
||||
<</vars>>
|
||||
<</allVars>>
|
||||
<<={{ }}=>>
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ Get the host setting in the form of array of hashtables.
|
||||
System.Collections.Hashtable[]
|
||||
#>
|
||||
function Get-PSHostSetting {
|
||||
return @(
|
||||
return ,@(
|
||||
@{
|
||||
"Url" = "http://{server}.swagger.io:{port}/v2";
|
||||
"Description" = "petstore server";
|
||||
|
||||
Reference in New Issue
Block a user