Skip to content

Improve documentation clarity across schema and constraint classes#94

Merged
leoafarias merged 2 commits intomainfrom
claude/review-docs-comments-VETiA
Mar 7, 2026
Merged

Improve documentation clarity across schema and constraint classes#94
leoafarias merged 2 commits intomainfrom
claude/review-docs-comments-VETiA

Conversation

@leoafarias
Copy link
Collaborator

Summary

This PR improves documentation clarity throughout the codebase by refining docstrings, removing redundant explanations, and using proper markdown formatting for code references.

Key Changes

  • List schema extensions: Simplified docstrings for alias methods (minLength, maxLength, length, notEmpty) by removing the phrase "to mirror documentation naming"

  • Comparison constraint: Cleaned up class documentation by removing redundant statements about nullable type handling and using markdown formatting for code references

  • Object schema extensions: Simplified the extend() method documentation by removing vague language about "additional constructor" and clarifying that "schema properties" should be "schema settings"

  • String schema extensions: Enhanced url() method documentation to clarify it validates URIs (not just URLs) and added a note that it's an alias for uri()

  • Fluent schema mixin: Improved optional() method documentation to be more concise and added a reference to AckSchemaExtensions.optional for detailed semantics

  • String literal constraint: Simplified documentation by removing the redundant statement about null handling and using markdown formatting

  • Validators: Updated InvalidTypeConstraint documentation to be more specific about its usage context and use proper markdown formatting

  • Ack schema extensions: Enhanced transform() method documentation to clarify that the transformer receives T? due to nullable/optional base schemas

  • Ack factory: Added missing documentation for the enumString() factory method

Notable Details

All changes maintain backward compatibility and only affect documentation/comments. The improvements focus on consistency, clarity, and proper use of markdown formatting for code references.

https://claude.ai/code/session_016wyFrpbjHmLNXzKn4BQ5d7

claude added 2 commits March 6, 2026 17:59
- Remove misleading "always passes if null" claims from StringLiteralConstraint
  and ComparisonConstraint (isValid takes non-nullable types; null is handled
  upstream by AckSchema.handleNullInput)
- Fix url() doc to say URI instead of URL, matching PatternConstraint.uri()
- Remove vague "construction elements" from ObjectSchemaExtensions.extend()
- Fix InvalidTypeConstraint reference to removed tryConvertInput method
- Simplify ListSchemaExtensions alias comments (remove unclear "mirror
  documentation naming")
- Add doc comment to FluentSchema.optional() with cross-reference
- Add missing doc comment to Ack.enumString()

https://claude.ai/code/session_016wyFrpbjHmLNXzKn4BQ5d7
The transformer function parameter is `T?` (nullable) because the base
schema may be nullable or optional, making null a valid validated value.
This is a critical API detail for callers.

https://claude.ai/code/session_016wyFrpbjHmLNXzKn4BQ5d7
@docs-page
Copy link

docs-page bot commented Mar 6, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/ack~94

Documentation is deployed and generated using docs.page.

@leoafarias leoafarias merged commit 2944a8b into main Mar 7, 2026
1 check passed
@leoafarias leoafarias deleted the claude/review-docs-comments-VETiA branch March 7, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants