Skip to content

Commit d47928a

Browse files
committed
improve comments
1 parent 351eb9d commit d47928a

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

path_item.go

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func (p *PathItem) Operations(yield func(string, *Operation) bool) {
9393
}
9494

9595
// SetOperation sets the operation for the given method.
96+
// The method is case-insensitive.
9697
func (p *PathItem) SetOperation(method string, op *Operation) {
9798
switch strings.ToUpper(method) {
9899
case http.MethodGet:

path_items.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
type PathItems map[string]*PathItemRef
1313

14+
// Validate checks that all keys and values are valid.
1415
func (ps PathItems) Validate() error {
1516
for name, p := range ps.ByIndex() {
1617
if err := validateKey(name); err != nil {

path_parsed.go

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type ParsedPath struct {
1515
VariableNames []string
1616
}
1717

18+
// Parse parses the path, returning a ParsedPath which includes a format specifier (see [fmt]) and a list of all variable names in order.
1819
func (path Path) Parse() ParsedPath {
1920
p := ParsedPath{}
2021

ref.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type referencable[T any] interface {
4343
*T
4444
}
4545

46-
// refOrValue is a reference to a component.
46+
// refOrValue is a reference to a component or the component itself.
4747
type refOrValue[T any, O referencable[T]] struct {
4848
// The referenced object.
4949
Value O `json:",inline" yaml:",inline"`

0 commit comments

Comments
 (0)