mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 06:17:06 +00:00
Codegen parameter for query json serialization (#21718)
* Add endpoints with query parameters that require Json-serialization * Add property for query json-serialization * Update samples * Adjust indentation for specification
This commit is contained in:
committed by
GitHub
parent
6ff9e67bad
commit
8874df4702
@@ -79,6 +79,7 @@ Class | Method | HTTP request | Description
|
||||
*QueryApi* | [**Test-QueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#Test-QueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
|
||||
*QueryApi* | [**Test-QueryStyleFormExplodeTrueObject**](docs/QueryApi.md#Test-QueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
|
||||
*QueryApi* | [**Test-QueryStyleFormExplodeTrueObjectAllOf**](docs/QueryApi.md#Test-QueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
|
||||
*QueryApi* | [**Test-QueryStyleJsonSerializationObject**](docs/QueryApi.md#Test-QueryStyleJsonSerializationObject) | **GET** /query/style_jsonSerialization/object | Test query parameter(s)
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
@@ -14,6 +14,7 @@ Method | HTTP request | Description
|
||||
[**Test-QueryStyleFormExplodeTrueArrayString**](QueryApi.md#Test-QueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
|
||||
[**Test-QueryStyleFormExplodeTrueObject**](QueryApi.md#Test-QueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
|
||||
[**Test-QueryStyleFormExplodeTrueObjectAllOf**](QueryApi.md#Test-QueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
|
||||
[**Test-QueryStyleJsonSerializationObject**](QueryApi.md#Test-QueryStyleJsonSerializationObject) | **GET** /query/style_jsonSerialization/object | Test query parameter(s)
|
||||
|
||||
|
||||
<a id="Test-EnumRefString"></a>
|
||||
@@ -465,3 +466,51 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a id="Test-QueryStyleJsonSerializationObject"></a>
|
||||
# **Test-QueryStyleJsonSerializationObject**
|
||||
> String Test-QueryStyleJsonSerializationObject<br>
|
||||
> [-JsonSerializedObjectRefStringQuery] <PSCustomObject><br>
|
||||
> [-JsonSerializedObjectArrayRefStringQuery] <PSCustomObject[]><br>
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
```powershell
|
||||
$Category = Initialize-Category -Id 1 -Name "Dogs"
|
||||
$Tag = Initialize-Tag -Id 0 -Name "MyName"
|
||||
$Pet = Initialize-Pet -Id 10 -Name "doggie" -Category $Category -PhotoUrls "MyPhotoUrls" -Tags $Tag -Status "available" # Pet | (optional)
|
||||
# Pet[] | (optional)
|
||||
|
||||
# Test query parameter(s)
|
||||
try {
|
||||
$Result = Test-QueryStyleJsonSerializationObject -JsonSerializedObjectRefStringQuery $JsonSerializedObjectRefStringQuery -JsonSerializedObjectArrayRefStringQuery $JsonSerializedObjectArrayRefStringQuery
|
||||
} catch {
|
||||
Write-Host ("Exception occurred when calling Test-QueryStyleJsonSerializationObject: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**JsonSerializedObjectRefStringQuery** | [**Pet**](Pet.md)| | [optional]
|
||||
**JsonSerializedObjectArrayRefStringQuery** | [**Pet[]**](Pet.md)| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -787,3 +787,86 @@ function Test-QueryStyleFormExplodeTrueObjectAllOf {
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
.DESCRIPTION
|
||||
|
||||
No description available.
|
||||
|
||||
.PARAMETER JsonSerializedObjectRefStringQuery
|
||||
No description available.
|
||||
|
||||
.PARAMETER JsonSerializedObjectArrayRefStringQuery
|
||||
No description available.
|
||||
|
||||
.PARAMETER WithHttpInfo
|
||||
|
||||
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
|
||||
|
||||
.OUTPUTS
|
||||
|
||||
String
|
||||
#>
|
||||
function Test-QueryStyleJsonSerializationObject {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
|
||||
[PSCustomObject]
|
||||
${JsonSerializedObjectRefStringQuery},
|
||||
[Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
|
||||
[PSCustomObject[]]
|
||||
${JsonSerializedObjectArrayRefStringQuery},
|
||||
[Switch]
|
||||
$WithHttpInfo
|
||||
)
|
||||
|
||||
Process {
|
||||
'Calling method: Test-QueryStyleJsonSerializationObject' | Write-Debug
|
||||
$PSBoundParameters | Out-DebugParameter | Write-Debug
|
||||
|
||||
$LocalVarAccepts = @()
|
||||
$LocalVarContentTypes = @()
|
||||
$LocalVarQueryParameters = @{}
|
||||
$LocalVarHeaderParameters = @{}
|
||||
$LocalVarFormParameters = @{}
|
||||
$LocalVarPathParameters = @{}
|
||||
$LocalVarCookieParameters = @{}
|
||||
$LocalVarBodyParameter = $null
|
||||
|
||||
$Configuration = Get-Configuration
|
||||
# HTTP header 'Accept' (if needed)
|
||||
$LocalVarAccepts = @('text/plain')
|
||||
|
||||
$LocalVarUri = '/query/style_jsonSerialization/object'
|
||||
|
||||
if ($JsonSerializedObjectRefStringQuery) {
|
||||
$LocalVarQueryParameters['json_serialized_object_ref_string_query'] = $JsonSerializedObjectRefStringQuery
|
||||
}
|
||||
|
||||
if ($JsonSerializedObjectArrayRefStringQuery) {
|
||||
$LocalVarQueryParameters['json_serialized_object_array_ref_string_query'] = $JsonSerializedObjectArrayRefStringQuery
|
||||
}
|
||||
|
||||
$LocalVarResult = Invoke-ApiClient -Method 'GET' `
|
||||
-Uri $LocalVarUri `
|
||||
-Accepts $LocalVarAccepts `
|
||||
-ContentTypes $LocalVarContentTypes `
|
||||
-Body $LocalVarBodyParameter `
|
||||
-HeaderParameters $LocalVarHeaderParameters `
|
||||
-QueryParameters $LocalVarQueryParameters `
|
||||
-FormParameters $LocalVarFormParameters `
|
||||
-CookieParameters $LocalVarCookieParameters `
|
||||
-ReturnType "String" `
|
||||
-IsBodyNullable $false
|
||||
|
||||
if ($WithHttpInfo.IsPresent) {
|
||||
return $LocalVarResult
|
||||
} else {
|
||||
return $LocalVarResult["Response"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user