openapi.json 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  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. "description": "Required to be true for the API request to pass",
  343. "required": true,
  344. "schema": {
  345. "type": "boolean",
  346. "default": true
  347. }
  348. }
  349. ],
  350. "responses": {
  351. "200": {
  352. "description": "Weather status mode updated",
  353. "content": {
  354. "application/json": {
  355. "schema": {
  356. "type": "object",
  357. "required": [
  358. "ocs"
  359. ],
  360. "properties": {
  361. "ocs": {
  362. "type": "object",
  363. "required": [
  364. "meta",
  365. "data"
  366. ],
  367. "properties": {
  368. "meta": {
  369. "$ref": "#/components/schemas/OCSMeta"
  370. },
  371. "data": {
  372. "type": "object",
  373. "required": [
  374. "success"
  375. ],
  376. "properties": {
  377. "success": {
  378. "type": "boolean"
  379. }
  380. }
  381. }
  382. }
  383. }
  384. }
  385. }
  386. }
  387. }
  388. }
  389. }
  390. }
  391. },
  392. "/ocs/v2.php/apps/weather_status/api/v1/use-personal": {
  393. "put": {
  394. "operationId": "weather_status-use-personal-address",
  395. "summary": "Try to use the address set in user personal settings as weather location",
  396. "tags": [
  397. "weather_status"
  398. ],
  399. "security": [
  400. {
  401. "bearer_auth": []
  402. },
  403. {
  404. "basic_auth": []
  405. }
  406. ],
  407. "parameters": [
  408. {
  409. "name": "OCS-APIRequest",
  410. "in": "header",
  411. "description": "Required to be true for the API request to pass",
  412. "required": true,
  413. "schema": {
  414. "type": "boolean",
  415. "default": true
  416. }
  417. }
  418. ],
  419. "responses": {
  420. "200": {
  421. "description": "Address updated",
  422. "content": {
  423. "application/json": {
  424. "schema": {
  425. "type": "object",
  426. "required": [
  427. "ocs"
  428. ],
  429. "properties": {
  430. "ocs": {
  431. "type": "object",
  432. "required": [
  433. "meta",
  434. "data"
  435. ],
  436. "properties": {
  437. "meta": {
  438. "$ref": "#/components/schemas/OCSMeta"
  439. },
  440. "data": {
  441. "type": "object",
  442. "required": [
  443. "success",
  444. "lat",
  445. "lon",
  446. "address"
  447. ],
  448. "properties": {
  449. "success": {
  450. "type": "boolean"
  451. },
  452. "lat": {
  453. "type": "number",
  454. "format": "float",
  455. "nullable": true
  456. },
  457. "lon": {
  458. "type": "number",
  459. "format": "float",
  460. "nullable": true
  461. },
  462. "address": {
  463. "type": "string",
  464. "nullable": true
  465. }
  466. }
  467. }
  468. }
  469. }
  470. }
  471. }
  472. }
  473. }
  474. }
  475. }
  476. }
  477. },
  478. "/ocs/v2.php/apps/weather_status/api/v1/location": {
  479. "get": {
  480. "operationId": "weather_status-get-location",
  481. "summary": "Get stored user location",
  482. "tags": [
  483. "weather_status"
  484. ],
  485. "security": [
  486. {
  487. "bearer_auth": []
  488. },
  489. {
  490. "basic_auth": []
  491. }
  492. ],
  493. "parameters": [
  494. {
  495. "name": "OCS-APIRequest",
  496. "in": "header",
  497. "description": "Required to be true for the API request to pass",
  498. "required": true,
  499. "schema": {
  500. "type": "boolean",
  501. "default": true
  502. }
  503. }
  504. ],
  505. "responses": {
  506. "200": {
  507. "description": "Location returned",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "type": "object",
  512. "required": [
  513. "ocs"
  514. ],
  515. "properties": {
  516. "ocs": {
  517. "type": "object",
  518. "required": [
  519. "meta",
  520. "data"
  521. ],
  522. "properties": {
  523. "meta": {
  524. "$ref": "#/components/schemas/OCSMeta"
  525. },
  526. "data": {
  527. "type": "object",
  528. "required": [
  529. "lat",
  530. "lon",
  531. "address",
  532. "mode"
  533. ],
  534. "properties": {
  535. "lat": {
  536. "type": "number",
  537. "format": "float"
  538. },
  539. "lon": {
  540. "type": "number",
  541. "format": "float"
  542. },
  543. "address": {
  544. "type": "string"
  545. },
  546. "mode": {
  547. "type": "integer",
  548. "format": "int64"
  549. }
  550. }
  551. }
  552. }
  553. }
  554. }
  555. }
  556. }
  557. }
  558. }
  559. }
  560. },
  561. "put": {
  562. "operationId": "weather_status-set-location",
  563. "summary": "Set address and resolve it to get coordinates or directly set coordinates and get address with reverse geocoding",
  564. "tags": [
  565. "weather_status"
  566. ],
  567. "security": [
  568. {
  569. "bearer_auth": []
  570. },
  571. {
  572. "basic_auth": []
  573. }
  574. ],
  575. "parameters": [
  576. {
  577. "name": "address",
  578. "in": "query",
  579. "description": "Any approximative or exact address",
  580. "schema": {
  581. "type": "string",
  582. "nullable": true
  583. }
  584. },
  585. {
  586. "name": "lat",
  587. "in": "query",
  588. "description": "Latitude in decimal degree format",
  589. "schema": {
  590. "type": "number",
  591. "format": "float",
  592. "nullable": true
  593. }
  594. },
  595. {
  596. "name": "lon",
  597. "in": "query",
  598. "description": "Longitude in decimal degree format",
  599. "schema": {
  600. "type": "number",
  601. "format": "float",
  602. "nullable": true
  603. }
  604. },
  605. {
  606. "name": "OCS-APIRequest",
  607. "in": "header",
  608. "description": "Required to be true for the API request to pass",
  609. "required": true,
  610. "schema": {
  611. "type": "boolean",
  612. "default": true
  613. }
  614. }
  615. ],
  616. "responses": {
  617. "200": {
  618. "description": "Location updated",
  619. "content": {
  620. "application/json": {
  621. "schema": {
  622. "type": "object",
  623. "required": [
  624. "ocs"
  625. ],
  626. "properties": {
  627. "ocs": {
  628. "type": "object",
  629. "required": [
  630. "meta",
  631. "data"
  632. ],
  633. "properties": {
  634. "meta": {
  635. "$ref": "#/components/schemas/OCSMeta"
  636. },
  637. "data": {
  638. "type": "object",
  639. "required": [
  640. "success",
  641. "lat",
  642. "lon",
  643. "address"
  644. ],
  645. "properties": {
  646. "success": {
  647. "type": "boolean"
  648. },
  649. "lat": {
  650. "type": "number",
  651. "format": "float",
  652. "nullable": true
  653. },
  654. "lon": {
  655. "type": "number",
  656. "format": "float",
  657. "nullable": true
  658. },
  659. "address": {
  660. "type": "string",
  661. "nullable": true
  662. }
  663. }
  664. }
  665. }
  666. }
  667. }
  668. }
  669. }
  670. }
  671. }
  672. }
  673. }
  674. },
  675. "/ocs/v2.php/apps/weather_status/api/v1/forecast": {
  676. "get": {
  677. "operationId": "weather_status-get-forecast",
  678. "summary": "Get forecast for current location",
  679. "tags": [
  680. "weather_status"
  681. ],
  682. "security": [
  683. {
  684. "bearer_auth": []
  685. },
  686. {
  687. "basic_auth": []
  688. }
  689. ],
  690. "parameters": [
  691. {
  692. "name": "OCS-APIRequest",
  693. "in": "header",
  694. "description": "Required to be true for the API request to pass",
  695. "required": true,
  696. "schema": {
  697. "type": "boolean",
  698. "default": true
  699. }
  700. }
  701. ],
  702. "responses": {
  703. "200": {
  704. "description": "Forecast returned",
  705. "content": {
  706. "application/json": {
  707. "schema": {
  708. "type": "object",
  709. "required": [
  710. "ocs"
  711. ],
  712. "properties": {
  713. "ocs": {
  714. "type": "object",
  715. "required": [
  716. "meta",
  717. "data"
  718. ],
  719. "properties": {
  720. "meta": {
  721. "$ref": "#/components/schemas/OCSMeta"
  722. },
  723. "data": {
  724. "type": "array",
  725. "items": {
  726. "$ref": "#/components/schemas/Forecast"
  727. }
  728. }
  729. }
  730. }
  731. }
  732. }
  733. }
  734. }
  735. },
  736. "404": {
  737. "description": "Forecast not found",
  738. "content": {
  739. "application/json": {
  740. "schema": {
  741. "type": "object",
  742. "required": [
  743. "ocs"
  744. ],
  745. "properties": {
  746. "ocs": {
  747. "type": "object",
  748. "required": [
  749. "meta",
  750. "data"
  751. ],
  752. "properties": {
  753. "meta": {
  754. "$ref": "#/components/schemas/OCSMeta"
  755. },
  756. "data": {
  757. "type": "object",
  758. "required": [
  759. "success"
  760. ],
  761. "properties": {
  762. "success": {
  763. "type": "boolean"
  764. }
  765. }
  766. }
  767. }
  768. }
  769. }
  770. }
  771. }
  772. }
  773. }
  774. }
  775. }
  776. },
  777. "/ocs/v2.php/apps/weather_status/api/v1/favorites": {
  778. "get": {
  779. "operationId": "weather_status-get-favorites",
  780. "summary": "Get favorites list",
  781. "tags": [
  782. "weather_status"
  783. ],
  784. "security": [
  785. {
  786. "bearer_auth": []
  787. },
  788. {
  789. "basic_auth": []
  790. }
  791. ],
  792. "parameters": [
  793. {
  794. "name": "OCS-APIRequest",
  795. "in": "header",
  796. "description": "Required to be true for the API request to pass",
  797. "required": true,
  798. "schema": {
  799. "type": "boolean",
  800. "default": true
  801. }
  802. }
  803. ],
  804. "responses": {
  805. "200": {
  806. "description": "Favorites returned",
  807. "content": {
  808. "application/json": {
  809. "schema": {
  810. "type": "object",
  811. "required": [
  812. "ocs"
  813. ],
  814. "properties": {
  815. "ocs": {
  816. "type": "object",
  817. "required": [
  818. "meta",
  819. "data"
  820. ],
  821. "properties": {
  822. "meta": {
  823. "$ref": "#/components/schemas/OCSMeta"
  824. },
  825. "data": {
  826. "type": "array",
  827. "items": {
  828. "type": "string"
  829. }
  830. }
  831. }
  832. }
  833. }
  834. }
  835. }
  836. }
  837. }
  838. }
  839. },
  840. "put": {
  841. "operationId": "weather_status-set-favorites",
  842. "summary": "Set favorites list",
  843. "tags": [
  844. "weather_status"
  845. ],
  846. "security": [
  847. {
  848. "bearer_auth": []
  849. },
  850. {
  851. "basic_auth": []
  852. }
  853. ],
  854. "parameters": [
  855. {
  856. "name": "favorites[]",
  857. "in": "query",
  858. "description": "Favorite addresses",
  859. "required": true,
  860. "schema": {
  861. "type": "array",
  862. "items": {
  863. "type": "string"
  864. }
  865. }
  866. },
  867. {
  868. "name": "OCS-APIRequest",
  869. "in": "header",
  870. "description": "Required to be true for the API request to pass",
  871. "required": true,
  872. "schema": {
  873. "type": "boolean",
  874. "default": true
  875. }
  876. }
  877. ],
  878. "responses": {
  879. "200": {
  880. "description": "Favorites updated",
  881. "content": {
  882. "application/json": {
  883. "schema": {
  884. "type": "object",
  885. "required": [
  886. "ocs"
  887. ],
  888. "properties": {
  889. "ocs": {
  890. "type": "object",
  891. "required": [
  892. "meta",
  893. "data"
  894. ],
  895. "properties": {
  896. "meta": {
  897. "$ref": "#/components/schemas/OCSMeta"
  898. },
  899. "data": {
  900. "type": "object",
  901. "required": [
  902. "success"
  903. ],
  904. "properties": {
  905. "success": {
  906. "type": "boolean"
  907. }
  908. }
  909. }
  910. }
  911. }
  912. }
  913. }
  914. }
  915. }
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "tags": []
  922. }