Skip to content

Commit

Permalink
Replace powershell generator with powershell-experimental generator (O…
Browse files Browse the repository at this point in the history
…penAPITools#6213)

* replace powershell generator with powershell-experimental generator

* add back samples

* add back scripts

* remove outdated script

* update doc
  • Loading branch information
wing328 authored May 8, 2020
1 parent 6e619e0 commit f327f01
Show file tree
Hide file tree
Showing 118 changed files with 1,426 additions and 2,411 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ test_script:
# test ps pestore
- ps: |
$ErrorActionPreference = "Stop"
cd samples\client\petstore\powershell-experimental\
cd samples\client\petstore\powershell\
.\Build.ps1
Import-Module -Name '.\src\PSPetstore'
$Result = Invoke-Pester -PassThru
Expand Down
32 changes: 0 additions & 32 deletions bin/openapi3/powershell-experimental-petstore.sh

This file was deleted.

32 changes: 0 additions & 32 deletions bin/openapi3/powershell-petstore.sh

This file was deleted.

2 changes: 1 addition & 1 deletion bin/powershell-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
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 $@"
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 $@"

java ${JAVA_OPTS} -jar ${executable} ${ags}
10 changes: 0 additions & 10 deletions bin/windows/powershell-petsstore.bat

This file was deleted.

10 changes: 10 additions & 0 deletions bin/windows/powershell-petstore.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar

If Not Exist %executable% (
mvn clean package
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
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

java %JAVA_OPTS% -jar %executable% %ags%
3 changes: 1 addition & 2 deletions docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ The following generators are available:
* [ocaml](generators/ocaml.md)
* [perl](generators/perl.md)
* [php](generators/php.md)
* [powershell](generators/powershell.md)
* [powershell-experimental (beta)](generators/powershell-experimental.md)
* [powershell (beta)](generators/powershell.md)
* [python](generators/python.md)
* [python-experimental (experimental)](generators/python-experimental.md)
* [r](generators/r.md)
Expand Down
103 changes: 70 additions & 33 deletions docs/generators/powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ sidebar_label: powershell

| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|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|
|apiNamePrefix|Prefix that will be appended to all PS objects. Default: empty string. e.g. Pet => PSPet.| |null|
|commonVerbs|PS common verb mappings. e.g. Delete=Remove:Patch=Update to map Delete with Remove and Patch with Update accordingly.| |null|
|packageGuid|GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default.| |null|
|packageName|Client package name (e.g. org.openapitools.client).| |Org.OpenAPITools|
|packageName|Client package name (e.g. PSTwitter).| |PSOpenAPITools|
|packageVersion|Package version (e.g. 0.1.2).| |0.1.2|
|powershellGalleryUrl|URL to the module in PowerShell Gallery (e.g. https://www.powershellgallery.com/packages/PSTwitter/).| |null|

## IMPORT MAPPING

Expand Down Expand Up @@ -56,6 +59,7 @@ sidebar_label: powershell
<li>Single</li>
<li>String</li>
<li>System.DateTime</li>
<li>System.IO.FileInfo</li>
<li>TimeSpan</li>
<li>UInt16</li>
<li>UInt32</li>
Expand All @@ -68,37 +72,70 @@ sidebar_label: powershell
## RESERVED WORDS

<ul class="column-ul">
<li>Begin</li>
<li>Break</li>
<li>Catch</li>
<li>Continue</li>
<li>Data</li>
<li>Do</li>
<li>Dynamicparam</li>
<li>Else</li>
<li>Elseif</li>
<li>End</li>
<li>Exit</li>
<li>Filter</li>
<li>Finally</li>
<li>For</li>
<li>Foreach</li>
<li>From</li>
<li>Function</li>
<li>If</li>
<li>In</li>
<li>Local</li>
<li>Param</li>
<li>Private</li>
<li>Process</li>
<li>Return</li>
<li>Switch</li>
<li>Throw</li>
<li>Trap</li>
<li>Try</li>
<li>Until</li>
<li>Where</li>
<li>While</li>
<li>args</li>
<li>begin</li>
<li>break</li>
<li>catch</li>
<li>consolefilename</li>
<li>continue</li>
<li>data</li>
<li>do</li>
<li>dynamicparam</li>
<li>else</li>
<li>elseif</li>
<li>end</li>
<li>error</li>
<li>event</li>
<li>eventargs</li>
<li>eventsubscriber</li>
<li>executioncontext</li>
<li>exit</li>
<li>false</li>
<li>filter</li>
<li>finally</li>
<li>for</li>
<li>foreach</li>
<li>from</li>
<li>function</li>
<li>home</li>
<li>host</li>
<li>if</li>
<li>in</li>
<li>input</li>
<li>lastexitcode</li>
<li>local</li>
<li>matches</li>
<li>myinvocation</li>
<li>nestedpromptlevel</li>
<li>null</li>
<li>param</li>
<li>pid</li>
<li>private</li>
<li>process</li>
<li>profile</li>
<li>pscmdlet</li>
<li>pscommandpath</li>
<li>psculture</li>
<li>psdebugcontext</li>
<li>pshome</li>
<li>psitem</li>
<li>psscriptroot</li>
<li>pssenderinfo</li>
<li>psuiculture</li>
<li>psversiontable</li>
<li>return</li>
<li>sender</li>
<li>shellid</li>
<li>stacktrace</li>
<li>switch</li>
<li>this</li>
<li>throw</li>
<li>trap</li>
<li>true</li>
<li>try</li>
<li>until</li>
<li>where</li>
<li>while</li>
</ul>

## FEATURE SET
Expand Down
Loading

0 comments on commit f327f01

Please sign in to comment.