1
0

openapi.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "settings",
  5. "version": "0.0.1",
  6. "description": "Nextcloud settings",
  7. "license": {
  8. "name": "agpl"
  9. }
  10. },
  11. "components": {
  12. "securitySchemes": {
  13. "basic_auth": {
  14. "type": "http",
  15. "scheme": "basic"
  16. },
  17. "bearer_auth": {
  18. "type": "http",
  19. "scheme": "bearer"
  20. }
  21. },
  22. "schemas": {
  23. "DeclarativeForm": {
  24. "type": "object",
  25. "required": [
  26. "id",
  27. "priority",
  28. "section_type",
  29. "section_id",
  30. "storage_type",
  31. "title",
  32. "app",
  33. "fields"
  34. ],
  35. "properties": {
  36. "id": {
  37. "type": "string"
  38. },
  39. "priority": {
  40. "type": "integer",
  41. "format": "int64"
  42. },
  43. "section_type": {
  44. "type": "string",
  45. "enum": [
  46. "admin",
  47. "personal"
  48. ]
  49. },
  50. "section_id": {
  51. "type": "string"
  52. },
  53. "storage_type": {
  54. "type": "string",
  55. "enum": [
  56. "internal",
  57. "external"
  58. ]
  59. },
  60. "title": {
  61. "type": "string"
  62. },
  63. "description": {
  64. "type": "string"
  65. },
  66. "doc_url": {
  67. "type": "string"
  68. },
  69. "app": {
  70. "type": "string"
  71. },
  72. "fields": {
  73. "type": "array",
  74. "items": {
  75. "$ref": "#/components/schemas/DeclarativeFormField"
  76. }
  77. }
  78. }
  79. },
  80. "DeclarativeFormField": {
  81. "type": "object",
  82. "required": [
  83. "id",
  84. "title",
  85. "type",
  86. "default",
  87. "value"
  88. ],
  89. "properties": {
  90. "id": {
  91. "type": "string"
  92. },
  93. "title": {
  94. "type": "string"
  95. },
  96. "description": {
  97. "type": "string"
  98. },
  99. "type": {
  100. "type": "string",
  101. "enum": [
  102. "text",
  103. "password",
  104. "email",
  105. "tel",
  106. "url",
  107. "number",
  108. "checkbox",
  109. "multi-checkbox",
  110. "radio",
  111. "select",
  112. "multi-select"
  113. ]
  114. },
  115. "placeholder": {
  116. "type": "string"
  117. },
  118. "label": {
  119. "type": "string"
  120. },
  121. "default": {
  122. "type": "object"
  123. },
  124. "options": {
  125. "type": "array",
  126. "items": {
  127. "oneOf": [
  128. {
  129. "type": "string"
  130. },
  131. {
  132. "type": "object",
  133. "required": [
  134. "name",
  135. "value"
  136. ],
  137. "properties": {
  138. "name": {
  139. "type": "string"
  140. },
  141. "value": {
  142. "type": "object"
  143. }
  144. }
  145. }
  146. ]
  147. }
  148. },
  149. "value": {
  150. "anyOf": [
  151. {
  152. "type": "string"
  153. },
  154. {
  155. "type": "integer",
  156. "format": "int64"
  157. },
  158. {
  159. "type": "number",
  160. "format": "double"
  161. },
  162. {
  163. "type": "boolean"
  164. },
  165. {
  166. "type": "array",
  167. "items": {
  168. "type": "string"
  169. }
  170. }
  171. ]
  172. }
  173. }
  174. },
  175. "OCSMeta": {
  176. "type": "object",
  177. "required": [
  178. "status",
  179. "statuscode"
  180. ],
  181. "properties": {
  182. "status": {
  183. "type": "string"
  184. },
  185. "statuscode": {
  186. "type": "integer"
  187. },
  188. "message": {
  189. "type": "string"
  190. },
  191. "totalitems": {
  192. "type": "string"
  193. },
  194. "itemsperpage": {
  195. "type": "string"
  196. }
  197. }
  198. }
  199. }
  200. },
  201. "paths": {
  202. "/ocs/v2.php/settings/api/declarative/value": {
  203. "post": {
  204. "operationId": "declarative_settings-set-value",
  205. "summary": "Sets a declarative settings value",
  206. "tags": [
  207. "declarative_settings"
  208. ],
  209. "security": [
  210. {
  211. "bearer_auth": []
  212. },
  213. {
  214. "basic_auth": []
  215. }
  216. ],
  217. "requestBody": {
  218. "required": true,
  219. "content": {
  220. "application/json": {
  221. "schema": {
  222. "type": "object",
  223. "required": [
  224. "app",
  225. "formId",
  226. "fieldId",
  227. "value"
  228. ],
  229. "properties": {
  230. "app": {
  231. "type": "string",
  232. "description": "ID of the app"
  233. },
  234. "formId": {
  235. "type": "string",
  236. "description": "ID of the form"
  237. },
  238. "fieldId": {
  239. "type": "string",
  240. "description": "ID of the field"
  241. },
  242. "value": {
  243. "type": "object",
  244. "description": "Value to be saved"
  245. }
  246. }
  247. }
  248. }
  249. }
  250. },
  251. "parameters": [
  252. {
  253. "name": "OCS-APIRequest",
  254. "in": "header",
  255. "description": "Required to be true for the API request to pass",
  256. "required": true,
  257. "schema": {
  258. "type": "boolean",
  259. "default": true
  260. }
  261. }
  262. ],
  263. "responses": {
  264. "200": {
  265. "description": "Value set successfully",
  266. "content": {
  267. "application/json": {
  268. "schema": {
  269. "type": "object",
  270. "required": [
  271. "ocs"
  272. ],
  273. "properties": {
  274. "ocs": {
  275. "type": "object",
  276. "required": [
  277. "meta",
  278. "data"
  279. ],
  280. "properties": {
  281. "meta": {
  282. "$ref": "#/components/schemas/OCSMeta"
  283. },
  284. "data": {
  285. "nullable": true
  286. }
  287. }
  288. }
  289. }
  290. }
  291. }
  292. }
  293. },
  294. "500": {
  295. "description": "Not logged in or not an admin user",
  296. "content": {
  297. "text/plain": {
  298. "schema": {
  299. "type": "string"
  300. }
  301. }
  302. }
  303. },
  304. "400": {
  305. "description": "Invalid arguments to save value",
  306. "content": {
  307. "application/json": {
  308. "schema": {
  309. "type": "object",
  310. "required": [
  311. "ocs"
  312. ],
  313. "properties": {
  314. "ocs": {
  315. "type": "object",
  316. "required": [
  317. "meta",
  318. "data"
  319. ],
  320. "properties": {
  321. "meta": {
  322. "$ref": "#/components/schemas/OCSMeta"
  323. },
  324. "data": {}
  325. }
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. }
  333. }
  334. },
  335. "/ocs/v2.php/settings/api/declarative/forms": {
  336. "get": {
  337. "operationId": "declarative_settings-get-forms",
  338. "summary": "Gets all declarative forms with the values prefilled.",
  339. "tags": [
  340. "declarative_settings"
  341. ],
  342. "security": [
  343. {
  344. "bearer_auth": []
  345. },
  346. {
  347. "basic_auth": []
  348. }
  349. ],
  350. "parameters": [
  351. {
  352. "name": "OCS-APIRequest",
  353. "in": "header",
  354. "description": "Required to be true for the API request to pass",
  355. "required": true,
  356. "schema": {
  357. "type": "boolean",
  358. "default": true
  359. }
  360. }
  361. ],
  362. "responses": {
  363. "200": {
  364. "description": "Forms returned",
  365. "content": {
  366. "application/json": {
  367. "schema": {
  368. "type": "object",
  369. "required": [
  370. "ocs"
  371. ],
  372. "properties": {
  373. "ocs": {
  374. "type": "object",
  375. "required": [
  376. "meta",
  377. "data"
  378. ],
  379. "properties": {
  380. "meta": {
  381. "$ref": "#/components/schemas/OCSMeta"
  382. },
  383. "data": {
  384. "type": "array",
  385. "items": {
  386. "$ref": "#/components/schemas/DeclarativeForm"
  387. }
  388. }
  389. }
  390. }
  391. }
  392. }
  393. }
  394. }
  395. },
  396. "500": {
  397. "description": "",
  398. "content": {
  399. "text/plain": {
  400. "schema": {
  401. "type": "string"
  402. }
  403. }
  404. }
  405. }
  406. }
  407. }
  408. }
  409. },
  410. "tags": []
  411. }