Skip to content

Commit

Permalink
add doc comment on the Templated field
Browse files Browse the repository at this point in the history
  • Loading branch information
yitsushi committed May 7, 2024
1 parent 5ead753 commit 9dc90cc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ import "net/http"

// LinkInfo represents a link to a resource.
type LinkInfo struct {
Method string `json:"method"`
Href string `json:"href"`
Comment string `json:"comment"`
Templated bool `json:"templated,omitempty"`
Method string `json:"method"`
Href string `json:"href"`
Comment string `json:"comment"`
// Templated marks the link as a template, so the client can identify a link
// as a template and they don't try to call the endpoint as it is presented.
//
// This field is defined in the draft RFC in section 5.2:
// https://datatracker.ietf.org/doc/html/draft-kelly-json-hal#section-5.2
Templated bool `json:"templated,omitempty"`
}

// LinkOption is used to register links in a LinkRegistry. Urls may contain
Expand Down

0 comments on commit 9dc90cc

Please sign in to comment.