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:
Mattias Sehlstedt
2025-08-10 16:47:51 +02:00
committed by GitHub
parent 6ff9e67bad
commit 8874df4702
75 changed files with 4461 additions and 2 deletions

View File

@@ -111,6 +111,7 @@ Class | Method | HTTP request | Description
*OpenapiClient::QueryApi* | [**test_query_style_form_explode_true_array_string**](docs/QueryApi.md#test_query_style_form_explode_true_array_string) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
*OpenapiClient::QueryApi* | [**test_query_style_form_explode_true_object**](docs/QueryApi.md#test_query_style_form_explode_true_object) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
*OpenapiClient::QueryApi* | [**test_query_style_form_explode_true_object_all_of**](docs/QueryApi.md#test_query_style_form_explode_true_object_all_of) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
*OpenapiClient::QueryApi* | [**test_query_style_json_serialization_object**](docs/QueryApi.md#test_query_style_json_serialization_object) | **GET** /query/style_jsonSerialization/object | Test query parameter(s)
## Documentation for Models

View File

@@ -14,6 +14,7 @@ All URIs are relative to *http://localhost:3000*
| [**test_query_style_form_explode_true_array_string**](QueryApi.md#test_query_style_form_explode_true_array_string) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
| [**test_query_style_form_explode_true_object**](QueryApi.md#test_query_style_form_explode_true_object) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
| [**test_query_style_form_explode_true_object_all_of**](QueryApi.md#test_query_style_form_explode_true_object_all_of) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) |
| [**test_query_style_json_serialization_object**](QueryApi.md#test_query_style_json_serialization_object) | **GET** /query/style_jsonSerialization/object | Test query parameter(s) |
## test_enum_ref_string
@@ -685,3 +686,71 @@ No authorization required
- **Content-Type**: Not defined
- **Accept**: text/plain
## test_query_style_json_serialization_object
> String test_query_style_json_serialization_object(opts)
Test query parameter(s)
Test query parameter(s)
### Examples
```ruby
require 'time'
require 'openapi_client'
api_instance = OpenapiClient::QueryApi.new
opts = {
json_serialized_object_ref_string_query: OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}), # Pet |
json_serialized_object_array_ref_string_query: [OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']})] # Array<Pet> |
}
begin
# Test query parameter(s)
result = api_instance.test_query_style_json_serialization_object(opts)
p result
rescue OpenapiClient::ApiError => e
puts "Error when calling QueryApi->test_query_style_json_serialization_object: #{e}"
end
```
#### Using the test_query_style_json_serialization_object_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> <Array(String, Integer, Hash)> test_query_style_json_serialization_object_with_http_info(opts)
```ruby
begin
# Test query parameter(s)
data, status_code, headers = api_instance.test_query_style_json_serialization_object_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => String
rescue OpenapiClient::ApiError => e
puts "Error when calling QueryApi->test_query_style_json_serialization_object_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **json_serialized_object_ref_string_query** | [**Pet**](.md) | | [optional] |
| **json_serialized_object_array_ref_string_query** | [**Array&lt;Pet&gt;**](Pet.md) | | [optional] |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain

View File

@@ -637,5 +637,68 @@ module OpenapiClient
end
return data, status_code, headers
end
# Test query parameter(s)
# Test query parameter(s)
# @param [Hash] opts the optional parameters
# @option opts [Pet] :json_serialized_object_ref_string_query
# @option opts [Array<Pet>] :json_serialized_object_array_ref_string_query
# @return [String]
def test_query_style_json_serialization_object(opts = {})
data, _status_code, _headers = test_query_style_json_serialization_object_with_http_info(opts)
data
end
# Test query parameter(s)
# Test query parameter(s)
# @param [Hash] opts the optional parameters
# @option opts [Pet] :json_serialized_object_ref_string_query
# @option opts [Array<Pet>] :json_serialized_object_array_ref_string_query
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def test_query_style_json_serialization_object_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: QueryApi.test_query_style_json_serialization_object ...'
end
# resource path
local_var_path = '/query/style_jsonSerialization/object'
# query parameters
query_params = opts[:query_params] || {}
query_params[:'json_serialized_object_ref_string_query'] = opts[:'json_serialized_object_ref_string_query'] if !opts[:'json_serialized_object_ref_string_query'].nil?
query_params[:'json_serialized_object_array_ref_string_query'] = @api_client.build_collection_param(opts[:'json_serialized_object_array_ref_string_query'], :csv) if !opts[:'json_serialized_object_array_ref_string_query'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'String'
# auth_names
auth_names = opts[:debug_auth_names] || []
new_options = opts.merge(
:operation => :"QueryApi.test_query_style_json_serialization_object",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: QueryApi#test_query_style_json_serialization_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end