-
Notifications
You must be signed in to change notification settings - Fork 11
feat(input_schema): Support default, prefill and example in sub-properties #555
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
Conversation
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.
Pull Request Overview
Adds support for default, prefill, and example on nested (sub-)properties in the input schema and extends array item validation to honor per-item constraints (pattern, min/max length, numeric bounds, etc.).
- Introduces prefill/example/default keywords across sub-schema definitions (string, enum, number, integer, boolean, object, resource, arrays) with nullable-aware default typing.
- Enhances array items schema to allow validation keywords for primitive item types (string/integer/number/boolean) and updates tests to cover string item validation.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/utilities.client.test.ts | Adds test ensuring array item constraints (pattern, min/max length, type) are validated. |
| test/input_schema.test.ts | Extends test schema to include nested defaults/prefills/examples for object and array sub-properties. |
| packages/json_schemas/schemas/input.schema.json | Adds prefill/example/default handling with nullable logic; replaces additionalProperties with unevaluatedProperties; extends array items schema to support validation keywords for primitive types. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
valekjo
left a comment
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.
Looks good. The schema is growing more than Apify :D
| "type": "object", | ||
| "properties": { | ||
| "type": { "enum": ["string", "integer", "boolean", "object", "array"] } | ||
| "type": { "enum": ["string", "integer", "number", "boolean", "object", "array"] } |
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.
Question: This is unrelated fix to allow floats, 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.
Yes, I forgot to add it here when adding float support
This PR:
Adds support for specifying
default,prefillandexamplefor sub-properties in input schema.Default would be:
{ "object": { "key1": "fromParent" } }Adds support for specifying validation keywords under
itemsproperty, like:This is handled automatically by
Ajv.