GitHub user ahgittin opened a pull request:
https://github.com/apache/brooklyn-server/pull/927
Bundle type endpoint
It was noted that if the same type is defined in two different bundles, the
API does not let you distinguish between the two. This adds
`/catalog/bundles/{symbolicName}/{version}/types/{typeSymbolicName}/{typeVersion}`
to resolve that. (It also adds the two immediate ancestor paths, with
`../types` listing types in the bundle and `../types/{typeSymbolicName}` giving
`TypeDetail` assuming `typeVersion==version`).
It also adds a bunch of tests for behaviour when adding the same type ID:
```
testAddSameTypeTwiceInSameBundle_SilentlyDeduped()
testAddSameTypeTwiceInSameBundleDifferentDisplayName_LastOneWins()
testAddSameTypeTwiceInSameBundleDifferentDefinition_Disallowed()
testAddSameTypeTwiceInDifferentBundleDifferentDefinition_Disallowed()
testAddSameTypeTwiceInDifferentBundleSameDefinition_AllowedAndApiMakesTheDifferentOnesClear()
```
the final test above fails after the first commit but is fixed by the
second commit here, by changing the type's `self` link to use the unambiguous
`bundles/.../types/...` endpoint.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ahgittin/brooklyn-server bundle-type-endpoint
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-server/pull/927.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #927
----
commit 2b5e55a0465071a0592889bfe24520d0440effa5
Author: Alex Heneveld <alex.heneveld@...>
Date: 2018-01-05T12:24:36Z
rest tests for same types added
commit 93b2b99a0cd1806e511a79eb479c92118a6b71a4
Author: Alex Heneveld <alex.heneveld@...>
Date: 2018-01-05T13:12:10Z
adds bundle-specific type endpoint
and fixes test for self link distinguishing between same type id in
different bundles
----
---