Issue #3622
closedswagger docs include semantic error
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:
Updated by dalley over 6 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 36
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?
Updated by amacdona@redhat.com over 6 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 36
Updated by dalley over 6 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dalley
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.
Updated by dalley over 6 years ago
- Status changed from ASSIGNED to NEW
- Assignee deleted (
dalley)
Updated by bizhang over 6 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to bizhang
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
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.
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
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.
Updated by werwty over 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|d6cea814783c40598b9472595eed344b54d7898c.
Updated by bmbouter about 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
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