-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesgood first issueGood for newcomers.Good for newcomers.help wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
StringSyntaxAttribute is placed on strings to tell tooling what format the string will take. For example, regex, JSON, XML, date format string, etc. This is then used to provide helpful features such as completion of date format strings, regex/JSON/XML highlighting, analyzers, etc.
We should ensure all the ASP.NET Core strings have this attribute where appropriate, so ASP.NET Core APIs get tooling enhancements.
Describe the solution you'd like
Audit dotnet/aspnetcore source and add StringSyntax attribute with format strings as needed:
- CompositeFormat - The syntax identifier for strings containing composite formats for string formatting.
- DateOnlyFormat - The syntax identifier for strings containing date format specifiers.
- DateTimeFormat - The syntax identifier for strings containing date and time format specifiers.
- EnumFormat - The syntax identifier for strings containing enum format specifiers.
- GuidFormat - The syntax identifier for strings containing GUID format specifiers.
- Json - The syntax identifier for strings containing JavaScript Object Notation (JSON).
- NumericFormat - The syntax identifier for strings containing numeric format specifiers.
- Regex - The syntax identifier for strings containing regular expressions. feat : Add
StringSyntaxfor regex parameters #40589 - TimeOnlyFormat - The syntax identifier for strings containing time format specifiers.
- TimeSpanFormat - The syntax identifier for strings containing TimeSpan format specifiers.
- Uri - The syntax identifier for strings containing URIs.
- Xml - The syntax identifier for strings containing XML.
I expect many of these won't have any usage - e.g. the format strings (except CompositeFormat) - but we should have Regex, Uri, Json and Xml.
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesgood first issueGood for newcomers.Good for newcomers.help wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue