`file` shoud be an accepted primitive data type in swagger 2.0 spec
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 228
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 48
Description
Describe the bug
See https://swagger.io/specification/v2/#specification, Section Data types.
An additional primitive data type "file" is used by the Parameter Object and the Response Object to set the parameter type or the response as being a file.
It seems this file data type exception is not accounted for Response object.
To Reproduce
Steps to reproduce the behavior:
openapi lint --format stylish spec.yml
Expected behavior
No spec error should be raised.
Logs
spec.yml:
28:19 error spec `type` can be one of the following only: "object", "array", "string", "number", "integer", "boolean", "null".
3:1 warning info-license Info object should contain `license` field.
20:5 warning operation-operationId Operation object should contain `operationId` field.
24:7 warning operation-4xx-response Operation must have at least one `4xx` response.
OpenAPI definition
swagger: "2.0"
info:
title: API
version: 0.0.1
description: |
API
host: swagger.petstore
schemes:
- https
basePath: /api/v1
consumes:
- application/json
produces:
- application/json; charset=utf-8
paths:
/foo:
get:
summary: foo
produces:
- application/octet-stream
responses:
200:
description: txt file
schema:
type: file
openapi-cli Version(s)
redocly/openapi-cli:v1.0.0-beta.80 container
Node.js Version(s)
See above.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported error with the Swagger 2.0 specification shown in the issue and trace the openapi lint validation of the Response Object schema. Done means a response schema using type: file passes without the reported type error, while the existing warnings remain as appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100