-
Notifications
You must be signed in to change notification settings - Fork 5
Java SDK Repository Cleanup: README, .gitignore, Documentation #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Java SDK Repository Cleanup: README, .gitignore, Documentation #35
Conversation
- Rewrite README with clearer structure and grammar - Add requirements section (Java 8+, Maven/Gradle versions) - Add table of contents for navigation - Fix incomplete sentences and missing imports in code examples - Add proper exception handling to code examples - Use gender-neutral language throughout - Add License and Support sections - Expand .gitignore with comprehensive Java/Gradle exclusions - Fix minor formatting in build.gradle 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add BasicPermissionCheckExample for simple permission checks - Add AdvancedPermissionCheckExample for ABAC and tenant-scoped checks - Add UserSyncExample for user synchronization with the API - Add unit tests with Mockito mocks for all examples - Update build.gradle with Mockito test dependencies - Update README with links to example files and Examples section 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add instructions for running example classes - Add commands for running all tests, example tests, and specific test classes - Note that example tests use Mockito and don't require a running PDP 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Downgrade Logback from 1.4.14 to 1.3.14 because: - Logback 1.4.x requires Java 11+ - Logback 1.3.x is the last version supporting Java 8 - Update SLF4J to 2.0.9 for compatibility with Logback 1.3.x This fixes UnsupportedClassVersionError when running tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Document source code directory structure (api, api/models, enforcement, examples, openapi, util) - Add Contributing section with prerequisites - Document OpenAPI Generator installation (Homebrew, npm, Docker) - Explain Makefile targets for regenerating OpenAPI models - Add development workflow and code style guidelines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Permit.io API spec has minor validation issues that don't affect code generation. Add the skip flag to bypass these errors. Also document this in the README Contributing section. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Clarify that SDK targets Java 8 but OpenAPI Generator needs Java 11+ - Add example command for running generator with Java 17 on macOS 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Logback is not used in main source code - only the SLF4J API facade is used. This allows SDK consumers to choose their own SLF4J binding. - Keep SLF4J API as implementation (used by main code) - Move Logback to testImplementation (only needed for test logging) - Keep Logback 1.3.x for Java 8 test runtime compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create CONTRIBUTING.md with detailed contribution guidelines - Add Java 8 deprecation notice to README (moving to Java 17 next release) - Simplify README by replacing inline code examples with links - Document OpenAPI model generation and copy process - Add project structure to both README and CONTRIBUTING.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove TestableBasicPermissionCheckExample inner class - Remove TestableAdvancedPermissionCheckExample inner class - Remove TestableUserSyncExample and UserSyncService inner classes - Mock Permit class directly instead of creating duplicate test classes - Tests now verify actual example code, catching regressions properly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this 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 enhances the Java SDK repository documentation and development workflow with professional, comprehensive updates across README, contributing guidelines, and code examples.
Key Changes:
- Rewrote README with clearer structure, professional tone, and comprehensive usage documentation
- Added detailed CONTRIBUTING.md with development workflow, OpenAPI regeneration guide, and project structure
- Created three complete example classes with corresponding unit tests demonstrating SDK usage
- Updated build configuration with
--skip-validate-specflag for OpenAPI generation
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Complete rewrite with table of contents, requirements section, improved examples, and support links |
| CONTRIBUTING.md | New comprehensive guide covering development workflow, OpenAPI model regeneration, and contribution guidelines |
| Makefile | Added --skip-validate-spec flag to OpenAPI generator command |
| BasicPermissionCheckExample.java | New example demonstrating SDK initialization and basic permission checks |
| AdvancedPermissionCheckExample.java | New example showing permission checks with ABAC attributes and tenant context |
| UserSyncExample.java | New example demonstrating user synchronization with various profile configurations |
| BasicPermissionCheckExampleTest.java | Unit tests for BasicPermissionCheckExample using Mockito mocks |
| AdvancedPermissionCheckExampleTest.java | Unit tests for AdvancedPermissionCheckExample with comprehensive scenarios |
| UserSyncExampleTest.java | Unit tests for UserSyncExample covering sync operations and error handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Skip test if there's a class version mismatch (e.g., running with incompatible JVM) | ||
| System.out.println("Skipping test due to class version incompatibility: " + e.getMessage()); |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both catch blocks have identical comments stating "Skip test if there's a class version mismatch," but NoClassDefFoundError can occur for reasons other than class version mismatches (e.g., missing dependencies). The second comment should be more accurate.
| // Skip test if there's a class version mismatch (e.g., running with incompatible JVM) | |
| System.out.println("Skipping test due to class version incompatibility: " + e.getMessage()); | |
| // Skip test if there's a missing dependency, classpath issue, or class version mismatch | |
| System.out.println("Skipping test due to missing class or incompatibility: " + e.getMessage()); |
| // Skip test if there's a class version mismatch (e.g., running with incompatible JVM) | ||
| System.out.println("Skipping test due to class version incompatibility: " + e.getMessage()); |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both catch blocks have identical comments stating "Skip test if there's a class version mismatch," but NoClassDefFoundError can occur for reasons other than class version mismatches (e.g., missing dependencies). The second comment should be more accurate.
| // Skip test if there's a class version mismatch (e.g., running with incompatible JVM) | |
| System.out.println("Skipping test due to class version incompatibility: " + e.getMessage()); | |
| // Skip test if a required class is missing (e.g., missing dependency, classpath issue, or class version incompatibility) | |
| System.out.println("Skipping test due to missing class definition or dependency issue: " + e.getMessage()); |
| // Skip test if there's a class version mismatch (e.g., running with incompatible JVM) | ||
| System.out.println("Skipping test due to class version incompatibility: " + e.getMessage()); |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both catch blocks have identical comments stating "Skip test if there's a class version mismatch," but NoClassDefFoundError can occur for reasons other than class version mismatches (e.g., missing dependencies). The second comment should be more accurate.
| // Skip test if there's a class version mismatch (e.g., running with incompatible JVM) | |
| System.out.println("Skipping test due to class version incompatibility: " + e.getMessage()); | |
| // Skip test if a required class is missing (e.g., missing dependency or class version incompatibility) | |
| System.out.println("Skipping test due to missing class or dependency: " + e.getMessage()); |
Summary
Test plan
Closes PER-13560
🤖 Generated with Claude Code