snok / drf-openapi-tester

Test utility for validating OpenAPI documentation
https://github.com/snok/django-openapi-tester
BSD 3-Clause "New" or "Revised" License
119 stars 23 forks source link

example of failing test on related_field #287

Open darduf opened 1 year ago

darduf commented 1 year ago

In relation to this issue - where schema tester was failing with an UndocumentedSchemaSectionError on our OAS definitions that uses DRF JSON:API RelationshipView

We would expect the schema tester to successfully index /api/pet/{petId}/relationships/owner/

FAILED tests/test_django_framework.py::PetsAPITests::test_create_pet_owner_relationship - openapi_tester.exceptions.UndocumentedSchemaSectionError: Error: Unsuccessfully tried to index the OpenAPI schema by `/api/pet/{petId}/relationships/{relatedField}/`. 

Undocumented route /api/pet/{petId}/relationships/{relatedField}/.

Documented routes: /api/pet/
    • /api/pet/findByStatus/
    • /api/pet/findByTags/
    • /api/pet/{petId}/
    • /api/pet/{petId}/relationships/owner/
    • /api/pet/{petId}/uploadImage/
    • /api/store/inventory/
    • /api/store/order/
    • /api/store/order/{orderId}/
    • /api/user/
    • /api/user/createWithList/
    • /api/user/login/
    • /api/user/logout/
    • /api/user/{username}/

739a3b16459378d9a9aeba3a111702fa95f5f72f replicates the issue we are seeing