Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ public interface IMembaseApi
Task<PgtValidationResponse> ValidatePgtDefinitionAsync(string graphId, string definitionId, [Body] PgtValidationRequest request);

[Post("/graph/{graphId}/pgt-external/{correlationId}/complete")]
Task<PgtExternalCompleteResponse> CompletePgtExternalAsync(string graphId, string correlationId);
Task<PgtExternalCompleteResponse> CompletePgtExternalAsync(string graphId, string correlationId, [FromBody] object emptyBody);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Wrong body attribute 🐞 Bug ≡ Correctness

IMembaseApi.CompletePgtExternalAsync uses ASP.NET Core MVC [FromBody] on a Refit client
interface, so Refit may not serialize/send the request body for this POST call. If
/pgt-external/{correlationId}/complete requires a JSON body (even {}), the call can still fail
at runtime.
Agent Prompt
## Issue description
`CompletePgtExternalAsync` is part of a Refit REST client interface but its new parameter is annotated with ASP.NET Core MVC `[FromBody]`. Refit expects its own `[Body]` attribute for request-body serialization; using `[FromBody]` may result in no body being sent.

## Issue Context
This interface is registered via `AddRefitClient<IMembaseApi>(...)`, and other methods in the same interface consistently use Refit `[Body]` for payloads.

## Fix Focus Areas
- src/Plugins/BotSharp.Plugin.Membase/Interfaces/IMembaseApi.cs[62-64]

### Suggested fix
- Change `[FromBody] object emptyBody` to `[Body] object emptyBody`.
- (Optional, clearer) Replace `object` with a dedicated empty request type (e.g., `PgtExternalCompleteRequest`) and pass `new PgtExternalCompleteRequest()` (or `new {}`) from call sites.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ public class PgtExternalTask

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public object? Error { get; set; }

public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? CreatedAt { get; set; }
public DateTime? UpdatedAt { get; set; }
public DateTime? CompletedAt { get; set; }

public long NotBefore { get; set; }

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? ClaimedAt { get; set; }
}
Loading