Summary
Migrate redisctl human-friendly commands to use our typed API client libraries instead of raw JSON. This will help us dogfood our own libraries and discover improvements.
Motivation
- Dogfooding: Using our own libraries will help us find issues and improve them
- Type Safety: Catch errors at compile time rather than runtime
- Better Error Messages: Typed errors are more informative than JSON parsing errors
- Field Validation: Discover fields that should be Optional, missing derives, etc.
Implementation Strategy
Keep Raw for API Commands
// redisctl cloud api GET /subscriptions/123/databases
// These continue using raw JSON passthrough for maximum compatibility
client.get_raw("/subscriptions/123/databases").await?
Use Typed for Human Commands
// redisctl cloud database list
// These use typed APIs for better validation
let databases = client.database().list(subscription_id).await?;
let value = serde_json::to_value(databases)?; // Convert for output
Benefits We'll Discover
- Missing Optional fields - Fields that can be null but aren't marked as
Option<T>
- Missing derives - Debug, Clone, Default, etc.
- API ergonomics - Methods that would make the API easier to use
- Validation gaps - Places where we should validate input
- Documentation needs - Missing or unclear documentation
Migration Checklist
Cloud Commands to Migrate
Enterprise Commands to Migrate
Handler Updates Needed
Success Criteria
- Commands using typed APIs have better error messages
- We identify at least 5 improvements to make to the libraries
- Performance impact is negligible (per our benchmarks)
- All tests continue to pass
Notes
Per our benchmarks (#23), the performance difference is negligible for typical API responses, so we're not sacrificing performance for type safety.
Summary
Migrate redisctl human-friendly commands to use our typed API client libraries instead of raw JSON. This will help us dogfood our own libraries and discover improvements.
Motivation
Implementation Strategy
Keep Raw for API Commands
Use Typed for Human Commands
Benefits We'll Discover
Option<T>Migration Checklist
Cloud Commands to Migrate
database list- List databasesdatabase get- Get database detailssubscription list- List subscriptionssubscription get- Get subscription detailsuser list- List usersbackup list- List backupsEnterprise Commands to Migrate
database list- List databases (bdbs)database get- Get database detailscluster info- Get cluster informationnode list- List nodesuser list- List usersalert list- List alertsHandler Updates Needed
.to_value()or similar methods to convert typed responses to JSON ValueSuccess Criteria
Notes
Per our benchmarks (#23), the performance difference is negligible for typical API responses, so we're not sacrificing performance for type safety.