Make bytes fields work similarly to string in (required) repeated and map fields#308
Open
alexander-yevsyukov wants to merge 7 commits into
Open
Make bytes fields work similarly to string in (required) repeated and map fields#308alexander-yevsyukov wants to merge 7 commits into
bytes fields work similarly to string in (required) repeated and map fields#308alexander-yevsyukov wants to merge 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Java validation code generator so that (required) semantics for bytes fields inside repeated and map fields match the existing behavior for string: empty ByteString values are treated as “missing” and trigger a violation.
Changes:
- Extend
(required)collection-element “missing” predicate generation to supportbytes(ByteString.isEmpty()). - Add new proto fixture message for
map<string, bytes>with(required) = true. - Add integration tests covering
(required)for repeatedbytesand map values ofbytes, including mixed empty/non-empty cases.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| version.gradle.kts | Bumps published Validation version snapshot. |
| tests/validating/src/testFixtures/proto/spine/test/tools/validate/required.proto | Adds a required map<string, bytes> fixture message. |
| tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedBytesITest.kt | Adds integration tests for required repeated bytes behavior. |
| tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithBytesITest.kt | Adds integration tests for required map with bytes values behavior. |
| java/src/main/kotlin/io/spine/tools/validation/java/generate/option/RequiredGenerator.kt | Implements per-element “missing” predicate for bytes via ByteString::isEmpty. |
| docs/dependencies/pom.xml | Updates documented dependency versions to the new snapshots. |
| docs/dependencies/dependencies.md | Updates generated dependency report version headers/timestamps. |
| docs/content/docs/validation/user/01-getting-started/adding-to-build.md | Updates plugin version in user documentation. |
| docs/content/docs/validation/developer/build-and-release.md | Updates the documented published version. |
| buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt | Bumps local Validation runtime dependency version. |
| buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt | Bumps local Spine Time dependency version. |
| buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt | Bumps local Compiler dependency version(s). |
| .claude/agents/dependency-audit.md | Updates the agent configuration (model + guidance). |
| .agents/skills/dependency-audit/SKILL.md | Updates the dependency-audit skill procedure to prefer unified diff + batching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR makes code generation for the fields of the
bytestype work similarly tostrings when they are(required)inrepeatedormapfields.Other notable changes
configwas also updated.