mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-02 19:58:59 +00:00
fix(openapi): fix lookupAspectSpec (#10478)
This commit is contained in:
parent
fe33ce7ce6
commit
de01634815
@ -768,11 +768,11 @@ public class EntityController {
|
||||
* @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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user