-
Notifications
You must be signed in to change notification settings - Fork 9.1k
feat(oas31): add support for file upload #10335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Conclusion is a bit falsy. We don't care about the value of
Conclusion is a bit falsy. Here we don't create about the value for sure.
This depends on the pattern matching of
That's fine.
Yeah this is an obvious bug.
|
Execution planWe'll introduce proper support for OpenAPI upload in 3 layers. Layer 1Fix the current code so that
We should compare the
So instead of doing: if(
contentType === "application/octet-stream"
|| contentType.indexOf("image/") === 0
|| contentType.indexOf("audio/") === 0
|| contentType.indexOf("video/") === 0
...
) { We should be doing: if(
contentType.startsWith("application/octet-stream")
|| contentType.startsWith("image/")
|| contentType.startsWith("audio/")
|| contentType.startsWith("video/")
...
) { We should access the JSON Schema Layer 2This layer is OpenAPI 3.1.x specific and modifies Layer 3Handling of new Rules (assuming
There is an ambiguous case for rule 5. |
Related to OpenAPI 3.1.x.
We should now display file input when:
contentEncoding
isbase64
contentMediaType
isapplication/octet-stream
,image/*
,video/*
oraudio/*
Does not add support for file upload if schema has union type or if
type
andcontentEncoding/contentMediaType
are defined inoneOf/anyOf
.base64
vsbyte
Refs #9278
Attribution: @glowcloud