Project

Profile

Help

Issue #3622

closed

swagger docs include semantic error

Added by jsherril@redhat.com over 6 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 38
Quarter:

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:

Actions #1

Updated by dalley over 6 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 36
Actions #2

Updated by amacdona@redhat.com over 6 years 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?

Actions #3

Updated by amacdona@redhat.com over 6 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 36
Actions #4

Updated by rchan over 6 years ago

  • Sprint changed from Sprint 36 to Sprint 37
Actions #5

Updated by dalley over 6 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley
Actions #6

Updated by dalley over 6 years 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.

Actions #7

Updated by dalley over 6 years ago

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

Updated by bizhang over 6 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bizhang
Actions #9

Updated by dalley over 6 years 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

Actions #10

Updated by bizhang over 6 years 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.

Actions #11

Updated by dalley over 6 years 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

Added by werwty over 6 years ago

Revision d6cea814 | View on GitHub

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

Added by werwty over 6 years ago

Revision d6cea814 | View on GitHub

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

Actions #13

Updated by rchan over 6 years ago

  • Sprint changed from Sprint 37 to Sprint 38
Actions #14

Updated by werwty over 6 years ago

  • Status changed from POST to MODIFIED
Actions #15

Updated by daviddavis over 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #16

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)
Actions #17

Updated by bmbouter almost 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF