-
Notifications
You must be signed in to change notification settings - Fork 300
Incompatibility with Django Rest Swagger when using RelationshipView #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I got it to work. Basically, the solution to the above was implementing custom content negotiation. I basically cloned Django Rest Framework's Then I included the following in the
Custom
|
Sorry. Though custom content negotiation did allow Django Rest Swagger to properly render the API (with The incompatibility described in the first comment persists. I could swear it worked yesterday but when I tried again this morning, the same exception occurred. I can't seam to grasp what might have happened. But the fact is, the exception is still there, when I include |
Related to #315. |
@sliverc, @leifurhauks: Does this check for django-rest-framework-json-api/rest_framework_json_api/serializers.py Lines 30 to 36 in db5cd72
In testing with forthcoming DRF 3.10's generateschema, this throws this error which looks basically the same as the issue with older django-rest-swagger (not surprisingly):
Here's the stack frame when breakpoint on L33:
|
Even if though OPTIONS error is fixed by #633, Django REST Swagger will not currently generate a correct JSONAPI schema as it is just calling DRF's schema generator which returns a coreapi schema. See #604 which addresses this using DRF's forthcoming switch over to OpenAPI 3.0 schema support and JSONAPI extension of that being added to DJA. |
Closing in favor of #604 |
Hi.
Thanks for this library. It works great.
I'm trying to get it to work with Django Rest Swagger but error message
Exception Value: ResourceIdentifierObjectsSerializer must be initialized with a model class.
keeps coming up. You'll find the traceback below.This is happening at this piece of code:
Important points:
url
trick as pointed out in DJA documentation to show the self URL.Can anyone help shed some light into this?
EDIT:
After taking out the
RelationshipView
s from the api url patterns, it worked. So, it would seem theRelationshipView
is where incompatibility with Django Rest Swagger resides. Keeping theurl
field does not result in an exception.Thanks
The text was updated successfully, but these errors were encountered: