Skip to content

Commit a198d4a

Browse files
authored
Fix code review: use null format (not empty string) and fix XML doc href
1 parent 9d03ad3 commit a198d4a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Core/Services/OpenAPI/OpenApiDocumentor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,13 +1486,13 @@ private static OpenApiSchema CreateComponentSchema(
14861486
if (metadataProvider.TryGetBackingColumn(entityName, field, out string? backingColumnValue) && !string.IsNullOrEmpty(backingColumnValue))
14871487
{
14881488
string typeMetadata = string.Empty;
1489-
string formatMetadata = string.Empty;
1489+
string? formatMetadata = null;
14901490
string? fieldDescription = null;
14911491

14921492
if (dbObject.SourceDefinition.Columns.TryGetValue(backingColumnValue, out ColumnDefinition? columnDef))
14931493
{
14941494
typeMetadata = TypeHelper.GetJsonDataTypeFromSystemType(columnDef.SystemType).ToString().ToLower();
1495-
formatMetadata = TypeHelper.GetOpenApiFormatFromSystemType(columnDef.SystemType, columnDef.DbType) ?? string.Empty;
1495+
formatMetadata = TypeHelper.GetOpenApiFormatFromSystemType(columnDef.SystemType, columnDef.DbType);
14961496
}
14971497

14981498
if (entityConfig?.Fields != null)

src/Core/Services/TypeHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public static EdmPrimitiveTypeKind GetEdmPrimitiveTypeFromITypeNode(ITypeNode co
212212
/// </summary>
213213
/// <param name="type">CLR type</param>
214214
/// <param name="dbType">Optional DbType used to distinguish date-only (DbType.Date) from date-time types.</param>
215-
/// <seealso cref="https://spec.openapis.org/oas/v3.0.1#data-types"/>
215+
/// <seealso href="https://spec.openapis.org/oas/v3.0.1#data-types"/>
216216
/// <returns>OpenAPI format string (e.g. "date-time", "date", "time", "uuid", "byte"),
217217
/// or null if no standard format applies to the type.</returns>
218218
public static string? GetOpenApiFormatFromSystemType(Type type, DbType? dbType = null)

0 commit comments

Comments
 (0)