apify-sdk-js icon indicating copy to clipboard operation
apify-sdk-js copied to clipboard

Support input schema defaults in `Actor.getInput()`

Open B4nan opened this issue 2 years ago • 2 comments

Currently, the input schema is ignored locally, and to respect the defaults inside it, you need to use the Apify CLI to run the actor, which creates the INPUT.json file based on those defaults when missing.

Implement input schema support on the SDK level, so this works on the fly if the INPUT.json file is missing. If it's there, we should still fill in the missing fields that have defaults in the input schema.

The goal of this PR is to unify the local vs platform behavior. As a nice side effect, there shouldn't be any need to use the Apify CLI to run the actor, as npm start should behave the same with this implemented.

B4nan avatar Feb 28 '24 15:02 B4nan

Defaults and prefil, no? In fact, I am not sure, let's discuss that on Slack.

mtrunkat avatar Feb 29 '24 07:02 mtrunkat

The idea is to align behavior with the platform without the need for apify run, I am never sure about default vs prefill :]

B4nan avatar Feb 29 '24 08:02 B4nan