Skip to content

Commit

Permalink
chore: refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Oct 10, 2024
1 parent 9608682 commit b3e1552
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv
}

// Nullable properties are marked with the keyword nullable and a value of true.
// oneOf and anyOf don't have type, so they can't be set to nullable, entries are nullable
schema.Nullable = schema.AnyOf == null && schema.OneOf == null && primitiveType.IsNullable;
// nullable cannot be true when type is empty, often common in anyof/allOf since individual entries are nullable
schema.Nullable = !string.IsNullOrEmpty(schema.Type) && primitiveType.IsNullable;
}

return schema;
Expand Down

0 comments on commit b3e1552

Please sign in to comment.