Skip to content

Commit

Permalink
fix(entity-registry): Fixed issue where the custom defined aspects we…
Browse files Browse the repository at this point in the history
…re missing from the API specification. (#10208)
  • Loading branch information
ajoymajumdar authored Apr 4, 2024
1 parent 0949d8c commit 4925968
Show file tree
Hide file tree
Showing 4 changed files with 594 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ project.ext.externalDependency = [
'springActuator': "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion",
'swaggerAnnotations': 'io.swagger.core.v3:swagger-annotations:2.2.15',
'swaggerCli': 'io.swagger.codegen.v3:swagger-codegen-cli:3.0.46',
'swaggerCore': 'io.swagger.core.v3:swagger-core:2.2.7',
'springBootAutoconfigureJdk11': 'org.springframework.boot:spring-boot-autoconfigure:2.7.18',
'testng': 'org.testng:testng:7.8.0',
'testContainers': 'org.testcontainers:testcontainers:' + testContainersVersion,
Expand Down
6 changes: 6 additions & 0 deletions entity-registry/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,11 @@ dependencies {
testAnnotationProcessor externalDependency.lombok
testImplementation externalDependency.classGraph

testImplementation externalDependency.swaggerCore
testImplementation spec.product.pegasus.dataAvro
testImplementation('io.acryl:json-schema-avro:0.2.2') {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
}

}
compileTestJava.dependsOn tasks.getByPath(':entity-registry:custom-test-model:modelDeploy')
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ public MergedEntityRegistry apply(EntityRegistry patchEntityRegistry)
validationResult.validationFailures.stream().collect(Collectors.joining("\n"))));
}

// Merge Aspect Specs
// (Fixed issue where custom defined aspects are not included in the API specification.)
//
if (!patchEntityRegistry.getAspectSpecs().isEmpty()) {
_aspectNameToSpec.putAll(patchEntityRegistry.getAspectSpecs());
}

// Merge Entity Specs
for (Map.Entry<String, EntitySpec> e2Entry : patchEntityRegistry.getEntitySpecs().entrySet()) {
if (entityNameToSpec.containsKey(e2Entry.getKey())) {
Expand Down
Loading

0 comments on commit 4925968

Please sign in to comment.