Skip to content

Commit

Permalink
fix(openapi): fix lookupAspectSpec (datahub-project#10478)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored and sleeperdeep committed Jun 25, 2024
1 parent 813c3cf commit 9e24f77
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -768,11 +768,11 @@ public List<GenericEntity> toEntityListResponse(
* @return
*/
private static AspectSpec lookupAspectSpec(EntitySpec entitySpec, String aspectName) {
return Optional.ofNullable(entitySpec.getAspectSpec(aspectName))
.orElse(
entitySpec.getAspectSpecs().stream()
.filter(aspec -> aspec.getName().toLowerCase().equals(aspectName))
.findFirst()
.get());
return entitySpec.getAspectSpec(aspectName) != null
? entitySpec.getAspectSpec(aspectName)
: entitySpec.getAspectSpecs().stream()
.filter(aspec -> aspec.getName().toLowerCase().equals(aspectName))
.findFirst()
.get();
}
}

0 comments on commit 9e24f77

Please sign in to comment.