[PS] better code format, vendor extension naming (#6778)

* better code format, extension

* show php version

* set php version to 7.2.15
This commit is contained in:
William Cheng 2020-06-25 18:09:44 +08:00 committed by GitHub
parent 13fe079901
commit 36930fe5cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 31 additions and 30 deletions

View File

@ -89,7 +89,8 @@ before_install:
#- sudo apt-get update
#- sudo apt-get install dart
# switch to php7
- phpenv global 7.3
- phpenv versions
- phpenv global 7.2.15
- php -v
# install perl module
#- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)

View File

@ -932,7 +932,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
// Mark the last readonly false property
if(this.discardReadOnly && lastWritableProperty != null) {
lastWritableProperty.vendorExtensions.put("x-lastWritable", true);
lastWritableProperty.vendorExtensions.put("x-powershell-last-writable", true);
model.allVars.set(model.allVars.indexOf(lastWritableProperty), lastWritableProperty);
}

View File

@ -41,7 +41,7 @@ function Initialize-{{{apiNamePrefix}}}{{{classname}}} {
{{/isEnum}}
[{{vendorExtensions.x-powershell-data-type}}]
{{=<% %>=}}
${<%name%>}<%^vendorExtensions.x-lastWritable%>,<%/vendorExtensions.x-lastWritable%>
${<%name%>}<%^vendorExtensions.x-powershell-last-writable%>,<%/vendorExtensions.x-powershell-last-writable%>
<%={{ }}=%>
{{/isReadOnly}}
{{/allVars}}
@ -118,15 +118,15 @@ function Initialize-{{{apiNamePrefix}}}{{{classname}}} {
{{/minItems}}
{{/hasValidation}}
{{/vars}}
$PSO = [PSCustomObject]@{
$PSO = [PSCustomObject]@{
{{=<< >>=}}
<<#allVars>>
"<<baseName>>" = ${<<name>>}
<</allVars>>
<<={{ }}=>>
}
{{/discardReadOnly}}
{{#discardReadOnly}}
{{#vars}}

View File

@ -43,13 +43,13 @@ function Initialize-PSApiResponse {
'Creating PSCustomObject: PSPetstore => PSApiResponse' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{
$PSO = [PSCustomObject]@{
"code" = ${Code}
"type" = ${Type}
"message" = ${Message}
}
return $PSO
}

View File

@ -39,12 +39,12 @@ function Initialize-PSCategory {
'Creating PSCustomObject: PSPetstore => PSCategory' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{
$PSO = [PSCustomObject]@{
"id" = ${Id}
"name" = ${Name}
}
return $PSO
}

View File

@ -38,12 +38,12 @@ function Initialize-PSInlineObject {
'Creating PSCustomObject: PSPetstore => PSInlineObject' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{
$PSO = [PSCustomObject]@{
"name" = ${Name}
"status" = ${Status}
}
return $PSO
}

View File

@ -38,12 +38,12 @@ function Initialize-PSInlineObject1 {
'Creating PSCustomObject: PSPetstore => PSInlineObject1' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{
$PSO = [PSCustomObject]@{
"additionalMetadata" = ${AdditionalMetadata}
"file" = ${File}
}
return $PSO
}

View File

@ -59,8 +59,8 @@ function Initialize-PSOrder {
'Creating PSCustomObject: PSPetstore => PSOrder' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{
$PSO = [PSCustomObject]@{
"id" = ${Id}
"petId" = ${PetId}
"quantity" = ${Quantity}
@ -68,7 +68,7 @@ function Initialize-PSOrder {
"status" = ${Status}
"complete" = ${Complete}
}
return $PSO
}

View File

@ -67,8 +67,8 @@ function Initialize-PSPet {
throw "invalid value for 'PhotoUrls', 'PhotoUrls' cannot be null."
}
$PSO = [PSCustomObject]@{
$PSO = [PSCustomObject]@{
"id" = ${Id}
"category" = ${Category}
"name" = ${Name}
@ -76,7 +76,7 @@ function Initialize-PSPet {
"tags" = ${Tags}
"status" = ${Status}
}
return $PSO
}

View File

@ -38,12 +38,12 @@ function Initialize-PSTag {
'Creating PSCustomObject: PSPetstore => PSTag' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{
$PSO = [PSCustomObject]@{
"id" = ${Id}
"name" = ${Name}
}
return $PSO
}

View File

@ -69,8 +69,8 @@ function Initialize-PSUser {
'Creating PSCustomObject: PSPetstore => PSUser' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{
$PSO = [PSCustomObject]@{
"id" = ${Id}
"username" = ${Username}
"firstName" = ${FirstName}
@ -80,7 +80,7 @@ function Initialize-PSUser {
"phone" = ${Phone}
"userStatus" = ${UserStatus}
}
return $PSO
}