Is there an existing issue for this?
Describe the bug
While playing around moving the applying of validation attributes to a transformer I found this curious part:
else if (attribute is UrlAttribute)
{
schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString();
schema[OpenApiSchemaKeywords.FormatKeyword] = "uri";
}
This forces the type to be "string" always.
The UrlAttribute only works on strings so it would never be the wrong type, so it doesn't need to be "forced" to a string.
Commenting this line still passes all the tests and emits the correct openapi, both for nullable and not nullable strings.
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
.NET 10 RC1
Anything else?
It's a one line change and some tests which can be added to OpenApiSchemaService.PropertySchemas.cs.
I can pick this up this week.
Is there an existing issue for this?
Describe the bug
While playing around moving the applying of validation attributes to a transformer I found this curious part:
This forces the type to be "string" always.
The UrlAttribute only works on strings so it would never be the wrong type, so it doesn't need to be "forced" to a string.
Commenting this line still passes all the tests and emits the correct openapi, both for nullable and not nullable strings.
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
.NET 10 RC1
Anything else?
It's a one line change and some tests which can be added to
OpenApiSchemaService.PropertySchemas.cs.I can pick this up this week.