mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-11 08:52:58 +00:00
fix(openapi): fix lookupAspectSpec (#10478)
This commit is contained in:
parent
fe33ce7ce6
commit
de01634815
@ -768,11 +768,11 @@ public class EntityController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private static AspectSpec lookupAspectSpec(EntitySpec entitySpec, String aspectName) {
|
private static AspectSpec lookupAspectSpec(EntitySpec entitySpec, String aspectName) {
|
||||||
return Optional.ofNullable(entitySpec.getAspectSpec(aspectName))
|
return entitySpec.getAspectSpec(aspectName) != null
|
||||||
.orElse(
|
? entitySpec.getAspectSpec(aspectName)
|
||||||
entitySpec.getAspectSpecs().stream()
|
: entitySpec.getAspectSpecs().stream()
|
||||||
.filter(aspec -> aspec.getName().toLowerCase().equals(aspectName))
|
.filter(aspec -> aspec.getName().toLowerCase().equals(aspectName))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.get());
|
.get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user