You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openapi.json 42KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "weather_status",
  5. "version": "0.0.1",
  6. "description": "Weather status in your dashboard",
  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. "Capabilities": {
  24. "type": "object",
  25. "required": [
  26. "weather_status"
  27. ],
  28. "properties": {
  29. "weather_status": {
  30. "type": "object",
  31. "required": [
  32. "enabled"
  33. ],
  34. "properties": {
  35. "enabled": {
  36. "type": "boolean"
  37. }
  38. }
  39. }
  40. }
  41. },
  42. "Forecast": {
  43. "type": "object",
  44. "required": [
  45. "time",
  46. "data"
  47. ],
  48. "properties": {
  49. "time": {
  50. "type": "string"
  51. },
  52. "data": {
  53. "type": "object",
  54. "required": [
  55. "instant",
  56. "next_12_hours",
  57. "next_1_hours",
  58. "next_6_hours"
  59. ],
  60. "properties": {
  61. "instant": {
  62. "type": "object",
  63. "required": [
  64. "details"
  65. ],
  66. "properties": {
  67. "details": {
  68. "type": "object",
  69. "required": [
  70. "air_pressure_at_sea_level",
  71. "air_temperature",
  72. "cloud_area_fraction",
  73. "cloud_area_fraction_high",
  74. "cloud_area_fraction_low",
  75. "cloud_area_fraction_medium",
  76. "dew_point_temperature",
  77. "fog_area_fraction",
  78. "relative_humidity",
  79. "ultraviolet_index_clear_sky",
  80. "wind_from_direction",
  81. "wind_speed",
  82. "wind_speed_of_gust"
  83. ],
  84. "properties": {
  85. "air_pressure_at_sea_level": {
  86. "type": "number",
  87. "format": "float"
  88. },
  89. "air_temperature": {
  90. "type": "number",
  91. "format": "float"
  92. },
  93. "cloud_area_fraction": {
  94. "type": "number",
  95. "format": "float"
  96. },
  97. "cloud_area_fraction_high": {
  98. "type": "number",
  99. "format": "float"
  100. },
  101. "cloud_area_fraction_low": {
  102. "type": "number",
  103. "format": "float"
  104. },
  105. "cloud_area_fraction_medium": {
  106. "type": "number",
  107. "format": "float"
  108. },
  109. "dew_point_temperature": {
  110. "type": "number",
  111. "format": "float"
  112. },
  113. "fog_area_fraction": {
  114. "type": "number",
  115. "format": "float"
  116. },
  117. "relative_humidity": {
  118. "type": "number",
  119. "format": "float"
  120. },
  121. "ultraviolet_index_clear_sky": {
  122. "type": "number",
  123. "format": "float"
  124. },
  125. "wind_from_direction": {
  126. "type": "number",
  127. "format": "float"
  128. },
  129. "wind_speed": {
  130. "type": "number",
  131. "format": "float"
  132. },
  133. "wind_speed_of_gust": {
  134. "type": "number",
  135. "format": "float"
  136. }
  137. }
  138. }
  139. }
  140. },
  141. "next_12_hours": {
  142. "type": "object",
  143. "required": [
  144. "summary",
  145. "details"
  146. ],
  147. "properties": {
  148. "summary": {
  149. "type": "object",
  150. "required": [
  151. "symbol_code"
  152. ],
  153. "properties": {
  154. "symbol_code": {
  155. "type": "string"
  156. }
  157. }
  158. },
  159. "details": {
  160. "type": "object",
  161. "required": [
  162. "probability_of_precipitation"
  163. ],
  164. "properties": {
  165. "probability_of_precipitation": {
  166. "type": "number",
  167. "format": "float"
  168. }
  169. }
  170. }
  171. }
  172. },
  173. "next_1_hours": {
  174. "type": "object",
  175. "required": [
  176. "summary",
  177. "details"
  178. ],
  179. "properties": {
  180. "summary": {
  181. "type": "object",
  182. "required": [
  183. "symbol_code"
  184. ],
  185. "properties": {
  186. "symbol_code": {
  187. "type": "string"
  188. }
  189. }
  190. },
  191. "details": {
  192. "type": "object",
  193. "required": [
  194. "precipitation_amount",
  195. "precipitation_amount_max",
  196. "precipitation_amount_min",
  197. "probability_of_precipitation",
  198. "probability_of_thunder"
  199. ],
  200. "properties": {
  201. "precipitation_amount": {
  202. "type": "number",
  203. "format": "float"
  204. },
  205. "precipitation_amount_max": {
  206. "type": "number",
  207. "format": "float"
  208. },
  209. "precipitation_amount_min": {
  210. "type": "number",
  211. "format": "float"
  212. },
  213. "probability_of_precipitation": {
  214. "type": "number",
  215. "format": "float"
  216. },
  217. "probability_of_thunder": {
  218. "type": "number",
  219. "format": "float"
  220. }
  221. }
  222. }
  223. }
  224. },
  225. "next_6_hours": {
  226. "type": "object",
  227. "required": [
  228. "summary",
  229. "details"
  230. ],
  231. "properties": {
  232. "summary": {
  233. "type": "object",
  234. "required": [
  235. "symbol_code"
  236. ],
  237. "properties": {
  238. "symbol_code": {
  239. "type": "string"
  240. }
  241. }
  242. },
  243. "details": {
  244. "type": "object",
  245. "required": [
  246. "air_temperature_max",
  247. "air_temperature_min",
  248. "precipitation_amount",
  249. "precipitation_amount_max",
  250. "precipitation_amount_min",
  251. "probability_of_precipitation"
  252. ],
  253. "properties": {
  254. "air_temperature_max": {
  255. "type": "number",
  256. "format": "float"
  257. },
  258. "air_temperature_min": {
  259. "type": "number",
  260. "format": "float"
  261. },
  262. "precipitation_amount": {
  263. "type": "number",
  264. "format": "float"
  265. },
  266. "precipitation_amount_max": {
  267. "type": "number",
  268. "format": "float"
  269. },
  270. "precipitation_amount_min": {
  271. "type": "number",
  272. "format": "float"
  273. },
  274. "probability_of_precipitation": {
  275. "type": "number",
  276. "format": "float"
  277. }
  278. }
  279. }
  280. }
  281. }
  282. }
  283. }
  284. }
  285. },
  286. "OCSMeta": {
  287. "type": "object",
  288. "required": [
  289. "status",
  290. "statuscode"
  291. ],
  292. "properties": {
  293. "status": {
  294. "type": "string"
  295. },
  296. "statuscode": {
  297. "type": "integer"
  298. },
  299. "message": {
  300. "type": "string"
  301. },
  302. "totalitems": {
  303. "type": "string"
  304. },
  305. "itemsperpage": {
  306. "type": "string"
  307. }
  308. }
  309. }
  310. }
  311. },
  312. "paths": {
  313. "/ocs/v2.php/apps/weather_status/api/v1/mode": {
  314. "put": {
  315. "operationId": "weather_status-set-mode",
  316. "summary": "Change the weather status mode. There are currently 2 modes: - ask the browser - use the user defined address",
  317. "tags": [
  318. "weather_status"
  319. ],
  320. "security": [
  321. {
  322. "bearer_auth": []
  323. },
  324. {
  325. "basic_auth": []
  326. }
  327. ],
  328. "parameters": [
  329. {
  330. "name": "mode",
  331. "in": "query",
  332. "description": "New mode",
  333. "required": true,
  334. "schema": {
  335. "type": "integer",
  336. "format": "int64"
  337. }
  338. },
  339. {
  340. "name": "OCS-APIRequest",
  341. "in": "header",
  342. "required": true,
  343. "schema": {
  344. "type": "string",
  345. "default": "true"
  346. }
  347. }
  348. ],
  349. "responses": {
  350. "200": {
  351. "description": "Weather status mode updated",
  352. "content": {
  353. "application/json": {
  354. "schema": {
  355. "type": "object",
  356. "required": [
  357. "ocs"
  358. ],
  359. "properties": {
  360. "ocs": {
  361. "type": "object",
  362. "required": [
  363. "meta",
  364. "data"
  365. ],
  366. "properties": {
  367. "meta": {
  368. "$ref": "#/components/schemas/OCSMeta"
  369. },
  370. "data": {
  371. "type": "object",
  372. "required": [
  373. "success"
  374. ],
  375. "properties": {
  376. "success": {
  377. "type": "boolean"
  378. }
  379. }
  380. }
  381. }
  382. }
  383. }
  384. }
  385. }
  386. }
  387. }
  388. }
  389. }
  390. },
  391. "/ocs/v2.php/apps/weather_status/api/v1/use-personal": {
  392. "put": {
  393. "operationId": "weather_status-use-personal-address",
  394. "summary": "Try to use the address set in user personal settings as weather location",
  395. "tags": [
  396. "weather_status"
  397. ],
  398. "security": [
  399. {
  400. "bearer_auth": []
  401. },
  402. {
  403. "basic_auth": []
  404. }
  405. ],
  406. "parameters": [
  407. {
  408. "name": "OCS-APIRequest",
  409. "in": "header",
  410. "required": true,
  411. "schema": {
  412. "type": "string",
  413. "default": "true"
  414. }
  415. }
  416. ],
  417. "responses": {
  418. "200": {
  419. "description": "Address updated",
  420. "content": {
  421. "application/json": {
  422. "schema": {
  423. "type": "object",
  424. "required": [
  425. "ocs"
  426. ],
  427. "properties": {
  428. "ocs": {
  429. "type": "object",
  430. "required": [
  431. "meta",
  432. "data"
  433. ],
  434. "properties": {
  435. "meta": {
  436. "$ref": "#/components/schemas/OCSMeta"
  437. },
  438. "data": {
  439. "type": "object",
  440. "required": [
  441. "success",
  442. "lat",
  443. "lon",
  444. "address"
  445. ],
  446. "properties": {
  447. "success": {
  448. "type": "boolean"
  449. },
  450. "lat": {
  451. "type": "number",
  452. "format": "float",
  453. "nullable": true
  454. },
  455. "lon": {
  456. "type": "number",
  457. "format": "float",
  458. "nullable": true
  459. },
  460. "address": {
  461. "type": "string",
  462. "nullable": true
  463. }
  464. }
  465. }
  466. }
  467. }
  468. }
  469. }
  470. }
  471. }
  472. }
  473. }
  474. }
  475. },
  476. "/ocs/v2.php/apps/weather_status/api/v1/location": {
  477. "get": {
  478. "operationId": "weather_status-get-location",
  479. "summary": "Get stored user location",
  480. "tags": [
  481. "weather_status"
  482. ],
  483. "security": [
  484. {
  485. "bearer_auth": []
  486. },
  487. {
  488. "basic_auth": []
  489. }
  490. ],
  491. "parameters": [
  492. {
  493. "name": "OCS-APIRequest",
  494. "in": "header",
  495. "required": true,
  496. "schema": {
  497. "type": "string",
  498. "default": "true"
  499. }
  500. }
  501. ],
  502. "responses": {
  503. "200": {
  504. "description": "Location returned",
  505. "content": {
  506. "application/json": {
  507. "schema": {
  508. "type": "object",
  509. "required": [
  510. "ocs"
  511. ],
  512. "properties": {
  513. "ocs": {
  514. "type": "object",
  515. "required": [
  516. "meta",
  517. "data"
  518. ],
  519. "properties": {
  520. "meta": {
  521. "$ref": "#/components/schemas/OCSMeta"
  522. },
  523. "data": {
  524. "type": "object",
  525. "required": [
  526. "lat",
  527. "lon",
  528. "address",
  529. "mode"
  530. ],
  531. "properties": {
  532. "lat": {
  533. "type": "number",
  534. "format": "float"
  535. },
  536. "lon": {
  537. "type": "number",
  538. "format": "float"
  539. },
  540. "address": {
  541. "type": "string"
  542. },
  543. "mode": {
  544. "type": "integer",
  545. "format": "int64"
  546. }
  547. }
  548. }
  549. }
  550. }
  551. }
  552. }
  553. }
  554. }
  555. }
  556. }
  557. },
  558. "put": {
  559. "operationId": "weather_status-set-location",
  560. "summary": "Set address and resolve it to get coordinates or directly set coordinates and get address with reverse geocoding",
  561. "tags": [
  562. "weather_status"
  563. ],
  564. "security": [
  565. {
  566. "bearer_auth": []
  567. },
  568. {
  569. "basic_auth": []
  570. }
  571. ],
  572. "parameters": [
  573. {
  574. "name": "address",
  575. "in": "query",
  576. "description": "Any approximative or exact address",
  577. "schema": {
  578. "type": "string",
  579. "nullable": true
  580. }
  581. },
  582. {
  583. "name": "lat",
  584. "in": "query",
  585. "description": "Latitude in decimal degree format",
  586. "schema": {
  587. "type": "number",
  588. "format": "float",
  589. "nullable": true
  590. }
  591. },
  592. {
  593. "name": "lon",
  594. "in": "query",
  595. "description": "Longitude in decimal degree format",
  596. "schema": {
  597. "type": "number",
  598. "format": "float",
  599. "nullable": true
  600. }
  601. },
  602. {
  603. "name": "OCS-APIRequest",
  604. "in": "header",
  605. "required": true,
  606. "schema": {
  607. "type": "string",
  608. "default": "true"
  609. }
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "Location updated",
  615. "content": {
  616. "application/json": {
  617. "schema": {
  618. "type": "object",
  619. "required": [
  620. "ocs"
  621. ],
  622. "properties": {
  623. "ocs": {
  624. "type": "object",
  625. "required": [
  626. "meta",
  627. "data"
  628. ],
  629. "properties": {
  630. "meta": {
  631. "$ref": "#/components/schemas/OCSMeta"
  632. },
  633. "data": {
  634. "type": "object",
  635. "required": [
  636. "success",
  637. "lat",
  638. "lon",
  639. "address"
  640. ],
  641. "properties": {
  642. "success": {
  643. "type": "boolean"
  644. },
  645. "lat": {
  646. "type": "number",
  647. "format": "float",
  648. "nullable": true
  649. },
  650. "lon": {
  651. "type": "number",
  652. "format": "float",
  653. "nullable": true
  654. },
  655. "address": {
  656. "type": "string",
  657. "nullable": true
  658. }
  659. }
  660. }
  661. }
  662. }
  663. }
  664. }
  665. }
  666. }
  667. }
  668. }
  669. }
  670. },
  671. "/ocs/v2.php/apps/weather_status/api/v1/forecast": {
  672. "get": {
  673. "operationId": "weather_status-get-forecast",
  674. "summary": "Get forecast for current location",
  675. "tags": [
  676. "weather_status"
  677. ],
  678. "security": [
  679. {
  680. "bearer_auth": []
  681. },
  682. {
  683. "basic_auth": []
  684. }
  685. ],
  686. "parameters": [
  687. {
  688. "name": "OCS-APIRequest",
  689. "in": "header",
  690. "required": true,
  691. "schema": {
  692. "type": "string",
  693. "default": "true"
  694. }
  695. }
  696. ],
  697. "responses": {
  698. "200": {
  699. "description": "Forecast returned",
  700. "content": {
  701. "application/json": {
  702. "schema": {
  703. "type": "object",
  704. "required": [
  705. "ocs"
  706. ],
  707. "properties": {
  708. "ocs": {
  709. "type": "object",
  710. "required": [
  711. "meta",
  712. "data"
  713. ],
  714. "properties": {
  715. "meta": {
  716. "$ref": "#/components/schemas/OCSMeta"
  717. },
  718. "data": {
  719. "type": "array",
  720. "items": {
  721. "$ref": "#/components/schemas/Forecast"
  722. }
  723. }
  724. }
  725. }
  726. }
  727. }
  728. }
  729. }
  730. },
  731. "404": {
  732. "description": "Forecast not found",
  733. "content": {
  734. "application/json": {
  735. "schema": {
  736. "type": "object",
  737. "required": [
  738. "ocs"
  739. ],
  740. "properties": {
  741. "ocs": {
  742. "type": "object",
  743. "required": [
  744. "meta",
  745. "data"
  746. ],
  747. "properties": {
  748. "meta": {
  749. "$ref": "#/components/schemas/OCSMeta"
  750. },
  751. "data": {
  752. "type": "object",
  753. "required": [
  754. "success"
  755. ],
  756. "properties": {
  757. "success": {
  758. "type": "boolean"
  759. }
  760. }
  761. }
  762. }
  763. }
  764. }
  765. }
  766. }
  767. }
  768. }
  769. }
  770. }
  771. },
  772. "/ocs/v2.php/apps/weather_status/api/v1/favorites": {
  773. "get": {
  774. "operationId": "weather_status-get-favorites",
  775. "summary": "Get favorites list",
  776. "tags": [
  777. "weather_status"
  778. ],
  779. "security": [
  780. {
  781. "bearer_auth": []
  782. },
  783. {
  784. "basic_auth": []
  785. }
  786. ],
  787. "parameters": [
  788. {
  789. "name": "OCS-APIRequest",
  790. "in": "header",
  791. "required": true,
  792. "schema": {
  793. "type": "string",
  794. "default": "true"
  795. }
  796. }
  797. ],
  798. "responses": {
  799. "200": {
  800. "description": "Favorites returned",
  801. "content": {
  802. "application/json": {
  803. "schema": {
  804. "type": "object",
  805. "required": [
  806. "ocs"
  807. ],
  808. "properties": {
  809. "ocs": {
  810. "type": "object",
  811. "required": [
  812. "meta",
  813. "data"
  814. ],
  815. "properties": {
  816. "meta": {
  817. "$ref": "#/components/schemas/OCSMeta"
  818. },
  819. "data": {
  820. "type": "array",
  821. "items": {
  822. "type": "string"
  823. }
  824. }
  825. }
  826. }
  827. }
  828. }
  829. }
  830. }
  831. }
  832. }
  833. },
  834. "put": {
  835. "operationId": "weather_status-set-favorites",
  836. "summary": "Set favorites list",
  837. "tags": [
  838. "weather_status"
  839. ],
  840. "security": [
  841. {
  842. "bearer_auth": []
  843. },
  844. {
  845. "basic_auth": []
  846. }
  847. ],
  848. "parameters": [
  849. {
  850. "name": "favorites[]",
  851. "in": "query",
  852. "description": "Favorite addresses",
  853. "required": true,
  854. "schema": {
  855. "type": "array",
  856. "items": {
  857. "type": "string"
  858. }
  859. }
  860. },
  861. {
  862. "name": "OCS-APIRequest",
  863. "in": "header",
  864. "required": true,
  865. "schema": {
  866. "type": "string",
  867. "default": "true"
  868. }
  869. }
  870. ],
  871. "responses": {
  872. "200": {
  873. "description": "Favorites updated",
  874. "content": {
  875. "application/json": {
  876. "schema": {
  877. "type": "object",
  878. "required": [
  879. "ocs"
  880. ],
  881. "properties": {
  882. "ocs": {
  883. "type": "object",
  884. "required": [
  885. "meta",
  886. "data"
  887. ],
  888. "properties": {
  889. "meta": {
  890. "$ref": "#/components/schemas/OCSMeta"
  891. },
  892. "data": {
  893. "type": "object",
  894. "required": [
  895. "success"
  896. ],
  897. "properties": {
  898. "success": {
  899. "type": "boolean"
  900. }
  901. }
  902. }
  903. }
  904. }
  905. }
  906. }
  907. }
  908. }
  909. }
  910. }
  911. }
  912. }
  913. },
  914. "tags": []
  915. }