Skip to content

Commit

Permalink
chore: Update the HAL client to return the current navigated document
Browse files Browse the repository at this point in the history
  • Loading branch information
uglyog authored and rholshausen committed Nov 24, 2022
1 parent 02ee591 commit c869852
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ interface IHalClient {
*/
fun linkUrl(name: String): String?

/**
* Returns the current HAL document
*/
fun currentDoc(): JsonValue.Object?

/**
* Calls the closure with a Map of attributes for all links associated with the link name
* @param linkName Name of the link to loop over
Expand Down Expand Up @@ -251,6 +256,8 @@ open class HalClient @JvmOverloads constructor(

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

override fun currentDoc() = pathInfo

override fun fetch(path: String) = fetch(path, true)

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

0 comments on commit c869852

Please sign in to comment.