| 1 |
{ |
| 2 |
"apiVersion": 3, |
| 3 |
"$schema": "https://schemas.wp.org/trunk/block.json", |
| 4 |
"name": "blockenberg/api-reference", |
| 5 |
"title": "API Reference", |
| 6 |
"category": "bkbg-dev", |
| 7 |
"icon": "rest-api", |
| 8 |
"description": "Display API endpoint documentation with method badge, parameters table, and request/response code examples.", |
| 9 |
"keywords": [ |
| 10 |
"api", |
| 11 |
"rest", |
| 12 |
"endpoint", |
| 13 |
"documentation", |
| 14 |
"developer", |
| 15 |
"code", |
| 16 |
"http", |
| 17 |
"request", |
| 18 |
"response", |
| 19 |
"curl" |
| 20 |
], |
| 21 |
"textdomain": "blockenberg", |
| 22 |
"editorScript": "bkbg-api-reference-editor", |
| 23 |
"editorStyle": "bkbg-api-reference-style", |
| 24 |
"style": "bkbg-api-reference-style", |
| 25 |
"viewScript": "bkbg-api-reference-frontend", |
| 26 |
"supports": { |
| 27 |
"html": false, |
| 28 |
"anchor": true, |
| 29 |
"className": true, |
| 30 |
"align": [ |
| 31 |
"wide", |
| 32 |
"full" |
| 33 |
] |
| 34 |
}, |
| 35 |
"attributes": { |
| 36 |
"method": { |
| 37 |
"type": "string", |
| 38 |
"default": "GET" |
| 39 |
}, |
| 40 |
"endpoint": { |
| 41 |
"type": "string", |
| 42 |
"default": "/api/v1/users/{id}" |
| 43 |
}, |
| 44 |
"baseUrl": { |
| 45 |
"type": "string", |
| 46 |
"default": "https://api.example.com" |
| 47 |
}, |
| 48 |
"title": { |
| 49 |
"type": "string", |
| 50 |
"default": "Get User" |
| 51 |
}, |
| 52 |
"description": { |
| 53 |
"type": "string", |
| 54 |
"default": "Retrieve a single user by their unique ID." |
| 55 |
}, |
| 56 |
"authType": { |
| 57 |
"type": "string", |
| 58 |
"default": "bearer" |
| 59 |
}, |
| 60 |
"params": { |
| 61 |
"type": "array", |
| 62 |
"default": [ |
| 63 |
{ |
| 64 |
"name": "id", |
| 65 |
"type": "integer", |
| 66 |
"required": true, |
| 67 |
"location": "path", |
| 68 |
"description": "The unique user ID", |
| 69 |
"example": "42" |
| 70 |
}, |
| 71 |
{ |
| 72 |
"name": "include", |
| 73 |
"type": "string", |
| 74 |
"required": false, |
| 75 |
"location": "query", |
| 76 |
"description": "Comma-separated fields to include", |
| 77 |
"example": "name,email,avatar" |
| 78 |
}, |
| 79 |
{ |
| 80 |
"name": "Authorization", |
| 81 |
"type": "string", |
| 82 |
"required": true, |
| 83 |
"location": "header", |
| 84 |
"description": "Bearer token for authentication", |
| 85 |
"example": "Bearer eyJhbGci..." |
| 86 |
} |
| 87 |
] |
| 88 |
}, |
| 89 |
"requestExample": { |
| 90 |
"type": "string", |
| 91 |
"default": "curl -X GET \"https://api.example.com/api/v1/users/42\" \\\n -H \"Authorization: Bearer YOUR_TOKEN\" \\\n -H \"Content-Type: application/json\"" |
| 92 |
}, |
| 93 |
"responseExample": { |
| 94 |
"type": "string", |
| 95 |
"default": "{\n \"id\": 42,\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"avatar\": \"https://cdn.example.com/avatars/42.jpg\",\n \"created_at\": \"2025-01-15T10:30:00Z\",\n \"status\": \"active\"\n}" |
| 96 |
}, |
| 97 |
"requestLang": { |
| 98 |
"type": "string", |
| 99 |
"default": "curl" |
| 100 |
}, |
| 101 |
"responseLang": { |
| 102 |
"type": "string", |
| 103 |
"default": "json" |
| 104 |
}, |
| 105 |
"showCopyButton": { |
| 106 |
"type": "boolean", |
| 107 |
"default": true |
| 108 |
}, |
| 109 |
"showBaseUrl": { |
| 110 |
"type": "boolean", |
| 111 |
"default": true |
| 112 |
}, |
| 113 |
"showAuth": { |
| 114 |
"type": "boolean", |
| 115 |
"default": true |
| 116 |
}, |
| 117 |
"defaultTab": { |
| 118 |
"type": "string", |
| 119 |
"default": "params" |
| 120 |
}, |
| 121 |
"codeTheme": { |
| 122 |
"type": "string", |
| 123 |
"default": "dark" |
| 124 |
}, |
| 125 |
"getBg": { |
| 126 |
"type": "string", |
| 127 |
"default": "#22c55e" |
| 128 |
}, |
| 129 |
"postBg": { |
| 130 |
"type": "string", |
| 131 |
"default": "#3b82f6" |
| 132 |
}, |
| 133 |
"putBg": { |
| 134 |
"type": "string", |
| 135 |
"default": "#f59e0b" |
| 136 |
}, |
| 137 |
"patchBg": { |
| 138 |
"type": "string", |
| 139 |
"default": "#8b5cf6" |
| 140 |
}, |
| 141 |
"deleteBg": { |
| 142 |
"type": "string", |
| 143 |
"default": "#ef4444" |
| 144 |
}, |
| 145 |
"headerBg": { |
| 146 |
"type": "string", |
| 147 |
"default": "#1e1e2e" |
| 148 |
}, |
| 149 |
"headerColor": { |
| 150 |
"type": "string", |
| 151 |
"default": "#e2e8f0" |
| 152 |
}, |
| 153 |
"tableBg": { |
| 154 |
"type": "string", |
| 155 |
"default": "#ffffff" |
| 156 |
}, |
| 157 |
"tableAltBg": { |
| 158 |
"type": "string", |
| 159 |
"default": "#f8fafc" |
| 160 |
}, |
| 161 |
"borderColor": { |
| 162 |
"type": "string", |
| 163 |
"default": "#e2e8f0" |
| 164 |
}, |
| 165 |
"endpointBg": { |
| 166 |
"type": "string", |
| 167 |
"default": "#0f172a" |
| 168 |
}, |
| 169 |
"endpointColor": { |
| 170 |
"type": "string", |
| 171 |
"default": "#94a3b8" |
| 172 |
}, |
| 173 |
"borderRadius": { |
| 174 |
"type": "number", |
| 175 |
"default": 8 |
| 176 |
}, |
| 177 |
"fontSize": { |
| 178 |
"type": "number", |
| 179 |
"default": 13 |
| 180 |
}, |
| 181 |
"textTypo": { |
| 182 |
"type": "object", |
| 183 |
"default": {} |
| 184 |
} |
| 185 |
} |
| 186 |
} |
| 187 |
|