[
https://issues.apache.org/jira/browse/ATLAS-4376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17404481#comment-17404481
]
ASF subversion and git services commented on ATLAS-4376:
--------------------------------------------------------
Commit d0d195cc0204e6c4fb1e87c9d758318eefb849e7 in atlas's branch
refs/heads/master from chaitali borole
[ https://gitbox.apache.org/repos/asf?p=atlas.git;h=d0d195c ]
ATLAS-4376: AtlasClientV2 getRelationshipDefByName does not work
Signed-off-by: Nikhil Bonte <[email protected]>
> AtlasClientV2 getRelationshipDefByName does not work
> ----------------------------------------------------
>
> Key: ATLAS-4376
> URL: https://issues.apache.org/jira/browse/ATLAS-4376
> Project: Atlas
> Issue Type: Improvement
> Affects Versions: 3.0.0
> Reporter: chaitali borole
> Assignee: chaitali borole
> Priority: Major
> Fix For: 3.0.0
>
>
> When tried to get the typedef of a relationship by:
> atlasClient.getRelationshipDefByName(name)
> This will get translated into the following REST request:
> /api/atlas/v2/types/structdef/name/
> {name}
> The correct REST request should be:
> /api/atlas/v2/types/relationshipdef/name/{name}
> The reason why it's querying a structdef and not a relationshipdef is due to
> a bug in AtlasClientV2 line 1135:
> } else if (AtlasStructDef.class.isAssignableFrom(typeDefClass)) {
> return "structdef";
> } else if (AtlasRelationshipDef.class.isAssignableFrom(typeDefClass)) {
> return "relationshipdef";
> Since AtlasRelationshipDef extends AtlasStructDef, the first "if" branch will
> always be true and the second "if" branch will never happen. The fix for this
> issue is to reverse the two "if" branches.
> provide test cases for all "if" branches to ensure the querying works
> correctly.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)