Skip to content

Add COMMENTER value to AccessLevel enum - #188

Merged
smar-ivan-sandev merged 2 commits into
mainlinefrom
fix/access-level-commenter
Aug 4, 2026
Merged

Add COMMENTER value to AccessLevel enum#188
smar-ivan-sandev merged 2 commits into
mainlinefrom
fix/access-level-commenter

Conversation

@smar-ivan-sandev

@smar-ivan-sandev smar-ivan-sandev commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the missing COMMENTER value to com.smartsheet.api.models.enums.AccessLevel.

Fixes smartsheet/smartsheet-csharp-sdk#218, which reports this against the C# SDK. The Java SDK had the identical gap, and the maintainer response on that issue committed to fixing both.

Problem

The Access Level schema documents six values, but the enum defined only five — COMMENTER was absent.

JacksonJsonSerializer sets READ_UNKNOWN_ENUM_VALUES_AS_NULL, so a Commenter access level was dropped silently: the object came back fully populated with accessLevel == null, no exception and no warning. Callers could not distinguish "this share is Commenter" from "this share has no access level". This affected ShareResponse, Sheet, Report, Workspace, and every other model carrying an accessLevel.

Unlike C#, the write path was not separately broken here — accessLevel fields are reference types — but CreateShareRequest and UpdateShareRequest still had no COMMENTER value to set.

Changes

  • Added COMMENTER to the AccessLevel enum, declared after VIEWER to match the order in the API specification (and the Python SDK).
  • Updated the stale smartsheet.redoc.ly javadoc link to the current Resource Access Levels guide.
  • Updated AccessLevelTest for the new value and count, and pinned the declaration order so it cannot drift from the spec.
  • Added AccessLevelDeserializationTest covering ShareResponse, Sheet, Report, and Workspace.

Forward-compatibility is deliberately preserved: a genuinely unknown access level still deserializes to null rather than failing the response. That behavior is now pinned by a test.

Testing

  • ./gradlew test — 659/661 pass. The 2 failures are LoggingIT integration tests that require a live API connection and fail identically on clean mainline in this environment.
  • Checkstyle: no new violations (the 3 reported errors are pre-existing, in ReportResources/ReportResourcesImpl).

Note

The C# counterpart is smartsheet/smartsheet-csharp-sdk#219. Python and JavaScript already had COMMENTER.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where the COMMENTER access level was incorrectly deserialized as null for sheets, reports, workspaces, and shares.
  • Documentation
    • Updated access-level documentation links to reference the current resource access levels guide.
  • Changelog
    • Added an unreleased entry documenting the access-level deserialization fix.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1940edd9-342d-4c6b-a494-2d45313d6d6d

📥 Commits

Reviewing files that changed from the base of the PR and between ea0e888 and 0ad4b01.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/main/java/com/smartsheet/api/models/enums/AccessLevel.java
  • src/test/java/com/smartsheet/api/internal/json/AccessLevelDeserializationTest.java
  • src/test/java/com/smartsheet/api/models/AccessLevelTest.java

📝 Walkthrough

Walkthrough

The PR updates AccessLevel documentation, expands enum assertions, adds deserialization tests for COMMENTER and unknown values, and records the correction in CHANGELOG.md.

Changes

AccessLevel COMMENTER support

Layer / File(s) Summary
AccessLevel contract checks
src/main/java/com/smartsheet/api/models/enums/AccessLevel.java, src/test/java/com/smartsheet/api/models/AccessLevelTest.java
The Javadoc now links to the Resource Access Levels guide. Tests validate COMMENTER, six enum values, and declaration order.
COMMENTER deserialization coverage
src/test/java/com/smartsheet/api/internal/json/AccessLevelDeserializationTest.java, CHANGELOG.md
Tests cover COMMENTER deserialization for shares, sheets, reports, and workspaces. Unknown values remain null. The changelog records the correction.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • smartsheet/smartsheet-csharp-sdk issue 218: The issue describes the same missing AccessLevel.COMMENTER value and silent null deserialization behavior across resource models.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/access-level-commenter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread src/main/java/com/smartsheet/api/models/enums/AccessLevel.java Outdated
@smar-ivan-sandev smar-ivan-sandev self-assigned this Aug 4, 2026
@smar-ivan-sandev
smar-ivan-sandev marked this pull request as ready for review August 4, 2026 07:40
@smar-ivan-sandev
smar-ivan-sandev merged commit 9843bf3 into mainline Aug 4, 2026
2 of 3 checks passed
@smar-ivan-sandev
smar-ivan-sandev deleted the fix/access-level-commenter branch August 4, 2026 07:41
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.

AccessLevel enum is missing COMMENTER, and the unmapped value deserializes silently to null

2 participants