Say why pattern does not replace format on a date property - #1546
Open
OGsiji wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The docs changes from #1514.
patternis not a substitute forformaton a date property. The bullet listedformat's string values (email,uuid,uri), so it reads as being about string formats — and therepatterngenuinely does replace it. On adate,timestamportimepropertyformatholds a date pattern such asyyyy-MM-dd, andpatterncannot 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 apatternthat 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. Thepropertiesbullet 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.