litmuschaos / litmuschaos/litmus-java-sdk

feat: add wrapper request DTOs for chaos experiment operations

Open
#59 0 comments 0 reactions 0 assignees View on GitHub

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 wraps projectID, the generated ListExperimentRequest filter payload, and a
    ListExperimentProjectionRoot
  • saveChaosExperiment — DTO wraps projectID and the generated SaveChaosExperimentRequest payload
    (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.java
  • src/main/java/io/litmuschaos/request/
  • existing *Response types 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 projectionRoot control — 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.