elsa-workflows / elsa-workflows/elsa-core

Open API Activities

Open
#2,961 5 comments 8 reactions 0 assignees View on GitHub
activity core triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

### Description

There should be an activity type provider that yields activities based on a given Open API specification.
This way, the user would not have to manually configure **Send HTTP Request** activities manually.
Instead, for each Path object in the Open API spec, an activity would be available.

### Example

For example, take the following Open API specification:

```json
{
"/pets": {
"get": {
"summary": "Find pets by ID",
"description": "Returns all pets from the system that the user has access to",
"responses": {
"200": {
"description": "A list of pets.",
"content": {}
}
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of pet to use",
"required": true,
"schema": {
"type": "array",
"items": {
"type": "string"
}
},
"style": "simple"
}
],
"post": {
"summary": "Create a new pet",
"description": "Create a new pet",
"responses": {
"201": {
"description": "The created pet.",
"content": {}
}
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"description": "Name of the pet",
"type": "string"
},
"status": {
"description": "Status of the pet",
"type": "string"
}
},
"required": [
"name",
"status"
]
}
}
}
}
}
```

The proposed activity type provider would yield the following two activities:

- Find pets by ID
- Create a new pet

Each activity would also provide the expected input properties, such as "ID" for "Find pets by ID" and "Name of the pet" for "Create a new pet".

The available outcomes would be determined by the supported HTTP response status codes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.