Fix concept-code lookups containing slashes

Merged
KO
1mo ago
+45-6

Summary

  • percent-encode vocabulary IDs and concept codes as individual URL path segments
  • preserve slash-containing ICD-O codes such as 8032/3 as a single route parameter
  • cover synchronous and asynchronous clients with regression tests

Validation

  • uv run --extra dev pytest tests/unit/resources/test_concepts.py -q (40 passed)
  • uv run --extra dev ruff check src/ tests/unit/resources/test_concepts.py
  • uv run --extra dev ruff format --check src/ tests/unit/resources/test_concepts.py
  • uv run --extra dev mypy src/omophub

Summary by cubic

Fixes concept lookups so codes containing slashes, like ICD-O 8032/3, are sent as one URL path segment instead of being split into multiple parameters.

  • Percent-encodes vocabulary IDs and concept codes in get_by_code for both sync and async clients.
  • Clarifies in the docstrings that vocabulary_id and concept_code must be raw, URL-unencoded values.
  • Adds regression tests covering slash-containing codes for both clients.