Skip to content

Conversation

habara-k
Copy link
Contributor

Description

This PR addresses a modification to the generator responsible for producing the Ruby SDK from OpenAPI definitions. Specifically, it introduces support for query parameters that include arrays.

Changes

Enhanced the generator to handle array-type query parameters.

Here is an example of how such an API call might look in a shell script:

curl -X GET "https://api.line.me/v2/bot/example?param=value1&param=value2"

Note

Currently, there are no endpoints that utilize such parameters. However, this update is a preparatory step for future API enhancements.

@habara-k
Copy link
Contributor Author

habara-k commented May 27, 2025

Code before the change

lib

# @param status [array<String>, nil] 
def get_resource_with_http_info(
  param: nil
)
  path = "/v2/bot/example"
  query_params = {
    "param": param
  }.compact
  # ...

sig

# @param param [array<String>, nil] 
def get_resource_with_http_info: (
  ?param: array<String>?
) -> (
  [GetResourceResponse, 200, Hash[untyped, untyped]] # when HTTP status code is 200
  | [String?, Integer, Hash[untyped, untyped]] # otherwise
)

Code after the change

lib

# @param param [Array[String], nil] 
def get_resource_with_http_info(
  param: nil 
)
  path = "/v2/bot/example"
  query_params = {
    "param": param&.join(',')
    
  }.compact
  # ...

sig

# @param param [Array[String], nil] 
def get_resource_with_http_info: (
  ?param: Array[String]?
) -> (
  [GetFollowersResponse, 200, Hash[untyped, untyped]] # when HTTP status code is 200
  | [String?, Integer, Hash[untyped, untyped]] # otherwise
)

@habara-k habara-k marked this pull request as ready for review June 9, 2025 03:11
@habara-k habara-k requested a review from a team June 9, 2025 03:11
@mokuzon
Copy link
Contributor

mokuzon commented Jun 9, 2025

Please add diff of generated codes.

@habara-k habara-k added this pull request to the merge queue Jun 10, 2025
Merged via the queue into line:master with commit bd829f5 Jun 10, 2025
6 checks passed
@habara-k habara-k deleted the fix-array-type-query-parameter branch June 10, 2025 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants