Skip to content

Move input schema default / prefilling logic into the input_schema package #547

@vladfrangu

Description

@vladfrangu

Across several repos (to my current knowledge we have apify-core (?), apify-cli, and soon apify-sdk-js), we have duplicated code that deals with

  • parsing the input schema through our JSON schema of Actor input
  • figures out what fields have defaults and
  • prefills the input objects with the defaults that are missing.

This code duplication is no bueno, especially since changes that happen in one spot may not propagate to other places without someone looking into it, manually replicating the logic and testing it out.

Ideally, we would unify that logic into the input_schema package we already have, so that whichever project needs it can just import <whatever> from '@apify/shared-js/node' or similar and can just do it™️.

(related-ish: #537, as we should expose this in a /node export path for the shared-js package)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions