Skip to content

docs: improve type safety in custom validator documentation#66889

Open
MeAkib wants to merge 1 commit intoangular:mainfrom
MeAkib:#66887
Open

docs: improve type safety in custom validator documentation#66889
MeAkib wants to merge 1 commit intoangular:mainfrom
MeAkib:#66887

Conversation

@MeAkib
Copy link
Contributor

@MeAkib MeAkib commented Feb 3, 2026

Replace field: any with proper SchemaPath typing in Signal Forms custom validation examples to match built-in validator patterns.

fixes: #66887

Replace `field: any` with proper SchemaPath typing in Signal Forms custom
validation examples to match built-in validator patterns.

fixes: angular#66887
@pullapprove pullapprove bot requested a review from josephperrott February 3, 2026 16:44
@angular-robot angular-robot bot added the area: docs Related to the documentation label Feb 3, 2026
@ngbot ngbot bot added this to the Backlog milestone Feb 3, 2026
Comment on lines +498 to +501
function url<TValue extends string, TPathKind extends PathKind = PathKind.Root>(
path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,
options?: {message?: string},
) {
Copy link
Member

Choose a reason for hiding this comment

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

Any reason for not going with following?

Suggested change
function url<TValue extends string, TPathKind extends PathKind = PathKind.Root>(
path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,
options?: {message?: string},
) {
function url(
path: SchemaPath<string>,
options?: {message?: string},
) {

@josephperrott josephperrott removed their request for review February 3, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signal Form Docs about custom validation function: Please avoid any in examples (if possible)

2 participants