Documentation comments on tags. #1634
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds comprehensive JSDoc documentation to all validation tag types in the
src/tags
directory. The new comments explain the purpose, usage, and examples for each tag, improving code readability and making it easier for developers to understand and use these tags correctly. The documentation also highlights important constraints and relationships between tags (such as mutual exclusivity), and provides author attribution.The most important changes are grouped below:
Core Documentation Improvements
Constant
,Default
,Example
,Examples
,ExclusiveMaximum
,ExclusiveMinimum
,Format
,JsonSchemaPlugin
,MaxItems
,MaxLength
,Maximum
,MinItems
,MinLength
,Minimum
,MultipleOf
,Pattern
,Sequence
, andTagBase
). Each comment explains the tag's purpose, usage, supported types, and includes practical code examples. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]TagBase Foundation
TagBase
type and itsIProps
interface, describing their role as the foundation for all validation tags and providing a custom tag example. [1] [2]Usage Guidance and Constraints
Maximum
vs.ExclusiveMaximum
,Minimum
vs.ExclusiveMinimum
,Format
vs.Pattern
) to help prevent incorrect usage. [1] [2] [3] [4] [5] [6]Practical Examples
Author Attribution
@author
attribution for Jeongho Nam in all new documentation comments. (All tag documentation changes)These changes significantly improve the developer experience by making the validation tags self-documenting and easier to discover and use correctly.