-
Notifications
You must be signed in to change notification settings - Fork 76
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
docs: add resourceType property to support storage picker #1261
Conversation
@@ -409,3 +409,41 @@ Editor type `select` allows the user to pick items from a select, providing mult | |||
``` | |||
|
|||
To correctly define options for multiselect, you need to define the `items` property and then provide values and (optionally) labels in `enum` and `enumTitles` properties. | |||
|
|||
### Resource |
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.
Why not "Resource type" ?
|
||
### Resource | ||
|
||
The Resource property enables Actor users to select different types of resources. |
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.
I'd say that:
Resource type identifies what kind of object is referred to in the input field. For example, a the Key-value store resource type can be referred to using a string ID.
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.
I am missing info what is the returned value in a case of an array vs string. There is screenshot only for string. I'd also improve the wording there mentioning that the return value is the resource ID itself.
Otherwise good to go after the other comments are fixed.
I update it based on @jancurn comments and try to better mention that the return value is the resource ID: |
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.
Just one question. Since these docs already mention, that we support arrays too. Are you planning to update the resource picker in UI to support arrays?
If not then we should not mention arrays until we actually decide that we want to implement them.
Yeah I have almost done it in UI too |
I assume we don't allowed both string and array at the same time, that the input type can be just one of them. Right? |
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.
It looks all ok to me!
One small thing to consider: adding context to the terms "object" and "resource" where possible makes it easier to understand they are related to Apify's architecture and not just a "resource" or "object" from the generic programming or integration/API domain language.
sources/platform/actors/development/actor_definition/input_schema/specification.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/input_schema/specification.md
Outdated
Show resolved
Hide resolved
…ema/specification.md Co-authored-by: Adam Kliment <79609+netmilk@users.noreply.github.com>
…ema/specification.md Co-authored-by: Adam Kliment <79609+netmilk@users.noreply.github.com>
Update of input schema based on apify/apify-docs#1261: New properties in schema: `resourceProperty` and `resourceArrayProperty` To distinguish between resource properties with `resourceType` and string/array properties custom validation is done in `validateField` (because of clash on same `type`) Input ui to support this schmena is ready here: apify/apify-core#18093
Proposal of new input schema property
resourceType
(based on https://apify.slack.com/archives/C01VBUV81UZ/p1729081102142439?thread_ts=1728031818.871689&cid=C01VBUV81UZ) which will solve the needs of storages picker (https://github.com/apify/apify-core/issues/12871)As I already verified, in ajv schema there would be two new top level properties
resourceProperty
andresourceArrayProperty
, ajv can distinguish between these andstringProperty
witharrayProperty
based on the requiredresourceType
property. Theeditor
property is optional with default value ofresourcePicker
.Input schema PR will come when this one is approved.
The description is tightly connected with storages even though later the
resourceType
should support other types of resources, but for now I think it's ok like this.Preview of docs: