Files
qdrant/tests/openapi/test_validate_schema.py
Cursor Agent ecdf3a4ecb Migrate OpenAPI integration tests to /points/query
The deprecated /points/search, /points/recommend and /points/discover
endpoints (along with their /batch and /groups variants) were removed
from the OpenAPI spec, which caused validation failures in the Python
integration test harness.

This commit migrates the affected tests to the universal /points/query
endpoint:

- Delete tests dedicated to the deprecated endpoints:
  test_recommend.py, test_discover.py, test_multicollection_reco.py,
  test_recommendation_multivector.py
- Refactor remaining tests to call /points/query (and /query/batch,
  /query/groups), translating request bodies (vector -> query / using,
  positive/negative -> query.recommend, target/context -> query.discover)
  and unwrapping the new result.points response shape.
- Drop equivalence assertions against the now-removed legacy endpoints.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-20 10:07:34 +00:00

33 lines
1008 B
Python

from .helpers.helpers import request_with_validation
# validate that malformed conditions raise a JsonSchema ValidationError
def test_malformed_condition(collection_name):
# Should raise a ValidationError because the condition key is not defined
# see https://github.com/qdrant/qdrant/issues/1664
# with pytest.raises(jsonschema.exceptions.ValidationError):
malformed_condition(collection_name)
def malformed_condition(collection_name):
request_with_validation(
api='/collections/{collection_name}/points/query',
method="POST",
path_params={'collection_name': collection_name},
body={
"query": [0.2, 0.1, 0.9, 0.7],
"limit": 5,
"filter": {
"should": [
{
"undefined_condition_key": {
"key": "city"
}
}
]
},
"with_payload": True
}
)