From b436522ffe56b15722a11c6dd71d47798c6d39f9 Mon Sep 17 00:00:00 2001 From: martinforejt Date: Fri, 19 Dec 2025 14:35:22 +0100 Subject: [PATCH 1/2] docs: Deprecation of `patternKey` and `patternValue` in input schema --- .../input_schema/specification.md | 114 +++++++++++++++--- 1 file changed, 99 insertions(+), 15 deletions(-) diff --git a/sources/platform/actors/development/actor_definition/input_schema/specification.md b/sources/platform/actors/development/actor_definition/input_schema/specification.md index 9d8d43153..074e988b6 100644 --- a/sources/platform/actors/development/actor_definition/input_schema/specification.md +++ b/sources/platform/actors/development/actor_definition/input_schema/specification.md @@ -439,8 +439,6 @@ Properties: | Property | Value | Required | Description | |------------------------|----------------------------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `editor` | One of | Yes | UI editor used for input. | -| `patternKey` | String | No | Regular expression that will be used
to validate the keys of the object. | -| `patternValue` | String | No | Regular expression that will be used
to validate the values of object. | | `maxProperties` | Integer | No | Maximum number of properties
the object can have. | | `minProperties` | Integer | No | Minimum number of properties
the object can have. | | `nullable` | Boolean | No | Specifies whether null is
an allowed value. | @@ -448,6 +446,8 @@ Properties: | `properties` | Object | No | Defines the sub-schema properties for the object used for validation and UI rendering (`schemaBased` editor). See more info below. | | `additionalProperties` | Boolean | No | Controls if sub-properties not listed in `properties` are allowed. Defaults to `true`. Set to `false` to make requests with extra properties fail. | | `required` | String array | No | An array of sub-properties keys that are required.
Note: This applies only if the object field itself is present. If the object field is optional and not included in the input, its required subfields are not validated. | +| `patternKey` | String | No | *Deprecated* (see [more information](#deprecated-properties)).
Regular expression that will be used to validate the keys of the object. | +| `patternValue` | String | No | *Deprecated* (see [more information](#deprecated-properties)).
Regular expression that will be used to validate the values of object. | #### Object fields validation @@ -643,19 +643,19 @@ Rendered input: Properties: -| Property | Value | Required | Description | -|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `editor` | One of | Yes | UI editor used for input. | -| `placeholderKey` | String | No | Placeholder displayed for
key field when no value is specified.
Works only with `keyValue` editor. | -| `placeholderValue` | String | No | Placeholder displayed in value field
when no value is provided.
Works only with `keyValue` and
`stringList` editors. | -| `patternKey` | String | No | Regular expression that
will be used to validate
the keys of items in the array.
Works only with `keyValue`
editor. | -| `patternValue` | String | No | Regular expression that
will be used to validate the values
of items in the array.
Works only with `keyValue` and
`stringList` editors. | -| `maxItems` | Integer | No | Maximum number of items
the array can contain. | -| `minItems` | Integer | No | Minimum number of items
the array can contain. | -| `uniqueItems` | Boolean | No | Specifies whether the array
should contain only unique values. | -| `nullable` | Boolean | No | Specifies whether null is
an allowed value. | -| `items` | object | No | Specifies format of the items of the array, useful mainly for multiselect and for `schemaBased` editor (see below). | -| `isSecret` | Boolean | No | Specifies whether the input field will be stored encrypted. Only available with `json` and `hidden` editors. | +| Property | Value | Required | Description | +|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `editor` | One of | Yes | UI editor used for input. | +| `placeholderKey` | String | No | Placeholder displayed for
key field when no value is specified.
Works only with `keyValue` editor. | +| `placeholderValue` | String | No | Placeholder displayed in value field
when no value is provided.
Works only with `keyValue` and
`stringList` editors. | +| `maxItems` | Integer | No | Maximum number of items
the array can contain. | +| `minItems` | Integer | No | Minimum number of items
the array can contain. | +| `uniqueItems` | Boolean | No | Specifies whether the array
should contain only unique values. | +| `nullable` | Boolean | No | Specifies whether null is
an allowed value. | +| `items` | object | No | Specifies format of the items of the array, useful mainly for multiselect and for `schemaBased` editor (see below). | +| `isSecret` | Boolean | No | Specifies whether the input field will be stored encrypted. Only available with `json` and `hidden` editors. | +| `patternKey` | String | No | *Deprecated* - see [migration guide](#deprecated-properties) for alternatives.
Regular expression that will be used to validate the keys of items in the array.
Works only with `keyValue`
editor. | +| `patternValue` | String | No | *Deprecated* - see [migration guide](#deprecated-properties) for alternatives.
Regular expression that will be used to validate the values of items in the array.
Works only with `keyValue` and
`stringList` editors. | Usage of this field is based on the selected editor: @@ -976,3 +976,87 @@ This setting defines runtime access only and doesn't change field visibility or ::: + +### Deprecation of `patternKey` and `patternValue` + +The following properties are deprecated and will be removed in a future version: + +- `patternKey` - Used to validate keys in objects and arrays +- `patternValue` - Used to validate values in objects and arrays + +We are deprecating these properties to better align with the JSON schema specification. The current approach with `patternKey` and `patternValue` is Apify-specific and doesn't follow standard JSON schema validation patterns. By moving to standard JSON schema, we provide a more consistent experience that matches industry standards while enabling more powerful validation capabilities through the ability to define sub-properties. + +#### Alternatives for arrays + +For arrays, you can replace `patternKey` and `patternValue` by using the `items` property with a subschema. + +Example of replacing `patternValue` for an array of strings: + +```json title="Old approach with patternValue" +{ + "title": "Tags", + "type": "array", + "description": "Enter tags", + "editor": "stringList", + "patternValue": "^[a-zA-Z0-9-_]+$" +} +``` + +```json title="New approach with items subschema" +{ + "title": "Tags", + "type": "array", + "description": "Enter tags", + "editor": "stringList", + "items": { + "type": "string", + "pattern": "^[a-zA-Z0-9-_]+$" + } +} +``` + +Example of replacing both `patternKey` and `patternValue` for an array with key-value pairs: + +```json title="Old approach with patternKey and patternValue" +{ + "title": "Headers", + "type": "array", + "description": "HTTP headers", + "editor": "keyValue", + "patternKey": "^[a-zA-Z0-9-]+$", + "patternValue": "^.+$" +} +``` + +```json title="New approach with items subschema" +{ + "title": "Headers", + "type": "array", + "description": "HTTP headers", + "editor": "keyValue", + "items": { + "type": "object", + "properties": { + "key": { + "title": "Name", + "type": "string", + "description": "Header name", + "pattern": "^[a-zA-Z0-9-]+$" + }, + "value": { + "title": "Value", + "type": "string", + "description": "Header value", + "pattern": "^.+$" + } + }, + "required": ["key", "value"] + } +} +``` + +#### Alternatives for objects + +For objects, there is currently no direct replacement for `patternKey` and `patternValue` properties. These validation features will not be supported in future versions. + +If you need to validate object properties, consider using a predefined schema with the `properties` field instead of allowing arbitrary properties with validation patterns. From 1c7b4450e7d055ca31e60ca39395b2b54190c8a0 Mon Sep 17 00:00:00 2001 From: martinforejt Date: Fri, 19 Dec 2025 14:46:07 +0100 Subject: [PATCH 2/2] add due date --- .../actor_definition/input_schema/specification.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/platform/actors/development/actor_definition/input_schema/specification.md b/sources/platform/actors/development/actor_definition/input_schema/specification.md index 074e988b6..9d56123db 100644 --- a/sources/platform/actors/development/actor_definition/input_schema/specification.md +++ b/sources/platform/actors/development/actor_definition/input_schema/specification.md @@ -979,10 +979,12 @@ This setting defines runtime access only and doesn't change field visibility or ### Deprecation of `patternKey` and `patternValue` -The following properties are deprecated and will be removed in a future version: +::::warning Deprecation notice +**The following properties are deprecated and will continue to be supported until May 31, 2026:** - `patternKey` - Used to validate keys in objects and arrays - `patternValue` - Used to validate values in objects and arrays +:::: We are deprecating these properties to better align with the JSON schema specification. The current approach with `patternKey` and `patternValue` is Apify-specific and doesn't follow standard JSON schema validation patterns. By moving to standard JSON schema, we provide a more consistent experience that matches industry standards while enabling more powerful validation capabilities through the ability to define sub-properties.