forked from loafle/openapi-generator-original
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
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
#
|
||||
# OpenAPI Petstore
|
||||
# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
# Version: 1.0.0
|
||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||
#
|
||||
|
||||
function Get-FunctionsToExport {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
@@ -38,51 +45,28 @@ function Get-FunctionsToExport {
|
||||
}
|
||||
|
||||
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
|
||||
$ClientPath = ("$ScriptDir\..\..\petstore\csharp\OpenAPIClient" | Resolve-Path).ProviderPath
|
||||
$FunctionPath = 'API', 'Model' | ForEach-Object {Join-Path "$ScriptDir\src\Org.OpenAPITools\" $_}
|
||||
$BinPath = "$ScriptDir\src\Org.OpenAPITools\Bin"
|
||||
|
||||
Start-Process -FilePath "$ClientPath\build.bat" -WorkingDirectory $ClientPath -Wait -NoNewWindow
|
||||
|
||||
if (!(Test-Path "$ScriptDir\src\Org.OpenAPITools\Bin" -PathType Container)) {
|
||||
New-Item "$ScriptDir\src\Org.OpenAPITools\Bin" -ItemType Directory > $null
|
||||
}
|
||||
|
||||
Copy-Item "$ClientPath\bin\*.dll" $BinPath
|
||||
$FunctionPath = 'Api', 'Model', 'Client' | ForEach-Object {Join-Path "$ScriptDir\src\PSPetstore\" $_}
|
||||
|
||||
$Manifest = @{
|
||||
Path = "$ScriptDir\src\Org.OpenAPITools\Org.OpenAPITools.psd1"
|
||||
Path = "$ScriptDir\src\PSPetstore\PSPetstore.psd1"
|
||||
|
||||
Author = 'OpenAPI Generator Team'
|
||||
CompanyName = 'openapitools.org'
|
||||
Description = 'Org.OpenAPITools - the PowerShell module for OpenAPI Petstore'
|
||||
Description = 'PSPetstore - the PowerShell module for OpenAPI Petstore'
|
||||
|
||||
RootModule = 'Org.OpenAPITools.psm1'
|
||||
ModuleVersion = '0.1.2'
|
||||
|
||||
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'
|
||||
|
||||
RequiredAssemblies = Get-ChildItem "$BinPath\*.dll" | ForEach-Object {
|
||||
Join-Path $_.Directory.Name $_.Name
|
||||
}
|
||||
|
||||
FunctionsToExport = $FunctionPath | Get-ChildItem -Filter *.ps1 | Get-FunctionsToExport
|
||||
|
||||
VariablesToExport = @()
|
||||
AliasesToExport = @()
|
||||
CmdletsToExport = @()
|
||||
|
||||
# Should we use prefix to prevent command name collisions?
|
||||
# https://www.sapien.com/blog/2016/02/15/use-prefixes-to-prevent-command-name-collision/
|
||||
#
|
||||
# Kirk Munro recommends against it:
|
||||
# https://www.sapien.com/blog/2016/02/15/use-prefixes-to-prevent-command-name-collision/#comment-20820
|
||||
#
|
||||
# If not, we'd need to generate functions name with prefix. For examples,
|
||||
#
|
||||
# DefaultCommandPrefix = 'PetApi'
|
||||
# DefaultCommandPrefix = 'StoreApi'
|
||||
# DefaultCommandPrefix = 'UserApi'
|
||||
}
|
||||
|
||||
New-ModuleManifest @Manifest
|
||||
|
||||
Reference in New Issue
Block a user