mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add API docs for uploads and API doc watcher (#15387)
This commit adds API documentation for the new upload endpoints related to direct + multipart external uploads. Also included is a rake task which watches the files in the spec/requests/api directory and calls a script file (spec/regenerate_swagger_docs) whenever one changes. This script runs rake rswag:specs:swaggerize and then copies the openapi.yml file over to the discourse_api_docs repo directory, and hits a script there to convert the YML to JSON so the API docs are refreshed while the server is still running. This makes the loop of making a doc change and seeing it in the local server much faster. The rake task is rake autospec:swagger
This commit is contained in:
@@ -74,6 +74,18 @@ def api_docs_description
|
||||
HEREDOC
|
||||
end
|
||||
|
||||
def direct_uploads_disclaimer
|
||||
<<~HEREDOC
|
||||
You must have the correct permissions and CORS settings configured in your
|
||||
external provider. We support AWS S3 as the default. See:
|
||||
|
||||
https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4.
|
||||
|
||||
An external file store must be set up and `enable_direct_s3_uploads` must
|
||||
be set to true for this endpoint to function.
|
||||
HEREDOC
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
# Specify a root folder where Swagger JSON files are generated
|
||||
# NOTE: If you're using the rswag-api to serve API descriptions, you'll need
|
||||
|
||||
Reference in New Issue
Block a user