Skip to content

Say why pattern does not replace format on a date property - #1546

Open
OGsiji wants to merge 1 commit into
datacontract:mainfrom
OGsiji:docs-not-checked
Open

Say why pattern does not replace format on a date property#1546
OGsiji wants to merge 1 commit into
datacontract:mainfrom
OGsiji:docs-not-checked

Conversation

@OGsiji

@OGsiji OGsiji commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The docs changes from #1514.

pattern is not a substitute for format on a date property. The bullet listed format's string values (email, uuid, uri), so it reads as being about string formats — and there pattern genuinely does replace it. On a date, timestamp or time property format holds a date pattern such as yyyy-MM-dd, and pattern cannot stand in: by the time a check runs the column has been parsed as a date, so there is no string left to match. Someone following the current advice for a date column would write a pattern that never fires.

A pointer from the testing page. The list lives under Schema, which is where you look when authoring a contract. The moment you need it is different — you have declared something, it appears to do nothing, and you are looking at datacontract test. The properties bullet now links to it.

That is also the honest answer to where I searched: I came from the ODCS side tracing where a value ended up, not from the docs asking what gets checked, so I never searched for the list at all. The link is aimed at the person who would.

The bullet listed format's string values, so it read as being about string
formats, where pattern is a genuine substitute. On a date, timestamp or time
property format holds a date pattern instead, and pattern cannot stand in: the
column has been parsed as a date by the time a check runs, so there is no string
left to match.

The list is also reached from the testing page now. Someone wondering why a
declared option had no effect is looking at the test command, not the schema
reference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant