Skip to content

Commit f327f01

Browse files
authored
Replace powershell generator with powershell-experimental generator (#6213)
* replace powershell generator with powershell-experimental generator * add back samples * add back scripts * remove outdated script * update doc
1 parent 6e619e0 commit f327f01

File tree

118 files changed

+1426
-2411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1426
-2411
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ test_script:
7070
# test ps pestore
7171
- ps: |
7272
$ErrorActionPreference = "Stop"
73-
cd samples\client\petstore\powershell-experimental\
73+
cd samples\client\petstore\powershell\
7474
.\Build.ps1
7575
Import-Module -Name '.\src\PSPetstore'
7676
$Result = Invoke-Pester -PassThru

bin/openapi3/powershell-experimental-petstore.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

bin/openapi3/powershell-petstore.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

bin/powershell-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="generate -t modules/openapi-generator/src/main/resources/powershell -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g powershell -o samples/client/petstore/powershell --additional-properties packageGuid=a27b908d-2a20-467f-bc32-af6f3a654ac5,csharpClientPath=\$ScriptDir\..\..\petstore\csharp\OpenAPIClient $@"
30+
ags="generate -t modules/openapi-generator/src/main/resources/powershell -i modules/openapi-generator/src/test/resources/3_0/powershell/petstore.yaml -g powershell -o samples/client/petstore/powershell --additional-properties powershellGalleryUrl=https://www.powershellgallery.com/packages/PSPetstore,packageGuid=a27b908d-2a20-467f-bc32-af6f3a654ac5,packageName=PSPetstore,apiNamePrefix=PS,packageVersion=0.1.2,commonVerbs=Delete=Remove:Patch=Update $@"
3131

3232
java ${JAVA_OPTS} -jar ${executable} ${ags}

bin/windows/powershell-petsstore.bat

Lines changed: 0 additions & 10 deletions
This file was deleted.

bin/windows/powershell-petstore.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
2+
3+
If Not Exist %executable% (
4+
mvn clean package
5+
)
6+
7+
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
8+
set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g powershell -o samples\client\petstorep\powershell --additional-properties powershellGalleryUrl=https://www.powershellgallery.com/packages/PSPetstore,packageGuid=a27b908d-2a20-467f-bc32-af6f3a654ac5,packageName=PSPetstore,apiNamePrefix=PS,packageVersion=0.1.2,commonVerbs=Delete=Remove:Patch=Update
9+
10+
java %JAVA_OPTS% -jar %executable% %ags%

docs/generators.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ The following generators are available:
4646
* [ocaml](generators/ocaml.md)
4747
* [perl](generators/perl.md)
4848
* [php](generators/php.md)
49-
* [powershell](generators/powershell.md)
50-
* [powershell-experimental (beta)](generators/powershell-experimental.md)
49+
* [powershell (beta)](generators/powershell.md)
5150
* [python](generators/python.md)
5251
* [python-experimental (experimental)](generators/python-experimental.md)
5352
* [r](generators/r.md)

docs/generators/powershell.md

Lines changed: 70 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ sidebar_label: powershell
55

66
| Option | Description | Values | Default |
77
| ------ | ----------- | ------ | ------- |
8-
|csharpClientPath|Path to the C# API client generated by OpenAPI Generator, e.g. $ScriptDir\..\csharp\OpenAPIClient where $ScriptDir is the current directory. NOTE: you will need to generate the C# API client separately.| |$ScriptDir\csharp\OpenAPIClient|
8+
|apiNamePrefix|Prefix that will be appended to all PS objects. Default: empty string. e.g. Pet => PSPet.| |null|
9+
|commonVerbs|PS common verb mappings. e.g. Delete=Remove:Patch=Update to map Delete with Remove and Patch with Update accordingly.| |null|
910
|packageGuid|GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default.| |null|
10-
|packageName|Client package name (e.g. org.openapitools.client).| |Org.OpenAPITools|
11+
|packageName|Client package name (e.g. PSTwitter).| |PSOpenAPITools|
12+
|packageVersion|Package version (e.g. 0.1.2).| |0.1.2|
13+
|powershellGalleryUrl|URL to the module in PowerShell Gallery (e.g. https://www.powershellgallery.com/packages/PSTwitter/).| |null|
1114

1215
## IMPORT MAPPING
1316

@@ -56,6 +59,7 @@ sidebar_label: powershell
5659
<li>Single</li>
5760
<li>String</li>
5861
<li>System.DateTime</li>
62+
<li>System.IO.FileInfo</li>
5963
<li>TimeSpan</li>
6064
<li>UInt16</li>
6165
<li>UInt32</li>
@@ -68,37 +72,70 @@ sidebar_label: powershell
6872
## RESERVED WORDS
6973

7074
<ul class="column-ul">
71-
<li>Begin</li>
72-
<li>Break</li>
73-
<li>Catch</li>
74-
<li>Continue</li>
75-
<li>Data</li>
76-
<li>Do</li>
77-
<li>Dynamicparam</li>
78-
<li>Else</li>
79-
<li>Elseif</li>
80-
<li>End</li>
81-
<li>Exit</li>
82-
<li>Filter</li>
83-
<li>Finally</li>
84-
<li>For</li>
85-
<li>Foreach</li>
86-
<li>From</li>
87-
<li>Function</li>
88-
<li>If</li>
89-
<li>In</li>
90-
<li>Local</li>
91-
<li>Param</li>
92-
<li>Private</li>
93-
<li>Process</li>
94-
<li>Return</li>
95-
<li>Switch</li>
96-
<li>Throw</li>
97-
<li>Trap</li>
98-
<li>Try</li>
99-
<li>Until</li>
100-
<li>Where</li>
101-
<li>While</li>
75+
<li>args</li>
76+
<li>begin</li>
77+
<li>break</li>
78+
<li>catch</li>
79+
<li>consolefilename</li>
80+
<li>continue</li>
81+
<li>data</li>
82+
<li>do</li>
83+
<li>dynamicparam</li>
84+
<li>else</li>
85+
<li>elseif</li>
86+
<li>end</li>
87+
<li>error</li>
88+
<li>event</li>
89+
<li>eventargs</li>
90+
<li>eventsubscriber</li>
91+
<li>executioncontext</li>
92+
<li>exit</li>
93+
<li>false</li>
94+
<li>filter</li>
95+
<li>finally</li>
96+
<li>for</li>
97+
<li>foreach</li>
98+
<li>from</li>
99+
<li>function</li>
100+
<li>home</li>
101+
<li>host</li>
102+
<li>if</li>
103+
<li>in</li>
104+
<li>input</li>
105+
<li>lastexitcode</li>
106+
<li>local</li>
107+
<li>matches</li>
108+
<li>myinvocation</li>
109+
<li>nestedpromptlevel</li>
110+
<li>null</li>
111+
<li>param</li>
112+
<li>pid</li>
113+
<li>private</li>
114+
<li>process</li>
115+
<li>profile</li>
116+
<li>pscmdlet</li>
117+
<li>pscommandpath</li>
118+
<li>psculture</li>
119+
<li>psdebugcontext</li>
120+
<li>pshome</li>
121+
<li>psitem</li>
122+
<li>psscriptroot</li>
123+
<li>pssenderinfo</li>
124+
<li>psuiculture</li>
125+
<li>psversiontable</li>
126+
<li>return</li>
127+
<li>sender</li>
128+
<li>shellid</li>
129+
<li>stacktrace</li>
130+
<li>switch</li>
131+
<li>this</li>
132+
<li>throw</li>
133+
<li>trap</li>
134+
<li>true</li>
135+
<li>try</li>
136+
<li>until</li>
137+
<li>where</li>
138+
<li>while</li>
102139
</ul>
103140

104141
## FEATURE SET

0 commit comments

Comments
 (0)