Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterJSONTagNameFormatter ¶
func RegisterJSONTagNameFormatter() string
RegisterJSONTagNameFormatter sets a custom tag name function for JSON binding validation.
This function configures the validator to use the `json` struct tag as the field name when returning validation errors. Specifically, it affects the output of FieldError.Field(), so that it returns the JSON field name (e.g., `title`) instead of the Go struct field name (e.g., `Title`).
This improves the clarity of validation error messages when working with JSON APIs.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.