Completed Deliverables ✅ :
1. Automated Code Generation (Sources/Generate/Generate.swift)
- Downloads NEAR OpenAPI spec
- Patches for JSON-RPC compatibility (single / endpoint)
- Automatic snake_case to camelCase conversion
- Post-processing for Swift conventions
2. Two Swift Packages
- NEARJSONRPCTypes: Type definitions only
- NEARJSONRPCClient: Full client with JSON-RPC wrapper
3. GitHub Actions Automation
- Daily spec updates (.github/workflows/generate.yml)
- Automated PR creation for changes
- release-please integration
- Cross-platform testing (.github/workflows/test.yml)
4. Comprehensive Testing
- Unit tests for types and client
- Mock-based integration tests
- Coverage reporting setup
5. Documentation
- README with quick start
- Usage guide with examples
- Contributing guidelines
- Architecture documentation
- Example application
Key Features:
- Path Patching: Handles the OpenAPI spec vs JSON-RPC implementation
mismatch
- Type Safety: Full Swift type safety with Codable
- Naming Conventions: Automatic conversion to Swift camelCase
- Async/Await: Modern Swift concurrency
- Error Handling: Comprehensive error types
- Developer Experience: Clean API with convenience methods
Project Structure:
near-swift-client/
├── Sources/
│ ├── NEARJSONRPCTypes/ # Type definitions
│ ├── NEARJSONRPCClient/ # Client implementation
│ └── Generate/ # Code generator
├── Tests/ # Unit & integration tests
├── Examples/ # Usage examples
├── docs/ # Documentation
├── scripts/ # Setup & publish scripts
└── .github/workflows/ # CI/CD automation
The implementation follows best practices from the existing Rust and
TypeScript clients while being idiomatic for Swift developers.
I have pushed this to a public github repo and waiting to have community review.