@devries-cameron20 / composio Mirror · read-only / commits / 06338594e
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 12:00 UTC

fix(docs): comprehensive fix for nullable without type in OpenAPI schemas

Replace the regex-based fix with a recursive solution that properly handles all cases of invalid OpenAPI 3.0 schemas with "nullable: true" but no type. The fix now: - For additionalProperties: removes nullable (allows any type) - For schemas with object examples: infers type: object - For schemas with array examples: infers type: array - For all other cases: defaults to type: object This fixes 448 invalid schemas that caused fumadocs to crash when rendering API reference pages like /tools/postToolsExecuteProxy. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Sushmithamallesh committed Jan 29, 2026 at 12:13 UTC 06338594e0e57c32862705237ff34a2a188bcef3
2 files changed +161 -68
docs/public/openapi.json
+121 -56
@@ -891,6 +891,7 @@
891 "/api/v3/auth_configs": {
892 "post": {
893 "summary": "Create new authentication configuration",
894 + "description": "Creates a new auth config for a toolkit, allowing you to use your own OAuth credentials or API keys instead of Composio-managed authentication. This is required when you want to use custom OAuth apps (bring your own client ID/secret) or configure specific authentication parameters for a toolkit.",
895 "tags": [
896 "Auth Configs"
897 ],
@@ -1240,6 +1241,7 @@
1241 },
1242 "get": {
1243 "summary": "List authentication configurations with optional filters",
1244 + "description": "Retrieves all auth configs for your project. Auth configs define how users authenticate with external services (OAuth, API keys, etc.). Use filters to find configs for specific toolkits or to distinguish between Composio-managed and custom configurations.",
1245 "tags": [
1246 "Auth Configs"
1247 ],
@@ -1464,7 +1466,8 @@
1466 "expected_input_fields": {
1467 "type": "array",
1468 "items": {
1467 - "nullable": true
1469 + "nullable": true,
1470 + "type": "object"
1471 },
1472 "description": "Fields expected during connection initialization"
1473 },
@@ -1764,7 +1767,8 @@
1767 "expected_input_fields": {
1768 "type": "array",
1769 "items": {
1767 - "nullable": true
1770 + "nullable": true,
1771 + "type": "object"
1772 },
1773 "description": "Fields expected during connection initialization"
1774 },
@@ -2342,6 +2346,7 @@
2346 "/api/v3/connected_accounts": {
2347 "get": {
2348 "summary": "List connected accounts with optional filters",
2349 + "description": "Retrieves all connected accounts for your project. Connected accounts represent authenticated user connections to external services (e.g., a user's Gmail account, Slack workspace). Filter by toolkit, status, user ID, or auth config to find specific connections.",
2350 "tags": [
2351 "Connected Accounts"
2352 ],
@@ -3486,7 +3491,8 @@
3491 "type": "string"
3492 },
3493 {
3489 - "nullable": true
3494 + "nullable": true,
3495 + "type": "object"
3496 }
3497 ]
3498 },
@@ -3502,7 +3508,8 @@
3508 }
3509 },
3510 {
3505 - "nullable": true
3511 + "nullable": true,
3512 + "type": "object"
3513 }
3514 ]
3515 },
@@ -3634,7 +3641,8 @@
3641 "type": "string"
3642 },
3643 {
3637 - "nullable": true
3644 + "nullable": true,
3645 + "type": "object"
3646 }
3647 ]
3648 },
@@ -3650,7 +3658,8 @@
3658 }
3659 },
3660 {
3653 - "nullable": true
3661 + "nullable": true,
3662 + "type": "object"
3663 }
3664 ]
3665 },
@@ -8628,7 +8637,8 @@
8637 "type": "string"
8638 },
8639 {
8631 - "nullable": true
8640 + "nullable": true,
8641 + "type": "object"
8642 }
8643 ]
8644 },
@@ -8644,7 +8654,8 @@
8654 }
8655 },
8656 {
8647 - "nullable": true
8657 + "nullable": true,
8658 + "type": "object"
8659 }
8660 ]
8661 },
@@ -8776,7 +8787,8 @@
8787 "type": "string"
8788 },
8789 {
8779 - "nullable": true
8790 + "nullable": true,
8791 + "type": "object"
8792 }
8793 ]
8794 },
@@ -8792,7 +8804,8 @@
8804 }
8805 },
8806 {
8795 - "nullable": true
8807 + "nullable": true,
8808 + "type": "object"
8809 }
8810 ]
8811 },
@@ -9145,6 +9158,7 @@
9158 },
9159 "post": {
9160 "summary": "Create a new connected account",
9161 + "description": "Initiates a new connection to an external service for a user. For OAuth-based toolkits, this returns a redirect URL to complete authentication. For API key-based toolkits, provide the credentials directly in the request body. Use the `user_id` field to associate the connection with a specific user in your system.",
9162 "tags": [
9163 "Connected Accounts"
9164 ],
@@ -10064,7 +10078,8 @@
10078 "type": "string"
10079 },
10080 {
10067 - "nullable": true
10081 + "nullable": true,
10082 + "type": "object"
10083 }
10084 ]
10085 },
@@ -10080,7 +10095,8 @@
10095 }
10096 },
10097 {
10083 - "nullable": true
10098 + "nullable": true,
10099 + "type": "object"
10100 }
10101 ]
10102 },
@@ -10212,7 +10228,8 @@
10228 "type": "string"
10229 },
10230 {
10215 - "nullable": true
10231 + "nullable": true,
10232 + "type": "object"
10233 }
10234 ]
10235 },
@@ -10228,7 +10245,8 @@
10245 }
10246 },
10247 {
10231 - "nullable": true
10248 + "nullable": true,
10249 + "type": "object"
10250 }
10251 ]
10252 },
@@ -15206,7 +15224,8 @@
15224 "type": "string"
15225 },
15226 {
15209 - "nullable": true
15227 + "nullable": true,
15228 + "type": "object"
15229 }
15230 ]
15231 },
@@ -15222,7 +15241,8 @@
15241 }
15242 },
15243 {
15225 - "nullable": true
15244 + "nullable": true,
15245 + "type": "object"
15246 }
15247 ]
15248 },
@@ -15354,7 +15374,8 @@
15374 "type": "string"
15375 },
15376 {
15357 - "nullable": true
15377 + "nullable": true,
15378 + "type": "object"
15379 }
15380 ]
15381 },
@@ -15370,7 +15391,8 @@
15391 }
15392 },
15393 {
15373 - "nullable": true
15394 + "nullable": true,
15395 + "type": "object"
15396 }
15397 ]
15398 },
@@ -16534,7 +16556,8 @@
16556 "type": "string"
16557 },
16558 {
16537 - "nullable": true
16559 + "nullable": true,
16560 + "type": "object"
16561 }
16562 ]
16563 },
@@ -16550,7 +16573,8 @@
16573 }
16574 },
16575 {
16553 - "nullable": true
16576 + "nullable": true,
16577 + "type": "object"
16578 }
16579 ]
16580 },
@@ -16682,7 +16706,8 @@
16706 "type": "string"
16707 },
16708 {
16685 - "nullable": true
16709 + "nullable": true,
16710 + "type": "object"
16711 }
16712 ]
16713 },
@@ -16698,7 +16723,8 @@
16723 }
16724 },
16725 {
16701 - "nullable": true
16726 + "nullable": true,
16727 + "type": "object"
16728 }
16729 ]
16730 },
@@ -21676,7 +21702,8 @@
21702 "type": "string"
21703 },
21704 {
21679 - "nullable": true
21705 + "nullable": true,
21706 + "type": "object"
21707 }
21708 ]
21709 },
@@ -21692,7 +21719,8 @@
21719 }
21720 },
21721 {
21695 - "nullable": true
21722 + "nullable": true,
21723 + "type": "object"
21724 }
21725 ]
21726 },
@@ -21824,7 +21852,8 @@
21852 "type": "string"
21853 },
21854 {
21827 - "nullable": true
21855 + "nullable": true,
21856 + "type": "object"
21857 }
21858 ]
21859 },
@@ -21840,7 +21869,8 @@
21869 }
21870 },
21871 {
21843 - "nullable": true
21872 + "nullable": true,
21873 + "type": "object"
21874 }
21875 ]
21876 },
@@ -23192,7 +23222,8 @@
23222 "type": "string"
23223 },
23224 {
23195 - "nullable": true
23225 + "nullable": true,
23226 + "type": "object"
23227 }
23228 ]
23229 },
@@ -23208,7 +23239,8 @@
23239 }
23240 },
23241 {
23211 - "nullable": true
23242 + "nullable": true,
23243 + "type": "object"
23244 }
23245 ]
23246 },
@@ -23340,7 +23372,8 @@
23372 "type": "string"
23373 },
23374 {
23343 - "nullable": true
23375 + "nullable": true,
23376 + "type": "object"
23377 }
23378 ]
23379 },
@@ -23356,7 +23389,8 @@
23389 }
23390 },
23391 {
23359 - "nullable": true
23392 + "nullable": true,
23393 + "type": "object"
23394 }
23395 ]
23396 },
@@ -28334,7 +28368,8 @@
28368 "type": "string"
28369 },
28370 {
28337 - "nullable": true
28371 + "nullable": true,
28372 + "type": "object"
28373 }
28374 ]
28375 },
@@ -28350,7 +28385,8 @@
28385 }
28386 },
28387 {
28353 - "nullable": true
28388 + "nullable": true,
28389 + "type": "object"
28390 }
28391 ]
28392 },
@@ -28482,7 +28518,8 @@
28518 "type": "string"
28519 },
28520 {
28485 - "nullable": true
28521 + "nullable": true,
28522 + "type": "object"
28523 }
28524 ]
28525 },
@@ -28498,7 +28535,8 @@
28535 }
28536 },
28537 {
28501 - "nullable": true
28538 + "nullable": true,
28539 + "type": "object"
28540 }
28541 ]
28542 },
@@ -30055,7 +30093,8 @@
30093 "type": "string"
30094 },
30095 {
30058 - "nullable": true
30096 + "nullable": true,
30097 + "type": "object"
30098 }
30099 ]
30100 },
@@ -30071,7 +30110,8 @@
30110 }
30111 },
30112 {
30074 - "nullable": true
30113 + "nullable": true,
30114 + "type": "object"
30115 }
30116 ]
30117 },
@@ -30196,7 +30236,8 @@
30236 "type": "string"
30237 },
30238 {
30199 - "nullable": true
30239 + "nullable": true,
30240 + "type": "object"
30241 }
30242 ]
30243 },
@@ -30212,7 +30253,8 @@
30253 }
30254 },
30255 {
30215 - "nullable": true
30256 + "nullable": true,
30257 + "type": "object"
30258 }
30259 ]
30260 },
@@ -34522,7 +34564,8 @@
34564 "type": "string"
34565 },
34566 {
34525 - "nullable": true
34567 + "nullable": true,
34568 + "type": "object"
34569 }
34570 ]
34571 },
@@ -34538,7 +34581,8 @@
34581 }
34582 },
34583 {
34541 - "nullable": true
34584 + "nullable": true,
34585 + "type": "object"
34586 }
34587 ]
34588 },
@@ -34663,7 +34707,8 @@
34707 "type": "string"
34708 },
34709 {
34666 - "nullable": true
34710 + "nullable": true,
34711 + "type": "object"
34712 }
34713 ]
34714 },
@@ -34679,7 +34724,8 @@
34724 }
34725 },
34726 {
34682 - "nullable": true
34727 + "nullable": true,
34728 + "type": "object"
34729 }
34730 ]
34731 },
@@ -37335,8 +37381,7 @@
37381 "required": false,
37382 "description": "Optional version of the tool to retrieve",
37383 "name": "version",
37338 - "in": "query",
37339 - "deprecated": true
37384 + "in": "query"
37385 },
37386 {
37387 "schema": {
@@ -37948,7 +37993,8 @@
37993 "type": "string"
37994 },
37995 {
37951 - "nullable": true
37996 + "nullable": true,
37997 + "type": "object"
37998 }
37999 ]
38000 },
@@ -37964,7 +38010,8 @@
38010 }
38011 },
38012 {
37967 - "nullable": true
38013 + "nullable": true,
38014 + "type": "object"
38015 }
38016 ]
38017 },
@@ -38116,7 +38163,8 @@
38163 "type": "string"
38164 },
38165 {
38119 - "nullable": true
38166 + "nullable": true,
38167 + "type": "object"
38168 }
38169 ]
38170 },
@@ -38132,7 +38180,8 @@
38180 }
38181 },
38182 {
38135 - "nullable": true
38183 + "nullable": true,
38184 + "type": "object"
38185 }
38186 ]
38187 },
@@ -39037,7 +39086,8 @@
39086 "example": {
39087 "session_id": "session-12345",
39088 "expires_at": "2023-01-01T13:00:00Z"
39040 - }
39089 + },
39090 + "type": "object"
39091 },
39092 "log_id": {
39093 "type": "string",
@@ -39378,7 +39428,8 @@
39428 "example": {
39429 "name": "New Resource",
39430 "description": "This is a new resource"
39381 - }
39431 + },
39432 + "type": "object"
39433 },
39434 "binary_body": {
39435 "anyOf": [
@@ -39578,7 +39629,8 @@
39629 "type": "string"
39630 },
39631 {
39581 - "nullable": true
39632 + "nullable": true,
39633 + "type": "object"
39634 }
39635 ]
39636 },
@@ -39594,7 +39646,8 @@
39646 }
39647 },
39648 {
39597 - "nullable": true
39649 + "nullable": true,
39650 + "type": "object"
39651 }
39652 ]
39653 },
@@ -39746,7 +39799,8 @@
39799 "type": "string"
39800 },
39801 {
39749 - "nullable": true
39802 + "nullable": true,
39803 + "type": "object"
39804 }
39805 ]
39806 },
@@ -39762,7 +39816,8 @@
39816 }
39817 },
39818 {
39765 - "nullable": true
39819 + "nullable": true,
39820 + "type": "object"
39821 }
39822 ]
39823 },
@@ -40620,7 +40675,8 @@
40675 "id": "123",
40676 "name": "Resource Name",
40677 "created_at": "2023-01-01T00:00:00Z"
40623 - }
40678 + },
40679 + "type": "object"
40680 },
40681 "binary_data": {
40682 "type": "object",
@@ -40779,6 +40835,8 @@
40835 },
40836 "/api/v3/trigger_instances/{slug}/upsert": {
40837 "post": {
40838 + "summary": "Create or update a trigger",
40839 + "description": "Creates a new trigger instance or updates an existing one with the same configuration. Triggers listen for events from external services (webhooks or polling) and can invoke your workflows. If a matching trigger already exists and is disabled, it will be re-enabled. Requires a connected account ID to associate the trigger with a specific user connection.",
40840 "tags": [
40841 "Triggers"
40842 ],
@@ -40846,7 +40904,8 @@
40904 }
40905 },
40906 {
40849 - "nullable": true
40907 + "nullable": true,
40908 + "type": "object"
40909 }
40910 ],
40911 "description": "Toolkit version specification. Supports \"latest\" string or a record mapping toolkit slugs to specific versions.",
@@ -41008,6 +41067,8 @@
41067 },
41068 "/api/v3/trigger_instances/active": {
41069 "get": {
41070 + "summary": "List active triggers",
41071 + "description": "Retrieves all active trigger instances for your project. Triggers listen for events from connected accounts (e.g., new emails, Slack messages, GitHub commits) and can invoke webhooks or workflows. Use filters to find triggers for specific users, connected accounts, or trigger types.",
41072 "tags": [
41073 "Triggers"
41074 ],
@@ -41404,6 +41465,8 @@
41465 },
41466 "/api/v3/trigger_instances/manage/{triggerId}": {
41467 "delete": {
41468 + "summary": "Delete a trigger",
41469 + "description": "Permanently deletes a trigger instance. This stops the trigger from listening for events and removes it from your project. Use the PATCH endpoint with status \"disable\" if you want to temporarily pause a trigger instead.",
41470 "tags": [
41471 "Triggers"
41472 ],
@@ -41510,6 +41573,8 @@
41573 }
41574 },
41575 "patch": {
41576 + "summary": "Enable or disable a trigger",
41577 + "description": "Updates the status of a trigger instance to enable or disable it. Disabling a trigger pauses event listening without deleting the trigger configuration. Re-enabling restores the trigger to its active state. Use this for temporary maintenance or to control trigger execution.",
41578 "tags": [
41579 "Triggers"
41580 ],
docs/scripts/fetch-openapi.mjs
+40 -12
@@ -108,23 +108,51 @@ async function fetchAndFilterSpec() {
108 console.log(`Removed ${removedCount} endpoints/operations`);
109 console.log(`Final spec has ${Object.keys(filteredPaths).length} paths`);
110
111 - // Fix invalid OpenAPI: "nullable" without "type" is not valid in OpenAPI 3.0
112 - // Transform {"nullable": true} to {} (allows any type)
113 - const specString = JSON.stringify(spec);
114 - const fixedSpecString = specString.replace(
115 - /"additionalProperties":\s*\{\s*"nullable":\s*true\s*\}/g,
116 - '"additionalProperties": {}'
117 - );
118 - const fixedSpec = JSON.parse(fixedSpecString);
119 - const fixCount = (specString.match(/"additionalProperties":\s*\{\s*"nullable":\s*true\s*\}/g) || []).length;
120 - if (fixCount > 0) {
121 - console.log(`Fixed ${fixCount} invalid additionalProperties schemas (nullable without type)`);
111 + // Fix invalid OpenAPI 3.0: "nullable: true" without "type" is invalid
112 + // See: https://swagger.io/docs/specification/data-models/data-types/#null
113 + let nullableFixCount = 0;
114 + const fixNullableWithoutType = (obj, parentKey = '') => {
115 + if (!obj || typeof obj !== 'object') return;
116 +
117 + // Check if this schema has nullable but no type definition
118 + if (obj.nullable === true && !obj.type && !obj.$ref && !obj.oneOf && !obj.anyOf && !obj.allOf) {
119 + // For additionalProperties, just remove nullable (allows any type)
120 + if (parentKey === 'additionalProperties') {
121 + delete obj.nullable;
122 + }
123 + // For schemas with an object example, infer type: object
124 + else if (obj.example && typeof obj.example === 'object' && !Array.isArray(obj.example)) {
125 + obj.type = 'object';
126 + }
127 + // For schemas with an array example, infer type: array
128 + else if (obj.example && Array.isArray(obj.example)) {
129 + obj.type = 'array';
130 + }
131 + // Default: add type: object (most common case for flexible schemas)
132 + else {
133 + obj.type = 'object';
134 + }
135 + nullableFixCount++;
136 + }
137 +
138 + // Recurse into all properties
139 + for (const [key, val] of Object.entries(obj)) {
140 + if (Array.isArray(val)) {
141 + val.forEach((item) => fixNullableWithoutType(item, key));
142 + } else {
143 + fixNullableWithoutType(val, key);
144 + }
145 + }
146 + };
147 + fixNullableWithoutType(spec);
148 + if (nullableFixCount > 0) {
149 + console.log(`Fixed ${nullableFixCount} schemas with nullable but no type`);
150 }
151
152 // Write to public directory for fumadocs to fetch
153 const __dirname = dirname(fileURLToPath(import.meta.url));
154 const outputPath = join(__dirname, '../public/openapi.json');
127 - writeFileSync(outputPath, JSON.stringify(fixedSpec, null, 2));
155 + writeFileSync(outputPath, JSON.stringify(spec, null, 2));
156
157 console.log(`Written to ${outputPath}`);
158 }