litmuschaos / litmuschaos/litmus-java-sdk
feat: add wrapper request DTOs for chaos experiment operations
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 6
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Background
The chaos experiment methods in LitmusClient (e.g. listExperiment, saveChaosExperiment) already exist, but they have no dedicated SDK-level request DTOs. Callers must construct and pass loose generated *GraphQLQuery / *ProjectionRoot instances directly, which is verbose and inconsistent with the
User/Auth area (e.g. UserCreateRequest).
Proposal
Add builder-based request DTOs that wrap each operation's inputs (following the existing UserCreateRequest pattern), and update the corresponding LitmusClient methods to accept a single DTO instead of a query + projection root.
Targets:
listExperiment— DTO wrapsprojectID, the generatedListExperimentRequestfilter payload, and a
ListExperimentProjectionRootsaveChaosExperiment— DTO wrapsprojectIDand the generatedSaveChaosExperimentRequestpayload
(no projection)
Naming note
ListExperimentRequest and SaveChaosExperimentRequest already exist as generated GraphQL input types under io.litmuschaos.generated.types, and LitmusClientTest wildcard-imports both that package and io.litmuschaos.request.*. Reusing those exact names in the SDK request package would cause an ambiguous-reference compile error. The new DTOs therefore need distinct names — e.g.
ChaosExperimentListRequest / ChaosExperimentSaveRequest (domain-noun-first, consistent with PasswordResetRequest), or ListExperimentClientRequest / SaveChaosExperimentClientRequest. Open to whichever convention maintainers prefer.
Scope
src/main/java/io/litmuschaos/LitmusClient.javasrc/main/java/io/litmuschaos/request/- existing
*Responsetypes look reusable, so no new response wrappers expected
Approach
I plan to replace the existing (query, projectionRoot) signatures rather than add overloads,
because:
- the SDK is still at
0.0.1, so a breaking change is acceptable at this stage - keeping both styles makes the inconsistency between User/Auth and chaos-experiment APIs permanent
instead of resolving it - callers retain full
projectionRootcontrol — it just moves inside the DTO
Happy to switch to an overload-based approach if maintainers prefer.
I'd like to work on this — please assign it to me. 🙂
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/main/java/io/litmuschaos/LitmusClient.java and the existing request DTOs, especially UserCreateRequest; inspect the generated ListExperimentRequest and SaveChaosExperimentRequest types under io.litmuschaos.generated.types. Review LitmusClientTest for the affected calls and finish when both operations accept distinct SDK request DTOs with their existing responses and projection control preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 66/100