Conversation
…aints in JSON schemas This resolves validation errors where fields like resource_group_id with UUID constraints were being rejected. The JSON schemas now properly include format and constraint validation. Key changes: - Added protovalidate dependency and imports - Implemented extractValidateConstraints() helper function - Added support for string constraints: uuid, email, pattern, minLength, maxLength - Added support for numeric constraints: minimum, maximum values - Updated test cases and examples with new TestValidation method - Fixed buf configuration to avoid duplicate protovalidate generation - Updated golden files to include validation constraint schemas The generated JSON schemas now include proper validation: - string.uuid → "format": "uuid" - string.email → "format": "email" - string.pattern → "pattern": "regex" - string.min_len/max_len → "minLength"/"maxLength" - numeric gte/lte/gt/lt → "minimum"/"maximum" Works in both standard and OpenAI compatibility modes.
rockwotj
approved these changes
Sep 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds support for protovalidate constraints in JSON schema generation, resolving validation errors where fields with UUID constraints were being rejected at runtime.
• UUID validation:
(buf.validate.field).string.uuid = true→"format": "uuid"• Email validation:
(buf.validate.field).string.email = true→"format": "email"• Pattern validation:
(buf.validate.field).string.pattern = "regex"→"pattern": "regex"• Length constraints:
min_len/max_len→"minLength"/"maxLength"• Numeric ranges:
gte/lte/gt/lt→"minimum"/"maximum"Test plan
Example
Before:
resource_group_id: "cloud"would be rejected with UUID validation errorAfter: JSON schema includes
"format": "uuid"and validation works properlyThe implementation supports both standard and OpenAI compatibility modes and maintains backward compatibility.
🤖 Generated with Claude Code