-
Notifications
You must be signed in to change notification settings - Fork 82
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
Openapi docs for File Upload routes #2299
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly have nitpicks.
responses: | ||
'200': | ||
description: Successful chunk upload | ||
'400': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add other responses?
I'm also assuming there's no 428 response anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
- $ref: '#/components/parameters/requestId' | ||
requestBody: | ||
required: true | ||
description: Information about the file to be uploaded. Minimum required fields are marked as required. Additional fields may be specified and are allowed. For information about the file itself, ECS.file paths are recommended. For archived files, information about the archive should be placed in `file`. Information about the archive members may be placed in a `contents` array. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the contents
array just an array of objects? Is there any definition for it anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I wasn't sure how much to explain.
The required fields are explicitly mapped. Everything else is unmapped, but dynamic: true
is set on the mapping. So integrations can just index whatever they want, in whatever format.
Considering zip/archive is a common use case, I wanted to suggest a convention (have file
describe the zip, and contents: [ {}, {}, {} ...]
describe the files inside). But it is not required, enforced, anything. Just a suggested convention.
The mappings are not shared between integrations, so any client can do what they want. That's why this isn't a very prescriptive definition
What is the problem this PR solves?
This is a followup PR to #1902 to add route documentation to the openapi spec
How to test this PR locally
You may be able to preview the generated output by pasting the contents of
model/openapi.yml
into the editor side of https://editor.swagger.io/