Add missing q in endpoints. Changes in utils.py #5431
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Summary
Hello team. This PR includes multiple changes to the
q
parameter. There have also been many things that, after researching and developing them, we have decided not to include. The summary list of changes is:q
now does not split strings by commas. It still accepts lists and dictionaries as before.filter_array_by_query
(used insideprocess_array()
) now accepts nested values like in the WazuhDBQuery class.q
can now be used on 14 extra endpoints.q
have been added.Future changes
After comparing and investigating multiple solutions, we may add the parameter q as body in future changes. In this way, any query could be inserted without coding it, such as:
We also find it interesting to use a new format that makes the query parameter easier to understand and more flexible. An example would be:
However, OpenAPI 3.0.0 (the latest version and the one we are using right now) does not support the use of body on endpoints with the GET or HEAD method. For this reason, we may rethink using it when OA version 3.1.0 is released: OAI/OpenAPI-Specification#1937
Tests
(There is an error related with an incorrect rule in the ruleset)
Kind regards,
Selu.