httpclient-interception icon indicating copy to clipboard operation
httpclient-interception copied to clipboard

Add [StringSyntax] attributes

Open martincostello opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

A new attribute, [StringSyntax], is being added to .NET 7 that allows tools such as Visual Studio to provide syntax highlighting etc. for string variables that expect certain formats (JSON, URI, XML, Regex).

Describe the solution you'd like

Add [StringSyntax] to all methods where it would be appropriate. Examples include:

URI

https://github.com/justeat/httpclient-interception/blob/961bfc07a358f58ed2d1af6dace413ef826470e7/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs#L224

Describe alternatives you've considered

None.

Additional context

Unless Visual Studio supports consuming the attribute by name rather than the concrete type, this would only work for .NET 7+.

martincostello avatar May 13 '22 09:05 martincostello

This should work downlevel if an attribute with the same name is included as an internal implementation detail: https://github.com/dotnet/runtime/issues/62505#issuecomment-1044637548

martincostello avatar May 17 '22 09:05 martincostello

Resolved by #402.

martincostello avatar Nov 15 '22 13:11 martincostello