Checking the Queyr API iI found we have:
Execute stored query: POST /query/{qualified_query_name}/{version}
with optional {version}
https://specifications.openehr.org/releases/ITS-REST/latest/query.html#query-execute-query-post-1
And Execute ad-hoc query: POST /query/aql
https://specifications.openehr.org/releases/ITS-REST/latest/query.html#query-execute-query-post
The issue is: the second is a special case of the first one, when the {quelified_name} is aql
and {version} is not present.
How does a server differentiate one from the other? The first idea is because the stored query execution doesn’t have a body, which IMO is a little obscure. Personally I would suggest both endpoints don’t have overlapping cases, for instance, having a different paths for ad-hoc and stored queries.
What do you think?