Project

Profile

Help

Issue #5562

api.json generation causes traceback

Added by bmbouter about 1 month ago. Updated about 12 hours ago.

Status:
MODIFIED
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Severity:
2. Medium
Version - Docker:
Platform Release:
Blocks Release:
Target Release - Docker:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 60

Description

I installed the latest pulp_docker against the latest pulpcore. When I didn't have pulp_docker installed the localhost:24817/pulp/api/v3/docs/ site just fine. Then after installing pulp_docker I get:

    operation = self.get_operation(view, path, prefix, method, components, request)
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/generators.py", line 454, in get_operation
    operation = view_inspector.get_operation(operation_keys)
  File "/home/vagrant/devel/pulpcore/pulpcore/app/openapigenerator.py", line 307, in get_operation
    responses = self.get_responses()
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/inspectors/view.py", line 180, in get_responses
    response_serializers = self.get_response_serializers()
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/inspectors/view.py", line 235, in get_response_serializers
    responses = self.get_default_responses()
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/inspectors/view.py", line 211, in get_default_responses
    default_schema = self.serializer_to_schema(default_schema) or ''
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/inspectors/base.py", line 446, in serializer_to_schema
    self.field_inspectors, 'get_schema', serializer, {'field_inspectors': self.field_inspectors}
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/inspectors/base.py", line 118, in probe_inspectors
    result = method(obj, **kwargs)
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/inspectors/field.py", line 42, in get_schema
    return self.probe_field_inspectors(serializer, openapi.Schema, self.use_definitions)
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/inspectors/base.py", line 238, in probe_field_inspectors
    swagger_object_type=swagger_object_type, use_references=use_references, **kwargs
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/inspectors/base.py", line 118, in probe_inspectors
    result = method(obj, **kwargs)
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/drf_yasg/inspectors/field.py", line 146, in field_to_swagger_object
    % (actual_serializer, this_serializer))
drf_yasg.errors.SwaggerGenerationError: Schema for <class 'pulp_docker.app.serializers.TagSerializer'> would override distinct serializer <class 'pulp_ansible.app.serializers.TagSerializer'> because they implicitly share the same ref_name; explicitly set the ref_name atribute on both serializers' Meta classes

Associated revisions

Revision b32da3bf View on GitHub
Added by ipanova@redhat.com about 1 month ago

Document explicit definition of ref_name on the serializer.

closes #5562
https://pulp.plan.io/issues/5562

Revision 8689733c View on GitHub
Added by ipanova@redhat.com about 1 month ago

Explicitly define ref_name on the serializer.

closes #5562
https://pulp.plan.io/issues/5562

Revision 8689733c View on GitHub
Added by ipanova@redhat.com about 1 month ago

Explicitly define ref_name on the serializer.

closes #5562
https://pulp.plan.io/issues/5562

History

#1 Updated by ipanova@redhat.com about 1 month ago

  • Status changed from NEW to POST
  • Assignee set to ipanova@redhat.com
  • Triaged changed from No to Yes
  • Sprint set to Sprint 60

#2 Updated by ipanova@redhat.com about 1 month ago

  • Status changed from POST to MODIFIED

Please register to edit this issue

Also available in: Atom PDF