Skip to content

Commit 3d9bced

Browse files
committed
chore: Update the HAL client to return the current navigated document
1 parent 8d1bb05 commit 3d9bced

File tree

1 file changed

+7
-0
lines changed
  • core/pactbroker/src/main/kotlin/au/com/dius/pact/core/pactbroker

1 file changed

+7
-0
lines changed

core/pactbroker/src/main/kotlin/au/com/dius/pact/core/pactbroker/HalClient.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ interface IHalClient {
6363
*/
6464
fun linkUrl(name: String): String?
6565

66+
/**
67+
* Returns the current HAL document
68+
*/
69+
fun currentDoc(): JsonValue.Object?
70+
6671
/**
6772
* Calls the closure with a Map of attributes for all links associated with the link name
6873
* @param linkName Name of the link to loop over
@@ -251,6 +256,8 @@ open class HalClient @JvmOverloads constructor(
251256

252257
override fun navigate(link: String) = navigate(mapOf(), link)
253258

259+
override fun currentDoc() = pathInfo
260+
254261
override fun fetch(path: String) = fetch(path, true)
255262

256263
override fun fetch(path: String, encodePath: Boolean): Result<JsonValue.Object, Exception> {

0 commit comments

Comments
 (0)