Closed swetabar closed 1 week ago
This PR will trigger a patch release when merged.
Nice idea using the importConfiguration for the default/fallback options 👍. I wonder if we want to, eventually, provide a fallback for each option param, or if having those defaults set on the content scraper side will suffice? (Just a thought — no immediate change required)
Agreed. Having a fallback for each option param sounds good. We can make that once once we have a confirmed set of option attributes.
:tada: This PR is included in version 1.47.1 :tada:
The release is available on:
v1.47.1
Your semantic-release bot :package::rocket:
Description The options object is an optional property in the JSON request body, but currently it is required in order to start a new import job.
To Reproduce
$ curl -v -H "x-api-key: $SPACECAT_API_KEY" -H "x-import-api-key: $IMPORT_API_KEY" -H "Content-Type: application/json" \ --request POST --data '{ "urls": ["https://www.test.com/page1.html", "https://www.test.com/page2.html"] }' \ https://spacecat.experiencecloud.live/api/ci/tools/import ... < HTTP/2 500 ... < x-error: Invalid options: undefined
Expected behavior An import job should be able to be created without this object, and the default values for all options should be assumed in its absence.
Solution We allow the end user to start a new import job without the
options
attribute. In case, the end user does not provide the options property, its default value is picked up from theIMPORT_CONFIGURATION
environment variable.Related Issues
353