Skip to content

Commit

Permalink
add doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidfm committed Jan 30, 2024
1 parent 1d1197f commit 8879075
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,11 @@ func (t *Schema) structKeywordsFromTags(f reflect.StructField, parent *Schema, p
t.extraKeywords(extras)
}

func (t *Schema) parseValue(val string) (parsed interface{}, ok bool) {
// parseValue parses a string into a value matching the type of this schema.
// It is used to parse default and example values from a struct tag.
// If the string could be successfully parsed into the target type,
// the second return value will be set to true.
func (t *Schema) parseValue(val string) (any, bool) {
switch t.Type {
case "number":
return toJSONNumber(val)
Expand Down

0 comments on commit 8879075

Please sign in to comment.