Skip to content

Commit

Permalink
Fixes an issue extending relationship archetypes.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Feb 20, 2025
1 parent d9a6f1c commit a3af931
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1361,12 +1361,11 @@ private Archetype getArchetype(String archetypeType, String archetypeName) {

private void extendArchetype(Archetype archetype, String archetypeName) {
archetypeName = archetypeName.toLowerCase();
Archetype parentArchetype = archetypes.get(archetype.getType()).get(archetypeName);
if (parentArchetype != null) {
archetype.setDescription(parentArchetype.getDescription());
archetype.setTechnology(parentArchetype.getTechnology());
archetype.addTags(parentArchetype.getTags().toArray(new String[0]));
}
Archetype parentArchetype = getArchetype(archetype.getType(), archetypeName);

archetype.setDescription(parentArchetype.getDescription());
archetype.setTechnology(parentArchetype.getTechnology());
archetype.addTags(parentArchetype.getTags().toArray(new String[0]));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,7 @@ void test_archetypesForExtension() throws Exception {
assertEquals("Makes API calls to", r.getDescription());
assertEquals("HTTPS", r.getTechnology());
assertTrue(r.hasTag("Default Tag"));
assertTrue(r.hasTag("Synchronous"));
assertTrue(r.hasTag("HTTPS"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ workspace {
tag "Default Tag"
}

https = -> {
sync = -> {
tag "Synchronous"
}

https = --sync-> {
technology "HTTPS"
tag "HTTPS"
}
Expand Down

0 comments on commit a3af931

Please sign in to comment.