Project

Profile

Help

Issue #3622

swagger docs include semantic error

Added by jsherril@redhat.com over 1 year ago. Updated 6 months ago.

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

Description

When trying to generate an api bindings at http://editor.swagger.io/#/ i noticed:

Semantic error at definitions.Artifact.required.0
Read only properties cannot be marked as required by a schema.
Jump to line 1504

definitions:
Artifact:
required:
- file <--------------- THIS LINE
type: object
properties:

Associated revisions

Revision d6cea814 View on GitHub
Added by werwty over 1 year ago

Set parsers explicitly for Artifact Viewset

Uploading files cannot be done using JSON, this
disable support for the application/json media_type,
Because a file upload is required to create an artifact.

This does not need to be done for Remotes, because
files on a remote is optional.

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

Revision d6cea814 View on GitHub
Added by werwty over 1 year ago

Set parsers explicitly for Artifact Viewset

Uploading files cannot be done using JSON, this
disable support for the application/json media_type,
Because a file upload is required to create an artifact.

This does not need to be done for Remotes, because
files on a remote is optional.

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

Revision d6cea814 View on GitHub
Added by werwty over 1 year ago

Set parsers explicitly for Artifact Viewset

Uploading files cannot be done using JSON, this
disable support for the application/json media_type,
Because a file upload is required to create an artifact.

This does not need to be done for Remotes, because
files on a remote is optional.

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

History

#1 Updated by dalley over 1 year ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 36

#2 Updated by amacdona@redhat.com over 1 year ago

  • Triaged changed from Yes to No
  • Sprint deleted (Sprint 36)

Do we want to make file not read only or do we want to make it not required?

#3 Updated by amacdona@redhat.com over 1 year ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 36

#4 Updated by rchan over 1 year ago

  • Sprint changed from Sprint 36 to Sprint 37

#5 Updated by dalley over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley

#6 Updated by dalley over 1 year ago

@Austin I think it needs to be not read-only. I just don't understand why it is read-only, I don't see anything setting it to be such.

#7 Updated by dalley over 1 year ago

  • Status changed from ASSIGNED to NEW
  • Assignee deleted (dalley)

#8 Updated by bizhang over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bizhang

#9 Updated by dalley over 1 year ago

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#fixed-fields-13

Relevant only for Schema "properties" definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but MUST NOT be sent as part of the request. Properties marked as readOnly being true SHOULD NOT be in the required list of the defined schema. Default value is false

File def shouldn't be read-only

#10 Updated by bizhang over 1 year ago

  • Status changed from ASSIGNED to POST

This is an upstream issue: read_only is always set to true by drf_yasg.
I've opened a PR fixing this upstream: https://github.com/axnsan12/drf-yasg/pull/133
I will close this issue once this is merged and released.

#11 Updated by dalley over 1 year ago

Unrelated question, but what do we actually need our own FileField for? Does it accomplish something the DRF FileField doesn't?

https://github.com/pulp/pulp/blob/3.0-dev/pulpcore/pulpcore/app/serializers/fields.py#L20

#13 Updated by rchan over 1 year ago

  • Sprint changed from Sprint 37 to Sprint 38

#14 Updated by werwty over 1 year ago

  • Status changed from POST to MODIFIED

#15 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#16 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF