Skip to content

Conversation

@mfori
Copy link
Member

@mfori mfori commented Nov 11, 2025

Solves https://github.com/apify/apify-core/issues/24101 - adds support for enumSuggestedValues property, that can be used instead of enum and it:

  • wouldn't trigger enum validation, value can be anything
  • would be used only on FE to render select which would accept inserting custom value

I put this to stringProperty, accepting now select editor (only if enumSuggestedValues is specified), because it supports also other validation keywords (pattern,...) which makes totally sense to put another constraints on the custom value. (But there's no reason to allow these additional validation keywords when using enum.)

Other things works still the same

  • enum can be defined only if editor is not defined or is select
  • enumSuggestedValues can be defined only if editor is select.
  • only one of enum or enumSuggestedValues can (must) be defined if editor is select
  • it works the same for arrays

Draft with changes to make this work in UI is ready here: https://github.com/apify/apify-core/pull/24164

@mfori mfori self-assigned this Nov 11, 2025
@mfori mfori added the t-console Issues with this label are in the ownership of the console team. label Nov 11, 2025
@github-actions github-actions bot added this to the 127th sprint - Console team milestone Nov 11, 2025
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Nov 11, 2025
@mfori mfori marked this pull request as ready for review November 12, 2025 10:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the enumSuggestedValues property to input schemas, providing an alternative to enum that allows custom values while providing UI suggestions.

Key changes:

  • Added enumSuggestedValues property that acts as UI hints without enforcing validation
  • Extended stringProperty and subSchemaStringProperty to support editor: 'select' with enumSuggestedValues
  • Updated arrayItemsSelect to support either enum or enumSuggestedValues (mutually exclusive)
  • Comprehensive test coverage for both string and array properties with various edge cases

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
test/input_schema.test.ts Added 13 comprehensive test cases covering enumSuggestedValues usage with string and array properties, validation of mutual exclusivity with enum, and editor requirements
packages/json_schemas/schemas/input.schema.json Added select editor support to stringProperty and subSchemaStringProperty with conditional enumSuggestedValues requirement; updated arrayItemsSelect to use oneOf for enum/enumSuggestedValues exclusivity; reordered editor enums consistently
packages/input_schema/src/types.ts Added enumSuggestedValues property to StringFieldDefinition type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-console Issues with this label are in the ownership of the console team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant