-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support nested query params #66
Comments
paulsturgess
added a commit
that referenced
this issue
Aug 20, 2024
Currently the schema generation will throw an error if the Apia API declare nested query params. Full details are explained in: #66 This PR just omits nested params from the schema generation so that it can continue to generate.
I tried adding support for nested query params. The Ruby generated client will support it ok. But the jane-php client throws an error:
The change I made to try it was in if child_arg.type.argument_set?
schema = generate_schema_ref(child_arg)
else
schema = generate_scalar_schema(child_arg)
end The schema was updated like this as an example: "parameters": [
{
"name": "address_list[id]",
"in": "query",
"schema": {
"type": "string"
},
"description": "The address list to return. All 'address_list[]' params are mutually exclusive, only one can be provided."
},
{
"name": "address_list[annotation]",
"in": "query",
"schema": {
"$ref": "#/components/schemas/KeyValue"
},
"description": "The address list to return. All 'address_list[]' params are mutually exclusive, only one can be provided."
}
],
...
"KeyValue": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key"
]
}, The Ruby client then allowed me to do this: KatapultAPI.configure do |config|
config.access_token = ENV['KATAPULT_ACCESS_TOKEN']
config.host = 'http://katapult-api.localhost/'
config.scheme = 'http'
end
api_instance = KatapultAPI::CoreApi.new
result = api_instance.get_address_list({ address_list_annotation: { key: 'test.io/something', value: 'abc' } })
puts result.inspect In RapidAPI we can build a nested query string like this: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the schema will throw an error if we declare an argument for a
LookupArgumentSet
that points to anotherArgumentSet
.This allows us to support nested query params:
For example:
Currently we only support
string
as a valid type an argument of LookupArgumentSet.The text was updated successfully, but these errors were encountered: