Skip to content

Commit

Permalink
- code linting
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
  • Loading branch information
baywet committed May 10, 2024
1 parent 5654756 commit e0a7f92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Kiota.Builder/Extensions/OpenApiSchemaExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static IEnumerable<string> GetSchemaNames(this OpenApiSchema schema, bool
internal static IEnumerable<OpenApiSchema> FlattenSchemaIfRequired(this IList<OpenApiSchema> schemas, Func<OpenApiSchema, IList<OpenApiSchema>> subsequentGetter)
{
if (schemas is null) return [];
return schemas.Count == 1 && !schemas[0].Properties.Any() ?
return schemas.Count == 1 && !schemas[0].HasAnyProperty() ?
schemas.FlattenEmptyEntries(subsequentGetter, 1) :
schemas;
}
Expand Down Expand Up @@ -144,7 +144,7 @@ public static bool IsComposedEnum(this OpenApiSchema schema)
public static bool IsSemanticallyMeaningful(this OpenApiSchema schema, bool ignoreNullableObjects = false)
{
if (schema is null) return false;
return schema.Properties.Any() ||
return schema.HasAnyProperty() ||
schema.Enum is { Count: > 0 } ||
schema.Items != null ||
(!string.IsNullOrEmpty(schema.Type) &&
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/KiotaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ private CodeTypeBase CreateComposedModelDeclaration(OpenApiUrlTreeNode currentNo
if (typesCount == 1 && schema.Nullable && schema.IsInclusiveUnion() || // nullable on the root schema outside of anyOf
typesCount == 2 && (schema.AnyOf?.Any(static x => // nullable on a schema in the anyOf
x.Nullable &&
!x.Properties.Any() &&
!x.HasAnyProperty() &&
!x.IsExclusiveUnion() &&
!x.IsInclusiveUnion() &&
!x.IsInherited() &&
Expand Down

0 comments on commit e0a7f92

Please sign in to comment.