Skip to content

Make bytes fields work similarly to string in (required) repeated and map fields#308

Open
alexander-yevsyukov wants to merge 7 commits into
masterfrom
fix-required-for-bytes
Open

Make bytes fields work similarly to string in (required) repeated and map fields#308
alexander-yevsyukov wants to merge 7 commits into
masterfrom
fix-required-for-bytes

Conversation

@alexander-yevsyukov
Copy link
Copy Markdown
Collaborator

@alexander-yevsyukov alexander-yevsyukov commented May 20, 2026

This PR makes code generation for the fields of the bytes type work similarly to strings when they are (required) in repeated or map fields.

Other notable changes

  • config was also updated.

Copilot AI review requested due to automatic review settings May 20, 2026 20:30
@alexander-yevsyukov alexander-yevsyukov self-assigned this May 20, 2026
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review May 20, 2026 20:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 support bytes (ByteString.isEmpty()).
  • Add new proto fixture message for map<string, bytes> with (required) = true.
  • Add integration tests covering (required) for repeated bytes and map values of bytes, 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.

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