Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
irees committed Aug 27, 2024
1 parent 6fc2c35 commit 211389d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/docs/openapi3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1229,11 +1229,17 @@ func URIMapCache(reader ReadFromURIFunc) ReadFromURIFunc

type Ref struct {
Ref string `json:"$ref" yaml:"$ref"`
Extensions map[string]any `json:"extensions,omitempty" yaml:"$ref,omitempty"`
Extensions map[string]any `json:"-" yaml:"-"`
}
Ref is specified by OpenAPI/Swagger 3.0 standard. See
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#reference-object

func (x Ref) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding of Ref.

func (x Ref) MarshalYAML() (any, error)
MarshalYAML returns the YAML encoding of Ref.

func (e *Ref) Validate(ctx context.Context, opts ...ValidationOption) error
Validate returns an error if Extensions does not comply with the OpenAPI
spec.
Expand Down
2 changes: 1 addition & 1 deletion openapi3/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (x Ref) MarshalYAML() (any, error) {
return m, nil
}

// // MarshalJSON returns the JSON encoding of Ref.
// MarshalJSON returns the JSON encoding of Ref.
func (x Ref) MarshalJSON() ([]byte, error) {
y, err := x.MarshalYAML()
if err != nil {
Expand Down

0 comments on commit 211389d

Please sign in to comment.