Skip to content

Commit dd3dbb5

Browse files
authored
Improve data fetching section (#5)
This pull request updates the `devrev-trello-snapin.plain` file and the `trello-openapi-compact.yaml` file to enhance functionality and improve documentation. Key changes include specifying API endpoints for fetching data, introducing detailed mapping requirements, and adding example responses to OpenAPI paths for better clarity. - https://app.devrev.ai/devrev/works/ISS-193822
1 parent 87c7c07 commit dd3dbb5

File tree

2 files changed

+135
-5
lines changed

2 files changed

+135
-5
lines changed

devrev-trello-snapin.plain

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,23 @@
6161

6262
***Non-Functional Requirements:***
6363

64-
- The resource [trello-openapi-compact.yaml](trello-openapi-compact.yaml) describes The API.
64+
- The OpenAPI Specification is provided in the resource [trello-openapi-compact.yaml](trello-openapi-compact.yaml). The OpenAPI Specification describes The API.
65+
66+
- The Mapping is a method in The Implementation Code that maps the fields in The API response to the fields in The Function's output. The Mapping should output "snake_case" for JSON keys. The Mapping should map every single field from The OpenAPI Specification to The Function's output.
6567

68+
- If The Function uses The API to fetch data, The Mapping should be used along its rules.
6669

6770
***Functional Requirements:***
6871

69-
- Implement The Function that uses The API to fetch The List of Boards (The Fetched Boards).
72+
- Implement The Function that uses The API to fetch The List of Boards (The Fetched Boards) using the endpoint "/members/{id}/boards".
7073

7174
***Acceptance Tests:***
7275

7376
- When using The Test Trello Credentials a board with the name "SaaS connectors" must be in the result of The Function.
7477

75-
- Implement The Function that uses The API to fetch The List of Users of The Organization (The Fetched Users). The Organization ID is provided in the "org_id" field of the "connection_data" dictionary which is part of "payload" dictionary.
76-
77-
- Implement The Function that uses The API to fetch The List of Cards for The Board (The Fetched Cards). The Board ID is provided in the "external_sync_unit_id" field of the "event_context" dictionary which is part of "payload" dictionary.
78+
- Implement The Function that uses The API to fetch The List of Users of The Organization (The Fetched Users) using the endpoint "/organizations/{id}/members". The Organization ID is provided in the "org_id" field of the "connection_data" dictionary which is part of "payload" dictionary.
7879

80+
- Implement The Function that uses The API to fetch The List of Cards for The Board (The Fetched Cards) using the endpoint "/boards/{id}/cards". The Board ID is provided in the "external_sync_unit_id" field of the "event_context" dictionary which is part of "payload" dictionary.
7981

8082
## Generate 'external_domain_metadata.json'
8183

trello-openapi-compact.yaml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,78 @@ paths:
209209
responses:
210210
'200':
211211
description: Success
212+
content:
213+
application/json:
214+
schema:
215+
type: array
216+
items:
217+
$ref: '#/components/schemas/Card'
218+
examples:
219+
sample:
220+
summary: Example response
221+
value:
222+
- id: "card_id_123"
223+
badges:
224+
attachments: 0
225+
fogbugz: ""
226+
checkItems: 0
227+
checkItemsChecked: 0
228+
checkItemsEarliestDue: null
229+
comments: 0
230+
description: false
231+
due: null
232+
dueComplete: false
233+
lastUpdatedByAi: false
234+
start: null
235+
externalSource: null
236+
attachmentsByType:
237+
trello:
238+
board: 0
239+
card: 0
240+
location: false
241+
votes: 0
242+
maliciousAttachments: 0
243+
viewingMemberVoted: false
244+
subscribed: false
245+
checkItemStates: []
246+
closed: false
247+
dueComplete: false
248+
dateLastActivity: "2025-06-06T06:08:05.912Z"
249+
desc: ""
250+
descData:
251+
emoji: {}
252+
due: null
253+
dueReminder: null
254+
email: null
255+
idBoard: "board_id_456"
256+
idChecklists: []
257+
idList: "list_id_789"
258+
idMembers: []
259+
idMembersVoted: []
260+
idShort: 1
261+
idAttachmentCover: null
262+
labels: []
263+
idLabels: []
264+
manualCoverAttachment: false
265+
name: "Card Name"
266+
nodeId: "node_id_abc"
267+
pinned: false
268+
pos: 140737488355328
269+
shortLink: "short_link_xyz"
270+
shortUrl: "https://trello.com/c/short_link_xyz"
271+
start: null
272+
subscribed: false
273+
url: "https://trello.com/c/short_link_xyz/1-card-name"
274+
cover:
275+
idAttachment: null
276+
color: null
277+
idUploadedBackground: null
278+
size: "normal"
279+
brightness: "dark"
280+
idPlugin: null
281+
isTemplate: false
282+
cardRole: null
283+
mirrorSourceId: null
212284
'/boards/{id}/cards/{filter}':
213285
get:
214286
description: >-
@@ -790,6 +862,54 @@ paths:
790862
type: array
791863
items:
792864
$ref: '#/components/schemas/Board'
865+
examples:
866+
sample:
867+
summary: Example response
868+
value:
869+
- id: "exampleBoardId"
870+
nodeId: "ari:cloud:trello::board/workspace/exampleOrgId/exampleBoardId"
871+
name: "Example Board Name"
872+
desc: ""
873+
descData: null
874+
closed: false
875+
dateClosed: null
876+
idOrganization: "exampleOrgId"
877+
idEnterprise: null
878+
pinned: false
879+
starred: false
880+
url: "https://trello.com/b/exampleShortLink/example-board-name"
881+
shortLink: "exampleShortLink"
882+
subscribed: false
883+
labelNames:
884+
green: ""
885+
yellow: ""
886+
orange: ""
887+
powerUps: []
888+
dateLastActivity: "2025-03-26T12:04:13.067Z"
889+
dateLastView: "2025-06-06T06:07:13.134Z"
890+
shortUrl: "https://trello.com/b/exampleShortLink"
891+
idTags: []
892+
datePluginDisable: null
893+
creationMethod: null
894+
ixUpdate: "1"
895+
templateGallery: null
896+
enterpriseOwned: false
897+
idBoardSource: null
898+
premiumFeatures:
899+
- "additionalBoardBackgrounds"
900+
- "additionalStickers"
901+
- "customBoardBackgrounds"
902+
- "customEmoji"
903+
- "customStickers"
904+
- "plugins"
905+
idMemberCreator: "exampleMemberId"
906+
type: null
907+
memberships:
908+
- id: "exampleMembershipId"
909+
idMember: "exampleMemberId"
910+
memberType: "admin"
911+
unconfirmed: false
912+
deactivated: false
793913
'/members/{id}/boardsInvited':
794914
get:
795915
description: Get the boards the member has been invited to
@@ -1110,6 +1230,14 @@ paths:
11101230
items:
11111231
oneOf:
11121232
- $ref: '#/components/schemas/Member'
1233+
examples:
1234+
sample:
1235+
summary: Example response
1236+
value:
1237+
- id: "examplesaasID1"
1238+
fullName: "My full name"
1239+
username: "examplesaas1"
1240+
lastActive: "2025-04-06T08:37:21.065Z"
11131241
'/organizations/{id}/memberships':
11141242
get:
11151243
description: List the memberships of a Workspace

0 commit comments

Comments
 (0)