mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-17 08:31:23 +00:00
* add powershell generator (wip) * minor fix to api template * rename model files * Powershell generator fix (#11) * Fix typo pacakge -> package * Add missing `petstore` subfolder to $ClientPath * Resolve $ClientPath to absolute path Start-Process needs WorkingDirectory to be absolute * Fix spaces in variable name ${ somevar } is a vairable that literally has spaces in name. We need to temporarily redifine mustache delimiters so we can generate var. names without spaces. * Fix typo Remove stray `r` * Fix *.ps1 import in module Directory structure has changed + we should export functions using manifest. * Remove erroneous file * various fixes and enhancements * remove nullable for string * change function name based on feedback by beatcracker * set index to start at 0 * fix file type * Powershell generator fix 1 (#12) * Add closing curly brace * Fix duplicated '[' * Get FunctionsToExport using AST Discussion: swagger-api/swagger-codegen#5789 * add guid option to powershell generator * add test files, remove docs * fix array of items * clean up powershell comment, update model/api test files
34 lines
660 B
Plaintext
34 lines
660 B
Plaintext
#region Import functions
|
|
|
|
'API', 'Model', 'Private' | Get-ChildItem -Path {
|
|
Join-Path $PSScriptRoot $_
|
|
} -Filter '*.ps1' | ForEach-Object {
|
|
Write-Verbose "Importing file: $($_.BaseName)"
|
|
try {
|
|
. $_.FullName
|
|
} catch {
|
|
Write-Verbose "Can't import function!"
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region Initialize APIs
|
|
|
|
{{#apiInfo}}
|
|
{{#apis}}
|
|
{{#operations}}
|
|
{{#operation}}
|
|
{{#-first}}
|
|
'Creating object: {{{packageName}}}.Api.{{{classname}}}' | Write-Verbose
|
|
$Script:{{{classname}}}= New-Object -TypeName {{{packageName}}}.Api.{{{classname}}} -ArgumentList @($null)
|
|
|
|
{{/-first}}
|
|
{{/operation}}
|
|
{{/operations}}
|
|
{{/apis}}
|
|
{{/apiInfo}}
|
|
|
|
#endregion
|