1
0

openapi.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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. "parameters": [
  218. {
  219. "name": "app",
  220. "in": "query",
  221. "description": "ID of the app",
  222. "required": true,
  223. "schema": {
  224. "type": "string"
  225. }
  226. },
  227. {
  228. "name": "formId",
  229. "in": "query",
  230. "description": "ID of the form",
  231. "required": true,
  232. "schema": {
  233. "type": "string"
  234. }
  235. },
  236. {
  237. "name": "fieldId",
  238. "in": "query",
  239. "description": "ID of the field",
  240. "required": true,
  241. "schema": {
  242. "type": "string"
  243. }
  244. },
  245. {
  246. "name": "value",
  247. "in": "query",
  248. "description": "Value to be saved",
  249. "required": true,
  250. "schema": {
  251. "type": "string"
  252. }
  253. },
  254. {
  255. "name": "OCS-APIRequest",
  256. "in": "header",
  257. "description": "Required to be true for the API request to pass",
  258. "required": true,
  259. "schema": {
  260. "type": "boolean",
  261. "default": true
  262. }
  263. }
  264. ],
  265. "responses": {
  266. "200": {
  267. "description": "Value set successfully",
  268. "content": {
  269. "application/json": {
  270. "schema": {
  271. "type": "object",
  272. "required": [
  273. "ocs"
  274. ],
  275. "properties": {
  276. "ocs": {
  277. "type": "object",
  278. "required": [
  279. "meta",
  280. "data"
  281. ],
  282. "properties": {
  283. "meta": {
  284. "$ref": "#/components/schemas/OCSMeta"
  285. },
  286. "data": {
  287. "nullable": true
  288. }
  289. }
  290. }
  291. }
  292. }
  293. }
  294. }
  295. },
  296. "500": {
  297. "description": "Not logged in or not an admin user",
  298. "content": {
  299. "text/plain": {
  300. "schema": {
  301. "type": "string"
  302. }
  303. }
  304. }
  305. },
  306. "400": {
  307. "description": "Invalid arguments to save value",
  308. "content": {
  309. "application/json": {
  310. "schema": {
  311. "type": "object",
  312. "required": [
  313. "ocs"
  314. ],
  315. "properties": {
  316. "ocs": {
  317. "type": "object",
  318. "required": [
  319. "meta",
  320. "data"
  321. ],
  322. "properties": {
  323. "meta": {
  324. "$ref": "#/components/schemas/OCSMeta"
  325. },
  326. "data": {}
  327. }
  328. }
  329. }
  330. }
  331. }
  332. }
  333. }
  334. }
  335. }
  336. },
  337. "/ocs/v2.php/settings/api/declarative/forms": {
  338. "get": {
  339. "operationId": "declarative_settings-get-forms",
  340. "summary": "Gets all declarative forms with the values prefilled.",
  341. "tags": [
  342. "declarative_settings"
  343. ],
  344. "security": [
  345. {
  346. "bearer_auth": []
  347. },
  348. {
  349. "basic_auth": []
  350. }
  351. ],
  352. "parameters": [
  353. {
  354. "name": "OCS-APIRequest",
  355. "in": "header",
  356. "description": "Required to be true for the API request to pass",
  357. "required": true,
  358. "schema": {
  359. "type": "boolean",
  360. "default": true
  361. }
  362. }
  363. ],
  364. "responses": {
  365. "200": {
  366. "description": "Forms returned",
  367. "content": {
  368. "application/json": {
  369. "schema": {
  370. "type": "object",
  371. "required": [
  372. "ocs"
  373. ],
  374. "properties": {
  375. "ocs": {
  376. "type": "object",
  377. "required": [
  378. "meta",
  379. "data"
  380. ],
  381. "properties": {
  382. "meta": {
  383. "$ref": "#/components/schemas/OCSMeta"
  384. },
  385. "data": {
  386. "type": "array",
  387. "items": {
  388. "$ref": "#/components/schemas/DeclarativeForm"
  389. }
  390. }
  391. }
  392. }
  393. }
  394. }
  395. }
  396. }
  397. },
  398. "500": {
  399. "description": "",
  400. "content": {
  401. "text/plain": {
  402. "schema": {
  403. "type": "string"
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }
  410. }
  411. },
  412. "tags": []
  413. }