Skip to content

Commit 31baff7

Browse files
authored
docs: updates to formatting (#1638)
add new headings and items to right side toc
1 parent f7c6887 commit 31baff7

File tree

1 file changed

+20
-11
lines changed
  • sources/platform/actors/development/actor_definition/input_schema

1 file changed

+20
-11
lines changed

sources/platform/actors/development/actor_definition/input_schema/specification.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Specification
33
sidebar_position: 2
44
description: Learn how to define and validate a schema for your Actor's input with code examples. Provide an autogenerated input UI for your Actor's users.
55
slug: /actors/development/actor-definition/input-schema/specification/v1
6+
toc_max_heading_level: 5
67
---
78

89
# Actor input schema specification
@@ -148,6 +149,8 @@ Most types also support additional properties defining, for example, the UI inpu
148149

149150
### String
150151

152+
#### Code input
153+
151154
Example of a code input:
152155

153156
```json
@@ -164,6 +167,8 @@ Rendered input:
164167

165168
![Apify Actor input schema page function](./images/input-schema-page-function.png)
166169

170+
#### Country selection
171+
167172
Example of country selection using a select input:
168173

169174
```json
@@ -182,6 +187,8 @@ Rendered input:
182187

183188
![Apify Actor input schema - country input](./images/input-schema-country.png)
184189

190+
#### `datepicker` editor
191+
185192
Example of date selection using absolute and relative `datepicker` editor:
186193

187194
```json
@@ -224,6 +231,8 @@ The `anyDate` property renders a date picker that accepts both absolute and rela
224231

225232
![Apify Actor input schema - country input](./images/input-schema-date-both.png)
226233

234+
#### `fileupload` editor
235+
227236
The `fileupload` editor enables users to specify a file as input. The input is passed to the Actor as a string. It is the Actor author's responsibility to interpret this string, including validating its existence and format.
228237

229238
![Apify Actor input schema - fileupload input](./images/input-schema-fileupload-input.png)
@@ -234,17 +243,17 @@ The user provides either a URL or uploads the file to a key-value store (existin
234243

235244
Properties:
236245

237-
| Property | Value | Required | Description |
238-
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
239-
| `editor` | One of <ul><li>`textfield`</li><li>`textarea`</li><li>`javascript`</li><li>`python`</li><li>`select`</li><li>`datepicker`</li><li>`fileupload`</li><li>`hidden`</li></ul> | Yes | Visual editor used for <br/>the input field. |
240-
| `pattern` | String | No | Regular expression that will be <br/>used to validate the input. <br/> If validation fails, <br/>the Actor will not run. |
241-
| `minLength` | Integer | No | Minimum length of the string. |
242-
| `maxLength` | Integer | No | Maximum length of the string. |
243-
| `enum` | [String] | Required if <br/>`editor` <br/>is `select` | Using this field, you can limit values <br/>to the given array of strings. <br/>Input will be displayed as select box. |
244-
| `enumTitles` | [String] | No | Titles for the `enum` keys described. |
245-
| `nullable` | Boolean | No | Specifies whether `null` <br/>is an allowed value. |
246-
| `isSecret` | Boolean | No | Specifies whether the input field<br />will be stored encrypted.<br />Only available <br />with `textfield` and `textarea` editors. |
247-
| `dateType` | One of <ul><li>`absolute`</li><li>`relative`</li><li>`absoluteOrRelative`</li></ul> | No | This property, which is only available with `datepicker` editor, specifies what date format should visual editor accept (The JSON editor accepts any string without validation.).<br/><br/><ul><li>`absolute` value enables date input in `YYYY-MM-DD` format. To parse returned string regex like this can be used: `^(\d{4})-(0[1-9]\|1[0-2])-(0[1-9]\|[12]\d\|3[01])$`.</li><br/><li>`relative` value enables relative date input in <br/>`{number} {unit}` format. <br/>Supported units are: days, weeks, months, years.<br/><br/>The input is passed to the Actor as plain text (e.g., "3 weeks"). To parse it, regex like this can be used: `^(\d+)\s*(day\|week\|month\|year)s?$`.</li><br/><li>`absoluteOrRelative` value enables both absolute and relative formats and user can switch between them. It's up to Actor author to parse a determine actual used format - regexes above can be used to check whether the returned string match one of them.</li></ul><br/>Defaults to `absolute`. |
246+
| Property | Value | Required | Description |
247+
|----------|--------|-----------|-------------|
248+
| `editor` | One of:<br/>- `textfield`<br/>- `textarea`<br/>- `javascript`<br/>- `python`<br/>- `select`<br/>- `datepicker`<br/>- `fileupload`<br/>- `hidden` | Yes | Visual editor used for the input field. |
249+
| `pattern` | String | No | Regular expression that will be used to validate the input. If validation fails, the Actor will not run. |
250+
| `minLength` | Integer | No | Minimum length of the string. |
251+
| `maxLength` | Integer | No | Maximum length of the string. |
252+
| `enum` | [String] | Required if `editor` is `select` | Using this field, you can limit values to the given array of strings. Input will be displayed as select box. |
253+
| `enumTitles` | [String] | No | Titles for the `enum` keys described. |
254+
| `nullable` | Boolean | No | Specifies whether `null` is an allowed value. |
255+
| `isSecret` | Boolean | No | Specifies whether the input field will be stored encrypted. Only available with `textfield` and `textarea` editors. |
256+
| `dateType` | One of <ul><li>`absolute`</li><li>`relative`</li><li>`absoluteOrRelative`</li></ul> | No | This property, which is only available with `datepicker` editor, specifies what date format should visual editor accept (The JSON editor accepts any string without validation.).<br/><br/><ul><li>`absolute` value enables date input in `YYYY-MM-DD` format. To parse returned string regex like this can be used: `^(\d{4})-(0[1-9]\|1[0-2])-(0[1-9]\|[12]\d\|3[01])$`.</li><br/><li>`relative` value enables relative date input in <br/>`{number} {unit}` format. <br/>Supported units are: days, weeks, months, years.<br/><br/>The input is passed to the Actor as plain text (e.g., "3 weeks"). To parse it, regex like this can be used: `^(\d+)\s*(day\|week\|month\|year)s?$`.</li><br/><li>`absoluteOrRelative` value enables both absolute and relative formats and user can switch between them. It's up to Actor author to parse a determine actual used format - regexes above can be used to check whether the returned string match one of them.</li></ul><br/>Defaults to `absolute`. |
248257

249258
:::note Regex escape
250259

0 commit comments

Comments
 (0)