Skip to content

Conversation

mfori
Copy link
Member

@mfori mfori commented Oct 7, 2025

Float number input property in input schema

This adds support for number with floating point typed properties in input schema.

"integerProperty": {
  "title": "Integer property",
  "description": "Accept only integers",
  "type": "integer",
  "editor": "number"
},
"numberProperty": {
  "title": "Number property",
  "description": "Accepts float numbers too",
  "type": "number",
  "editor": "number",
}
  • Ajv handles this natively without any change as it's aligned with JSON schema spec.
  • Editor stays the same ("number") for both, and based on the field type we can decide whether to allow floating points or not in UI field
  • Our input UI handles it with just a small change, PR draft ready: https://github.com/apify/apify-core/pull/23530

@mfori mfori self-assigned this Oct 7, 2025
@mfori mfori added the t-console Issues with this label are in the ownership of the console team. label Oct 7, 2025
@github-actions github-actions bot added this to the 125th sprint - Console team milestone Oct 7, 2025
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Oct 7, 2025
@mfori mfori changed the title feat(json_schemas): Number input property in input schema feat(json_schemas): (float) number input property in input schema Oct 8, 2025
@mfori mfori marked this pull request as ready for review October 8, 2025 14:56
Copy link

@Copilot 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 floating-point number properties in input schemas, distinguishing between integer (whole numbers only) and number (includes floating-point values) types while maintaining the same "number" editor for both.

Key changes:

  • Added number type alongside existing integer type in JSON schema definitions
  • Updated test cases to validate number vs integer type behavior
  • Enhanced schema validation to support number-specific properties and constraints

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/json_schemas/schemas/input.schema.json Added numberProperty definition and updated type enums to include "number"
test/input_schema_definition.test.ts Added comprehensive tests for number vs integer validation and constraints
test/input_schema.test.ts Updated existing tests to include number type in valid type arrays
test/utilities.client.test.ts Added integration tests for number/integer field validation with AJV

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@jancurn jancurn left a comment

Choose a reason for hiding this comment

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

Looks good to me (from a super-quick look)

@mfori mfori merged commit a216094 into master Oct 14, 2025
9 checks passed
@mfori mfori deleted the feat/number-input-property branch October 14, 2025 10:04
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.

4 participants