forked from loafle/openapi-generator-original
minor fix to powershell api doc (#8496)
This commit is contained in:
+13
-3
@@ -1082,7 +1082,12 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
if (StringUtils.isEmpty(codegenParameter.example)) {
|
||||
return "\"" + codegenParameter.example + "\"";
|
||||
} else {
|
||||
return "\"" + codegenParameter.paramName + "_example\"";
|
||||
if (Boolean.TRUE.equals(codegenParameter.isEnum)) { // enum
|
||||
List<Object> enumValues = (List<Object>) codegenParameter.allowableValues.get("values");
|
||||
return "\"" + String.valueOf(enumValues.get(0)) + "\"";
|
||||
} else {
|
||||
return "\"" + codegenParameter.paramName + "_example\"";
|
||||
}
|
||||
}
|
||||
} else if ("Boolean".equals(codegenParameter.dataType) ||
|
||||
"System.Nullable[Boolean]".equals(codegenParameter.dataType)) { // boolean
|
||||
@@ -1124,7 +1129,12 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
if (StringUtils.isEmpty(codegenProperty.example)) {
|
||||
return "\"" + codegenProperty.example + "\"";
|
||||
} else {
|
||||
return "\"" + codegenProperty.name + "_example\"";
|
||||
if (Boolean.TRUE.equals(codegenProperty.isEnum)) { // enum
|
||||
List<Object> enumValues = (List<Object>) codegenProperty.allowableValues.get("values");
|
||||
return "\"" + String.valueOf(enumValues.get(0)) + "\"";
|
||||
} else {
|
||||
return "\"" + codegenProperty.name + "_example\"";
|
||||
}
|
||||
}
|
||||
} else if ("Boolean".equals(codegenProperty.dataType) ||
|
||||
"System.Nullable[Boolean]".equals(codegenProperty.dataType)) { // boolean
|
||||
@@ -1173,7 +1183,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
processedModelMap.put(model, 1);
|
||||
}
|
||||
|
||||
example = "(Initialize-" + codegenModel.name;
|
||||
example = "(Initialize-" + codegenModel.name + " ";
|
||||
List<String> propertyExamples = new ArrayList<>();
|
||||
for (CodegenProperty codegenProperty : codegenModel.allVars) {
|
||||
propertyExamples.add("-" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps, processedModelMap));
|
||||
|
||||
@@ -26,24 +26,24 @@ Method | HTTP request | Description
|
||||
Import-Module -Name {{{packageName}}}
|
||||
|
||||
{{#hasAuthMethods}}
|
||||
$Configuration = Get-{{{packageName}}}Configuration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
{{#authMethods}}
|
||||
{{#isBasic}}
|
||||
# Configure HTTP basic authorization: {{{name}}}
|
||||
$Configuration["Username"] = "YOUR_USERNAME";
|
||||
$Configuration["Password"] = "YOUR_PASSWORD";
|
||||
$Configuration.Username = "YOUR_USERNAME"
|
||||
$Configuration.Password = "YOUR_PASSWORD"
|
||||
{{/isBasic}}
|
||||
{{#isApiKey}}
|
||||
# Configure API key authorization: {{{name}}}
|
||||
$Configuration["ApiKey"]["{{{keyParamName}}}"] = "YOUR_API_KEY"
|
||||
$Configuration.ApiKey.{{{keyParamName}}} = "YOUR_API_KEY"
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
#$Configuration["ApiKeyPrefix"]["{{{keyParamName}}}"] = "Bearer"
|
||||
#$Configuration.ApiKeyPrefix.{{{keyParamName}}} = "Bearer"
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
# Configure OAuth2 access token for authorization: {{{name}}}
|
||||
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
|
||||
$Configuration.AccessToken = "YOUR_ACCESS_TOKEN"
|
||||
{{/isOAuth}}
|
||||
|
||||
{{#isHttpSignature}}
|
||||
# Configure HttpSignature for authorization :{{name}}
|
||||
$httpSigningParams = @{
|
||||
@@ -52,11 +52,10 @@ $httpSigningParams = @{
|
||||
HttpSigningHeader = @("(request-target)","Host","Date","Digest")
|
||||
HashAlgorithm = "sha256"
|
||||
}
|
||||
Set-{{{packageName}}}ConfigurationHttpSigning @httpSigningParams
|
||||
|
||||
Set-ConfigurationHttpSigning $httpSigningParams
|
||||
{{/isHttpSignature}}
|
||||
{{/authMethods}}
|
||||
|
||||
{{/authMethods}}
|
||||
{{/hasAuthMethods}}
|
||||
{{#allParams}}
|
||||
${{paramName}} = {{{vendorExtensions.x-powershell-example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||
|
||||
@@ -25,12 +25,12 @@ Add a new pet to the store
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
|
||||
$Configuration.AccessToken = "YOUR_ACCESS_TOKEN"
|
||||
|
||||
|
||||
$Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store
|
||||
$Pet = (Initialize-Pet -Id 123 -Category (Initialize-Category -Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag -Id 123 -Name "Name_example")) -Status "available") # Pet | Pet object that needs to be added to the store
|
||||
|
||||
# Add a new pet to the store
|
||||
try {
|
||||
@@ -74,10 +74,10 @@ Deletes a pet
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
$Configuration.AccessToken = "YOUR_ACCESS_TOKEN"
|
||||
|
||||
$PetId = 987 # Int64 | Pet id to delete
|
||||
$ApiKey = "ApiKey_example" # String | (optional)
|
||||
@@ -126,12 +126,12 @@ Multiple status values can be provided with comma separated strings
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
|
||||
$Configuration.AccessToken = "YOUR_ACCESS_TOKEN"
|
||||
|
||||
|
||||
$Status = @("Status_example") # String[] | Status values that need to be considered for filter
|
||||
$Status = @("available") # String[] | Status values that need to be considered for filter
|
||||
|
||||
# Finds Pets by status
|
||||
try {
|
||||
@@ -176,10 +176,10 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
$Configuration.AccessToken = "YOUR_ACCESS_TOKEN"
|
||||
|
||||
$Tags = @("Inner_example") # String[] | Tags to filter by
|
||||
|
||||
@@ -226,12 +226,12 @@ Returns a single pet
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure API key authorization: api_key
|
||||
$Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY"
|
||||
$Configuration.ApiKey.api_key = "YOUR_API_KEY"
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
#$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer"
|
||||
|
||||
#$Configuration.ApiKeyPrefix.api_key = "Bearer"
|
||||
|
||||
$PetId = 987 # Int64 | ID of pet to return
|
||||
|
||||
@@ -276,12 +276,12 @@ Update an existing pet
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
|
||||
$Configuration.AccessToken = "YOUR_ACCESS_TOKEN"
|
||||
|
||||
|
||||
$Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store
|
||||
$Pet = (Initialize-Pet -Id 123 -Category (Initialize-Category -Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag -Id 123 -Name "Name_example")) -Status "available") # Pet | Pet object that needs to be added to the store
|
||||
|
||||
# Update an existing pet
|
||||
try {
|
||||
@@ -326,10 +326,10 @@ Updates a pet in the store with form data
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
$Configuration.AccessToken = "YOUR_ACCESS_TOKEN"
|
||||
|
||||
$PetId = 987 # Int64 | ID of pet that needs to be updated
|
||||
$Name = "Name_example" # String | Updated name of the pet (optional)
|
||||
@@ -380,10 +380,10 @@ uploads an image
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
$Configuration.AccessToken = "YOUR_ACCESS_TOKEN"
|
||||
|
||||
$PetId = 987 # Int64 | ID of pet to update
|
||||
$AdditionalMetadata = "AdditionalMetadata_example" # String | Additional data to pass to server (optional)
|
||||
|
||||
@@ -67,12 +67,12 @@ Returns a map of status codes to quantities
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure API key authorization: api_key
|
||||
$Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY"
|
||||
$Configuration.ApiKey.api_key = "YOUR_API_KEY"
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
#$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer"
|
||||
|
||||
#$Configuration.ApiKeyPrefix.api_key = "Bearer"
|
||||
|
||||
|
||||
# Returns pet inventories by status
|
||||
@@ -158,7 +158,7 @@ Place an order for a pet
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Order = (Initialize-Order-Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -Status "Status_example" -Complete $false) # Order | order placed for purchasing the pet
|
||||
$Order = (Initialize-Order -Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -Status "placed" -Complete $false) # Order | order placed for purchasing the pet
|
||||
|
||||
# Place an order for a pet
|
||||
try {
|
||||
|
||||
@@ -27,14 +27,14 @@ This can only be done by the logged in user.
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure API key authorization: auth_cookie
|
||||
$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
|
||||
$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY"
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
|
||||
#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer"
|
||||
|
||||
|
||||
$User = (Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123) # User | Created user object
|
||||
$User = (Initialize-User -Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123) # User | Created user object
|
||||
|
||||
# Create user
|
||||
try {
|
||||
@@ -77,14 +77,14 @@ Creates list of users with given input array
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure API key authorization: auth_cookie
|
||||
$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
|
||||
$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY"
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
|
||||
#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer"
|
||||
|
||||
|
||||
$User = @((Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123)) # User[] | List of user object
|
||||
$User = @((Initialize-User -Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123)) # User[] | List of user object
|
||||
|
||||
# Creates list of users with given input array
|
||||
try {
|
||||
@@ -127,12 +127,12 @@ Creates list of users with given input array
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure API key authorization: auth_cookie
|
||||
$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
|
||||
$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY"
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
|
||||
|
||||
#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer"
|
||||
|
||||
$User = @() # User[] | List of user object
|
||||
|
||||
@@ -179,12 +179,12 @@ This can only be done by the logged in user.
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure API key authorization: auth_cookie
|
||||
$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
|
||||
$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY"
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
|
||||
|
||||
#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer"
|
||||
|
||||
$Username = "Username_example" # String | The name that needs to be deleted
|
||||
|
||||
@@ -317,12 +317,12 @@ Logs out current logged in user session
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure API key authorization: auth_cookie
|
||||
$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
|
||||
$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY"
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
|
||||
|
||||
#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer"
|
||||
|
||||
|
||||
# Logs out current logged in user session
|
||||
@@ -366,12 +366,12 @@ This can only be done by the logged in user.
|
||||
```powershell
|
||||
Import-Module -Name PSPetstore
|
||||
|
||||
$Configuration = Get-PSPetstoreConfiguration
|
||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||
$Configuration = Get-Configuration
|
||||
# Configure API key authorization: auth_cookie
|
||||
$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
|
||||
$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY"
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
|
||||
|
||||
#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer"
|
||||
|
||||
$Username = "Username_example" # String | name that need to be deleted
|
||||
$User = # User | Updated user object
|
||||
|
||||
Reference in New Issue
Block a user