-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified POST Execute API to Display Body in Swagger and Fixed Type-C…
…asting Error in GET Execute API (#5858) * Modified POST execute API to show body in Swagger and resolved type-casting error in GET execute API Modified the POST execute API to display the body in Swagger documentation and resolved the type-casting error in the GET execute API * Added IExecutionRequest interface defines a contract for Request classes * Moved the serialization logic into request classes * Add missing import and reformat ActivityHandle property Included the Elsa.Workflows.Models import in Models.cs to fix missing reference. Removed redundant ActivityHandle assignment in EndpointBase.cs to improve clarity and reduce redundancy. --------- Co-authored-by: Sipke Schoorstra <[email protected]>
- Loading branch information
1 parent
ba06811
commit 2b22400
Showing
4 changed files
with
94 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/Execute/GetEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Elsa.Workflows.Contracts; | ||
using Elsa.Workflows.Management; | ||
using Elsa.Workflows.Runtime; | ||
using JetBrains.Annotations; | ||
|
||
namespace Elsa.Workflows.Api.Endpoints.WorkflowDefinitions.Execute; | ||
|
||
/// <summary> | ||
/// An API endpoint that executes a given workflow definition through GET method. | ||
/// </summary> | ||
[PublicAPI] | ||
internal class GetEndpoint( | ||
IWorkflowDefinitionService workflowDefinitionService, | ||
IWorkflowRuntime workflowRuntime, | ||
IApiSerializer apiSerializer) | ||
: EndpointBase<GetRequest>(workflowDefinitionService, workflowRuntime, apiSerializer) | ||
{ | ||
/// <inheritdoc /> | ||
public override void Configure() | ||
{ | ||
base.Configure(); | ||
Verbs(FastEndpoints.Http.GET); | ||
} | ||
} |
42 changes: 40 additions & 2 deletions
42
src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/Execute/Models.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/Execute/PostEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Elsa.Workflows.Contracts; | ||
using Elsa.Workflows.Management; | ||
using Elsa.Workflows.Runtime; | ||
using JetBrains.Annotations; | ||
|
||
namespace Elsa.Workflows.Api.Endpoints.WorkflowDefinitions.Execute; | ||
|
||
/// <summary> | ||
/// An API endpoint that executes a given workflow definition through POST method. | ||
/// </summary> | ||
[PublicAPI] | ||
internal class PostEndpoint( | ||
IWorkflowDefinitionService workflowDefinitionService, | ||
IWorkflowRuntime workflowRuntime, | ||
IApiSerializer apiSerializer) | ||
: EndpointBase<PostRequest>(workflowDefinitionService, workflowRuntime, apiSerializer) | ||
{ | ||
/// <inheritdoc /> | ||
public override void Configure() | ||
{ | ||
base.Configure(); | ||
Verbs(FastEndpoints.Http.POST); | ||
} | ||
} |