THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

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.

10498 lines
257KB

  1. {
  2. "consumes": [
  3. "application/json",
  4. "text/plain"
  5. ],
  6. "produces": [
  7. "application/json",
  8. "text/html"
  9. ],
  10. "schemes": [
  11. "http",
  12. "https"
  13. ],
  14. "swagger": "2.0",
  15. "info": {
  16. "description": "This documentation describes the Gitea API.",
  17. "title": "Gitea API.",
  18. "license": {
  19. "name": "MIT",
  20. "url": "http://opensource.org/licenses/MIT"
  21. },
  22. "version": "1.1.1"
  23. },
  24. "basePath": "{{AppSubUrl}}/api/v1",
  25. "paths": {
  26. "/admin/orgs": {
  27. "get": {
  28. "produces": [
  29. "application/json"
  30. ],
  31. "tags": [
  32. "admin"
  33. ],
  34. "summary": "List all organizations",
  35. "operationId": "adminGetAllOrgs",
  36. "parameters": [
  37. {
  38. "type": "integer",
  39. "description": "page number of results to return (1-based)",
  40. "name": "page",
  41. "in": "query"
  42. },
  43. {
  44. "type": "integer",
  45. "description": "page size of results, maximum page size is 50",
  46. "name": "limit",
  47. "in": "query"
  48. }
  49. ],
  50. "responses": {
  51. "200": {
  52. "$ref": "#/responses/OrganizationList"
  53. },
  54. "403": {
  55. "$ref": "#/responses/forbidden"
  56. }
  57. }
  58. }
  59. },
  60. "/admin/users": {
  61. "get": {
  62. "produces": [
  63. "application/json"
  64. ],
  65. "tags": [
  66. "admin"
  67. ],
  68. "summary": "List all users",
  69. "operationId": "adminGetAllUsers",
  70. "responses": {
  71. "200": {
  72. "$ref": "#/responses/UserList"
  73. },
  74. "403": {
  75. "$ref": "#/responses/forbidden"
  76. }
  77. }
  78. },
  79. "post": {
  80. "consumes": [
  81. "application/json"
  82. ],
  83. "produces": [
  84. "application/json"
  85. ],
  86. "tags": [
  87. "admin"
  88. ],
  89. "summary": "Create a user",
  90. "operationId": "adminCreateUser",
  91. "parameters": [
  92. {
  93. "name": "body",
  94. "in": "body",
  95. "schema": {
  96. "$ref": "#/definitions/CreateUserOption"
  97. }
  98. }
  99. ],
  100. "responses": {
  101. "201": {
  102. "$ref": "#/responses/User"
  103. },
  104. "403": {
  105. "$ref": "#/responses/forbidden"
  106. },
  107. "422": {
  108. "$ref": "#/responses/validationError"
  109. }
  110. }
  111. }
  112. },
  113. "/admin/users/{username}": {
  114. "delete": {
  115. "produces": [
  116. "application/json"
  117. ],
  118. "tags": [
  119. "admin"
  120. ],
  121. "summary": "Delete a user",
  122. "operationId": "adminDeleteUser",
  123. "parameters": [
  124. {
  125. "type": "string",
  126. "description": "username of user to delete",
  127. "name": "username",
  128. "in": "path",
  129. "required": true
  130. }
  131. ],
  132. "responses": {
  133. "204": {
  134. "$ref": "#/responses/empty"
  135. },
  136. "403": {
  137. "$ref": "#/responses/forbidden"
  138. },
  139. "422": {
  140. "$ref": "#/responses/validationError"
  141. }
  142. }
  143. },
  144. "patch": {
  145. "consumes": [
  146. "application/json"
  147. ],
  148. "produces": [
  149. "application/json"
  150. ],
  151. "tags": [
  152. "admin"
  153. ],
  154. "summary": "Edit an existing user",
  155. "operationId": "adminEditUser",
  156. "parameters": [
  157. {
  158. "type": "string",
  159. "description": "username of user to edit",
  160. "name": "username",
  161. "in": "path",
  162. "required": true
  163. },
  164. {
  165. "name": "body",
  166. "in": "body",
  167. "schema": {
  168. "$ref": "#/definitions/EditUserOption"
  169. }
  170. }
  171. ],
  172. "responses": {
  173. "200": {
  174. "$ref": "#/responses/User"
  175. },
  176. "403": {
  177. "$ref": "#/responses/forbidden"
  178. },
  179. "422": {
  180. "$ref": "#/responses/validationError"
  181. }
  182. }
  183. }
  184. },
  185. "/admin/users/{username}/keys": {
  186. "post": {
  187. "consumes": [
  188. "application/json"
  189. ],
  190. "produces": [
  191. "application/json"
  192. ],
  193. "tags": [
  194. "admin"
  195. ],
  196. "summary": "Add a public key on behalf of a user",
  197. "operationId": "adminCreatePublicKey",
  198. "parameters": [
  199. {
  200. "type": "string",
  201. "description": "username of the user",
  202. "name": "username",
  203. "in": "path",
  204. "required": true
  205. },
  206. {
  207. "name": "key",
  208. "in": "body",
  209. "schema": {
  210. "$ref": "#/definitions/CreateKeyOption"
  211. }
  212. }
  213. ],
  214. "responses": {
  215. "201": {
  216. "$ref": "#/responses/PublicKey"
  217. },
  218. "403": {
  219. "$ref": "#/responses/forbidden"
  220. },
  221. "422": {
  222. "$ref": "#/responses/validationError"
  223. }
  224. }
  225. }
  226. },
  227. "/admin/users/{username}/keys/{id}": {
  228. "delete": {
  229. "produces": [
  230. "application/json"
  231. ],
  232. "tags": [
  233. "admin"
  234. ],
  235. "summary": "Delete a user's public key",
  236. "operationId": "adminDeleteUserPublicKey",
  237. "parameters": [
  238. {
  239. "type": "string",
  240. "description": "username of user",
  241. "name": "username",
  242. "in": "path",
  243. "required": true
  244. },
  245. {
  246. "type": "integer",
  247. "format": "int64",
  248. "description": "id of the key to delete",
  249. "name": "id",
  250. "in": "path",
  251. "required": true
  252. }
  253. ],
  254. "responses": {
  255. "204": {
  256. "$ref": "#/responses/empty"
  257. },
  258. "403": {
  259. "$ref": "#/responses/forbidden"
  260. },
  261. "404": {
  262. "$ref": "#/responses/notFound"
  263. }
  264. }
  265. }
  266. },
  267. "/admin/users/{username}/orgs": {
  268. "post": {
  269. "consumes": [
  270. "application/json"
  271. ],
  272. "produces": [
  273. "application/json"
  274. ],
  275. "tags": [
  276. "admin"
  277. ],
  278. "summary": "Create an organization",
  279. "operationId": "adminCreateOrg",
  280. "parameters": [
  281. {
  282. "type": "string",
  283. "description": "username of the user that will own the created organization",
  284. "name": "username",
  285. "in": "path",
  286. "required": true
  287. },
  288. {
  289. "name": "organization",
  290. "in": "body",
  291. "required": true,
  292. "schema": {
  293. "$ref": "#/definitions/CreateOrgOption"
  294. }
  295. }
  296. ],
  297. "responses": {
  298. "201": {
  299. "$ref": "#/responses/Organization"
  300. },
  301. "403": {
  302. "$ref": "#/responses/forbidden"
  303. },
  304. "422": {
  305. "$ref": "#/responses/validationError"
  306. }
  307. }
  308. }
  309. },
  310. "/admin/users/{username}/repos": {
  311. "post": {
  312. "consumes": [
  313. "application/json"
  314. ],
  315. "produces": [
  316. "application/json"
  317. ],
  318. "tags": [
  319. "admin"
  320. ],
  321. "summary": "Create a repository on behalf a user",
  322. "operationId": "adminCreateRepo",
  323. "parameters": [
  324. {
  325. "type": "string",
  326. "description": "username of the user. This user will own the created repository",
  327. "name": "username",
  328. "in": "path",
  329. "required": true
  330. },
  331. {
  332. "name": "repository",
  333. "in": "body",
  334. "required": true,
  335. "schema": {
  336. "$ref": "#/definitions/CreateRepoOption"
  337. }
  338. }
  339. ],
  340. "responses": {
  341. "201": {
  342. "$ref": "#/responses/Repository"
  343. },
  344. "403": {
  345. "$ref": "#/responses/forbidden"
  346. },
  347. "422": {
  348. "$ref": "#/responses/validationError"
  349. }
  350. }
  351. }
  352. },
  353. "/markdown": {
  354. "post": {
  355. "consumes": [
  356. "application/json"
  357. ],
  358. "produces": [
  359. "text/html"
  360. ],
  361. "tags": [
  362. "miscellaneous"
  363. ],
  364. "summary": "Render a markdown document as HTML",
  365. "operationId": "renderMarkdown",
  366. "parameters": [
  367. {
  368. "name": "body",
  369. "in": "body",
  370. "schema": {
  371. "$ref": "#/definitions/MarkdownOption"
  372. }
  373. }
  374. ],
  375. "responses": {
  376. "200": {
  377. "$ref": "#/responses/MarkdownRender"
  378. },
  379. "422": {
  380. "$ref": "#/responses/validationError"
  381. }
  382. }
  383. }
  384. },
  385. "/markdown/raw": {
  386. "post": {
  387. "consumes": [
  388. "text/plain"
  389. ],
  390. "produces": [
  391. "text/html"
  392. ],
  393. "tags": [
  394. "miscellaneous"
  395. ],
  396. "summary": "Render raw markdown as HTML",
  397. "operationId": "renderMarkdownRaw",
  398. "parameters": [
  399. {
  400. "description": "Request body to render",
  401. "name": "body",
  402. "in": "body",
  403. "required": true,
  404. "schema": {
  405. "type": "string"
  406. }
  407. }
  408. ],
  409. "responses": {
  410. "200": {
  411. "$ref": "#/responses/MarkdownRender"
  412. },
  413. "422": {
  414. "$ref": "#/responses/validationError"
  415. }
  416. }
  417. }
  418. },
  419. "/org/{org}/repos": {
  420. "post": {
  421. "consumes": [
  422. "application/json"
  423. ],
  424. "produces": [
  425. "application/json"
  426. ],
  427. "tags": [
  428. "organization"
  429. ],
  430. "summary": "Create a repository in an organization",
  431. "operationId": "createOrgRepo",
  432. "parameters": [
  433. {
  434. "type": "string",
  435. "description": "name of organization",
  436. "name": "org",
  437. "in": "path",
  438. "required": true
  439. },
  440. {
  441. "name": "body",
  442. "in": "body",
  443. "schema": {
  444. "$ref": "#/definitions/CreateRepoOption"
  445. }
  446. }
  447. ],
  448. "responses": {
  449. "201": {
  450. "$ref": "#/responses/Repository"
  451. },
  452. "403": {
  453. "$ref": "#/responses/forbidden"
  454. },
  455. "422": {
  456. "$ref": "#/responses/validationError"
  457. }
  458. }
  459. }
  460. },
  461. "/orgs": {
  462. "post": {
  463. "consumes": [
  464. "application/json"
  465. ],
  466. "produces": [
  467. "application/json"
  468. ],
  469. "tags": [
  470. "organization"
  471. ],
  472. "summary": "Create an organization",
  473. "operationId": "orgCreate",
  474. "parameters": [
  475. {
  476. "name": "organization",
  477. "in": "body",
  478. "required": true,
  479. "schema": {
  480. "$ref": "#/definitions/CreateOrgOption"
  481. }
  482. }
  483. ],
  484. "responses": {
  485. "201": {
  486. "$ref": "#/responses/Organization"
  487. },
  488. "403": {
  489. "$ref": "#/responses/forbidden"
  490. },
  491. "422": {
  492. "$ref": "#/responses/validationError"
  493. }
  494. }
  495. }
  496. },
  497. "/orgs/{org}": {
  498. "get": {
  499. "produces": [
  500. "application/json"
  501. ],
  502. "tags": [
  503. "organization"
  504. ],
  505. "summary": "Get an organization",
  506. "operationId": "orgGet",
  507. "parameters": [
  508. {
  509. "type": "string",
  510. "description": "name of the organization to get",
  511. "name": "org",
  512. "in": "path",
  513. "required": true
  514. }
  515. ],
  516. "responses": {
  517. "200": {
  518. "$ref": "#/responses/Organization"
  519. }
  520. }
  521. },
  522. "delete": {
  523. "produces": [
  524. "application/json"
  525. ],
  526. "tags": [
  527. "organization"
  528. ],
  529. "summary": "Delete an organization",
  530. "operationId": "orgDelete",
  531. "parameters": [
  532. {
  533. "type": "string",
  534. "description": "organization that is to be deleted",
  535. "name": "org",
  536. "in": "path",
  537. "required": true
  538. }
  539. ],
  540. "responses": {
  541. "204": {
  542. "$ref": "#/responses/empty"
  543. }
  544. }
  545. },
  546. "patch": {
  547. "consumes": [
  548. "application/json"
  549. ],
  550. "produces": [
  551. "application/json"
  552. ],
  553. "tags": [
  554. "organization"
  555. ],
  556. "summary": "Edit an organization",
  557. "operationId": "orgEdit",
  558. "parameters": [
  559. {
  560. "type": "string",
  561. "description": "name of the organization to edit",
  562. "name": "org",
  563. "in": "path",
  564. "required": true
  565. },
  566. {
  567. "name": "body",
  568. "in": "body",
  569. "required": true,
  570. "schema": {
  571. "$ref": "#/definitions/EditOrgOption"
  572. }
  573. }
  574. ],
  575. "responses": {
  576. "200": {
  577. "$ref": "#/responses/Organization"
  578. }
  579. }
  580. }
  581. },
  582. "/orgs/{org}/hooks": {
  583. "get": {
  584. "produces": [
  585. "application/json"
  586. ],
  587. "tags": [
  588. "organization"
  589. ],
  590. "summary": "List an organization's webhooks",
  591. "operationId": "orgListHooks",
  592. "parameters": [
  593. {
  594. "type": "string",
  595. "description": "name of the organization",
  596. "name": "org",
  597. "in": "path",
  598. "required": true
  599. }
  600. ],
  601. "responses": {
  602. "200": {
  603. "$ref": "#/responses/HookList"
  604. }
  605. }
  606. }
  607. },
  608. "/orgs/{org}/hooks/": {
  609. "post": {
  610. "consumes": [
  611. "application/json"
  612. ],
  613. "produces": [
  614. "application/json"
  615. ],
  616. "tags": [
  617. "organization"
  618. ],
  619. "summary": "Create a hook",
  620. "operationId": "orgCreateHook",
  621. "parameters": [
  622. {
  623. "type": "string",
  624. "description": "name of the organization",
  625. "name": "org",
  626. "in": "path",
  627. "required": true
  628. },
  629. {
  630. "name": "body",
  631. "in": "body",
  632. "required": true,
  633. "schema": {
  634. "$ref": "#/definitions/CreateHookOption"
  635. }
  636. }
  637. ],
  638. "responses": {
  639. "201": {
  640. "$ref": "#/responses/Hook"
  641. }
  642. }
  643. }
  644. },
  645. "/orgs/{org}/hooks/{id}": {
  646. "get": {
  647. "produces": [
  648. "application/json"
  649. ],
  650. "tags": [
  651. "organization"
  652. ],
  653. "summary": "Get a hook",
  654. "operationId": "orgGetHook",
  655. "parameters": [
  656. {
  657. "type": "string",
  658. "description": "name of the organization",
  659. "name": "org",
  660. "in": "path",
  661. "required": true
  662. },
  663. {
  664. "type": "integer",
  665. "format": "int64",
  666. "description": "id of the hook to get",
  667. "name": "id",
  668. "in": "path",
  669. "required": true
  670. }
  671. ],
  672. "responses": {
  673. "200": {
  674. "$ref": "#/responses/Hook"
  675. }
  676. }
  677. },
  678. "delete": {
  679. "produces": [
  680. "application/json"
  681. ],
  682. "tags": [
  683. "organization"
  684. ],
  685. "summary": "Delete a hook",
  686. "operationId": "orgDeleteHook",
  687. "parameters": [
  688. {
  689. "type": "string",
  690. "description": "name of the organization",
  691. "name": "org",
  692. "in": "path",
  693. "required": true
  694. },
  695. {
  696. "type": "integer",
  697. "format": "int64",
  698. "description": "id of the hook to delete",
  699. "name": "id",
  700. "in": "path",
  701. "required": true
  702. }
  703. ],
  704. "responses": {
  705. "204": {
  706. "$ref": "#/responses/empty"
  707. }
  708. }
  709. },
  710. "patch": {
  711. "consumes": [
  712. "application/json"
  713. ],
  714. "produces": [
  715. "application/json"
  716. ],
  717. "tags": [
  718. "organization"
  719. ],
  720. "summary": "Update a hook",
  721. "operationId": "orgEditHook",
  722. "parameters": [
  723. {
  724. "type": "string",
  725. "description": "name of the organization",
  726. "name": "org",
  727. "in": "path",
  728. "required": true
  729. },
  730. {
  731. "type": "integer",
  732. "format": "int64",
  733. "description": "id of the hook to update",
  734. "name": "id",
  735. "in": "path",
  736. "required": true
  737. },
  738. {
  739. "name": "body",
  740. "in": "body",
  741. "schema": {
  742. "$ref": "#/definitions/EditHookOption"
  743. }
  744. }
  745. ],
  746. "responses": {
  747. "200": {
  748. "$ref": "#/responses/Hook"
  749. }
  750. }
  751. }
  752. },
  753. "/orgs/{org}/members": {
  754. "get": {
  755. "produces": [
  756. "application/json"
  757. ],
  758. "tags": [
  759. "organization"
  760. ],
  761. "summary": "List an organization's members",
  762. "operationId": "orgListMembers",
  763. "parameters": [
  764. {
  765. "type": "string",
  766. "description": "name of the organization",
  767. "name": "org",
  768. "in": "path",
  769. "required": true
  770. }
  771. ],
  772. "responses": {
  773. "200": {
  774. "$ref": "#/responses/UserList"
  775. }
  776. }
  777. }
  778. },
  779. "/orgs/{org}/members/{username}": {
  780. "get": {
  781. "tags": [
  782. "organization"
  783. ],
  784. "summary": "Check if a user is a member of an organization",
  785. "operationId": "orgIsMember",
  786. "parameters": [
  787. {
  788. "type": "string",
  789. "description": "name of the organization",
  790. "name": "org",
  791. "in": "path",
  792. "required": true
  793. },
  794. {
  795. "type": "string",
  796. "description": "username of the user",
  797. "name": "username",
  798. "in": "path",
  799. "required": true
  800. }
  801. ],
  802. "responses": {
  803. "204": {
  804. "description": "user is a member"
  805. },
  806. "404": {
  807. "description": "user is not a member"
  808. }
  809. }
  810. },
  811. "delete": {
  812. "produces": [
  813. "application/json"
  814. ],
  815. "tags": [
  816. "organization"
  817. ],
  818. "summary": "Remove a member from an organization",
  819. "operationId": "orgDeleteMember",
  820. "parameters": [
  821. {
  822. "type": "string",
  823. "description": "name of the organization",
  824. "name": "org",
  825. "in": "path",
  826. "required": true
  827. },
  828. {
  829. "type": "string",
  830. "description": "username of the user",
  831. "name": "username",
  832. "in": "path",
  833. "required": true
  834. }
  835. ],
  836. "responses": {
  837. "204": {
  838. "description": "member removed"
  839. }
  840. }
  841. }
  842. },
  843. "/orgs/{org}/public_members": {
  844. "get": {
  845. "produces": [
  846. "application/json"
  847. ],
  848. "tags": [
  849. "organization"
  850. ],
  851. "summary": "List an organization's public members",
  852. "operationId": "orgListPublicMembers",
  853. "parameters": [
  854. {
  855. "type": "string",
  856. "description": "name of the organization",
  857. "name": "org",
  858. "in": "path",
  859. "required": true
  860. }
  861. ],
  862. "responses": {
  863. "200": {
  864. "$ref": "#/responses/UserList"
  865. }
  866. }
  867. }
  868. },
  869. "/orgs/{org}/public_members/{username}": {
  870. "get": {
  871. "tags": [
  872. "organization"
  873. ],
  874. "summary": "Check if a user is a public member of an organization",
  875. "operationId": "orgIsPublicMember",
  876. "parameters": [
  877. {
  878. "type": "string",
  879. "description": "name of the organization",
  880. "name": "org",
  881. "in": "path",
  882. "required": true
  883. },
  884. {
  885. "type": "string",
  886. "description": "username of the user",
  887. "name": "username",
  888. "in": "path",
  889. "required": true
  890. }
  891. ],
  892. "responses": {
  893. "204": {
  894. "description": "user is a public member"
  895. },
  896. "404": {
  897. "description": "user is not a public member"
  898. }
  899. }
  900. },
  901. "put": {
  902. "produces": [
  903. "application/json"
  904. ],
  905. "tags": [
  906. "organization"
  907. ],
  908. "summary": "Publicize a user's membership",
  909. "operationId": "orgPublicizeMember",
  910. "parameters": [
  911. {
  912. "type": "string",
  913. "description": "name of the organization",
  914. "name": "org",
  915. "in": "path",
  916. "required": true
  917. },
  918. {
  919. "type": "string",
  920. "description": "username of the user",
  921. "name": "username",
  922. "in": "path",
  923. "required": true
  924. }
  925. ],
  926. "responses": {
  927. "204": {
  928. "description": "membership publicized"
  929. }
  930. }
  931. },
  932. "delete": {
  933. "produces": [
  934. "application/json"
  935. ],
  936. "tags": [
  937. "organization"
  938. ],
  939. "summary": "Conceal a user's membership",
  940. "operationId": "orgConcealMember",
  941. "parameters": [
  942. {
  943. "type": "string",
  944. "description": "name of the organization",
  945. "name": "org",
  946. "in": "path",
  947. "required": true
  948. },
  949. {
  950. "type": "string",
  951. "description": "username of the user",
  952. "name": "username",
  953. "in": "path",
  954. "required": true
  955. }
  956. ],
  957. "responses": {
  958. "204": {
  959. "$ref": "#/responses/empty"
  960. }
  961. }
  962. }
  963. },
  964. "/orgs/{org}/repos": {
  965. "get": {
  966. "produces": [
  967. "application/json"
  968. ],
  969. "tags": [
  970. "organization"
  971. ],
  972. "summary": "List an organization's repos",
  973. "operationId": "orgListRepos",
  974. "parameters": [
  975. {
  976. "type": "string",
  977. "description": "name of the organization",
  978. "name": "org",
  979. "in": "path",
  980. "required": true
  981. }
  982. ],
  983. "responses": {
  984. "200": {
  985. "$ref": "#/responses/RepositoryList"
  986. }
  987. }
  988. }
  989. },
  990. "/orgs/{org}/teams": {
  991. "get": {
  992. "produces": [
  993. "application/json"
  994. ],
  995. "tags": [
  996. "organization"
  997. ],
  998. "summary": "List an organization's teams",
  999. "operationId": "orgListTeams",
  1000. "parameters": [
  1001. {
  1002. "type": "string",
  1003. "description": "name of the organization",
  1004. "name": "org",
  1005. "in": "path",
  1006. "required": true
  1007. }
  1008. ],
  1009. "responses": {
  1010. "200": {
  1011. "$ref": "#/responses/TeamList"
  1012. }
  1013. }
  1014. },
  1015. "post": {
  1016. "consumes": [
  1017. "application/json"
  1018. ],
  1019. "produces": [
  1020. "application/json"
  1021. ],
  1022. "tags": [
  1023. "organization"
  1024. ],
  1025. "summary": "Create a team",
  1026. "operationId": "orgCreateTeam",
  1027. "parameters": [
  1028. {
  1029. "type": "string",
  1030. "description": "name of the organization",
  1031. "name": "org",
  1032. "in": "path",
  1033. "required": true
  1034. },
  1035. {
  1036. "name": "body",
  1037. "in": "body",
  1038. "schema": {
  1039. "$ref": "#/definitions/CreateTeamOption"
  1040. }
  1041. }
  1042. ],
  1043. "responses": {
  1044. "201": {
  1045. "$ref": "#/responses/Team"
  1046. }
  1047. }
  1048. }
  1049. },
  1050. "/repos/migrate": {
  1051. "post": {
  1052. "consumes": [
  1053. "application/json"
  1054. ],
  1055. "produces": [
  1056. "application/json"
  1057. ],
  1058. "tags": [
  1059. "repository"
  1060. ],
  1061. "summary": "Migrate a remote git repository",
  1062. "operationId": "repoMigrate",
  1063. "parameters": [
  1064. {
  1065. "name": "body",
  1066. "in": "body",
  1067. "schema": {
  1068. "$ref": "#/definitions/MigrateRepoForm"
  1069. }
  1070. }
  1071. ],
  1072. "responses": {
  1073. "201": {
  1074. "$ref": "#/responses/Repository"
  1075. }
  1076. }
  1077. }
  1078. },
  1079. "/repos/search": {
  1080. "get": {
  1081. "produces": [
  1082. "application/json"
  1083. ],
  1084. "tags": [
  1085. "repository"
  1086. ],
  1087. "summary": "Search for repositories",
  1088. "operationId": "repoSearch",
  1089. "parameters": [
  1090. {
  1091. "type": "string",
  1092. "description": "keyword",
  1093. "name": "q",
  1094. "in": "query"
  1095. },
  1096. {
  1097. "type": "boolean",
  1098. "description": "Limit search to repositories with keyword as topic",
  1099. "name": "topic",
  1100. "in": "query"
  1101. },
  1102. {
  1103. "type": "integer",
  1104. "format": "int64",
  1105. "description": "search only for repos that the user with the given id owns or contributes to",
  1106. "name": "uid",
  1107. "in": "query"
  1108. },
  1109. {
  1110. "type": "integer",
  1111. "format": "int64",
  1112. "description": "search only for repos that the user with the given id has starred",
  1113. "name": "starredBy",
  1114. "in": "query"
  1115. },
  1116. {
  1117. "type": "boolean",
  1118. "description": "include private repositories this user has access to (defaults to true)",
  1119. "name": "private",
  1120. "in": "query"
  1121. },
  1122. {
  1123. "type": "integer",
  1124. "description": "page number of results to return (1-based)",
  1125. "name": "page",
  1126. "in": "query"
  1127. },
  1128. {
  1129. "type": "integer",
  1130. "description": "page size of results, maximum page size is 50",
  1131. "name": "limit",
  1132. "in": "query"
  1133. },
  1134. {
  1135. "type": "string",
  1136. "description": "type of repository to search for. Supported values are \"fork\", \"source\", \"mirror\" and \"collaborative\"",
  1137. "name": "mode",
  1138. "in": "query"
  1139. },
  1140. {
  1141. "type": "boolean",
  1142. "description": "if `uid` is given, search only for repos that the user owns",
  1143. "name": "exclusive",
  1144. "in": "query"
  1145. },
  1146. {
  1147. "type": "string",
  1148. "description": "sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", and \"id\". Default is \"alpha\"",
  1149. "name": "sort",
  1150. "in": "query"
  1151. },
  1152. {
  1153. "type": "string",
  1154. "description": "sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified.",
  1155. "name": "order",
  1156. "in": "query"
  1157. }
  1158. ],
  1159. "responses": {
  1160. "200": {
  1161. "$ref": "#/responses/SearchResults"
  1162. },
  1163. "422": {
  1164. "$ref": "#/responses/validationError"
  1165. }
  1166. }
  1167. }
  1168. },
  1169. "/repos/{owner}/{repo}": {
  1170. "get": {
  1171. "produces": [
  1172. "application/json"
  1173. ],
  1174. "tags": [
  1175. "repository"
  1176. ],
  1177. "summary": "Get a repository",
  1178. "operationId": "repoGet",
  1179. "parameters": [
  1180. {
  1181. "type": "string",
  1182. "description": "owner of the repo",
  1183. "name": "owner",
  1184. "in": "path",
  1185. "required": true
  1186. },
  1187. {
  1188. "type": "string",
  1189. "description": "name of the repo",
  1190. "name": "repo",
  1191. "in": "path",
  1192. "required": true
  1193. }
  1194. ],
  1195. "responses": {
  1196. "200": {
  1197. "$ref": "#/responses/Repository"
  1198. }
  1199. }
  1200. },
  1201. "delete": {
  1202. "produces": [
  1203. "application/json"
  1204. ],
  1205. "tags": [
  1206. "repository"
  1207. ],
  1208. "summary": "Delete a repository",
  1209. "operationId": "repoDelete",
  1210. "parameters": [
  1211. {
  1212. "type": "string",
  1213. "description": "owner of the repo to delete",
  1214. "name": "owner",
  1215. "in": "path",
  1216. "required": true
  1217. },
  1218. {
  1219. "type": "string",
  1220. "description": "name of the repo to delete",
  1221. "name": "repo",
  1222. "in": "path",
  1223. "required": true
  1224. }
  1225. ],
  1226. "responses": {
  1227. "204": {
  1228. "$ref": "#/responses/empty"
  1229. },
  1230. "403": {
  1231. "$ref": "#/responses/forbidden"
  1232. }
  1233. }
  1234. },
  1235. "patch": {
  1236. "produces": [
  1237. "application/json"
  1238. ],
  1239. "tags": [
  1240. "repository"
  1241. ],
  1242. "summary": "Edit a repository's properties. Only fields that are set will be changed.",
  1243. "operationId": "repoEdit",
  1244. "parameters": [
  1245. {
  1246. "type": "string",
  1247. "description": "owner of the repo to edit",
  1248. "name": "owner",
  1249. "in": "path",
  1250. "required": true
  1251. },
  1252. {
  1253. "type": "string",
  1254. "description": "name of the repo to edit",
  1255. "name": "repo",
  1256. "in": "path",
  1257. "required": true
  1258. },
  1259. {
  1260. "description": "Properties of a repo that you can edit",
  1261. "name": "body",
  1262. "in": "body",
  1263. "schema": {
  1264. "$ref": "#/definitions/EditRepoOption"
  1265. }
  1266. }
  1267. ],
  1268. "responses": {
  1269. "200": {
  1270. "$ref": "#/responses/Repository"
  1271. },
  1272. "403": {
  1273. "$ref": "#/responses/forbidden"
  1274. },
  1275. "422": {
  1276. "$ref": "#/responses/validationError"
  1277. }
  1278. }
  1279. }
  1280. },
  1281. "/repos/{owner}/{repo}/archive/{archive}": {
  1282. "get": {
  1283. "produces": [
  1284. "application/json"
  1285. ],
  1286. "tags": [
  1287. "repository"
  1288. ],
  1289. "summary": "Get an archive of a repository",
  1290. "operationId": "repoGetArchive",
  1291. "parameters": [
  1292. {
  1293. "type": "string",
  1294. "description": "owner of the repo",
  1295. "name": "owner",
  1296. "in": "path",
  1297. "required": true
  1298. },
  1299. {
  1300. "type": "string",
  1301. "description": "name of the repo",
  1302. "name": "repo",
  1303. "in": "path",
  1304. "required": true
  1305. },
  1306. {
  1307. "type": "string",
  1308. "description": "archive to download, consisting of a git reference and archive",
  1309. "name": "archive",
  1310. "in": "path",
  1311. "required": true
  1312. }
  1313. ],
  1314. "responses": {
  1315. "200": {
  1316. "description": "success"
  1317. }
  1318. }
  1319. }
  1320. },
  1321. "/repos/{owner}/{repo}/branches": {
  1322. "get": {
  1323. "produces": [
  1324. "application/json"
  1325. ],
  1326. "tags": [
  1327. "repository"
  1328. ],
  1329. "summary": "List a repository's branches",
  1330. "operationId": "repoListBranches",
  1331. "parameters": [
  1332. {
  1333. "type": "string",
  1334. "description": "owner of the repo",
  1335. "name": "owner",
  1336. "in": "path",
  1337. "required": true
  1338. },
  1339. {
  1340. "type": "string",
  1341. "description": "name of the repo",
  1342. "name": "repo",
  1343. "in": "path",
  1344. "required": true
  1345. }
  1346. ],
  1347. "responses": {
  1348. "200": {
  1349. "$ref": "#/responses/BranchList"
  1350. }
  1351. }
  1352. }
  1353. },
  1354. "/repos/{owner}/{repo}/branches/{branch}": {
  1355. "get": {
  1356. "produces": [
  1357. "application/json"
  1358. ],
  1359. "tags": [
  1360. "repository"
  1361. ],
  1362. "summary": "Retrieve a specific branch from a repository",
  1363. "operationId": "repoGetBranch",
  1364. "parameters": [
  1365. {
  1366. "type": "string",
  1367. "description": "owner of the repo",
  1368. "name": "owner",
  1369. "in": "path",
  1370. "required": true
  1371. },
  1372. {
  1373. "type": "string",
  1374. "description": "name of the repo",
  1375. "name": "repo",
  1376. "in": "path",
  1377. "required": true
  1378. },
  1379. {
  1380. "type": "string",
  1381. "description": "branch to get",
  1382. "name": "branch",
  1383. "in": "path",
  1384. "required": true
  1385. }
  1386. ],
  1387. "responses": {
  1388. "200": {
  1389. "$ref": "#/responses/Branch"
  1390. }
  1391. }
  1392. }
  1393. },
  1394. "/repos/{owner}/{repo}/collaborators": {
  1395. "get": {
  1396. "produces": [
  1397. "application/json"
  1398. ],
  1399. "tags": [
  1400. "repository"
  1401. ],
  1402. "summary": "List a repository's collaborators",
  1403. "operationId": "repoListCollaborators",
  1404. "parameters": [
  1405. {
  1406. "type": "string",
  1407. "description": "owner of the repo",
  1408. "name": "owner",
  1409. "in": "path",
  1410. "required": true
  1411. },
  1412. {
  1413. "type": "string",
  1414. "description": "name of the repo",
  1415. "name": "repo",
  1416. "in": "path",
  1417. "required": true
  1418. }
  1419. ],
  1420. "responses": {
  1421. "200": {
  1422. "$ref": "#/responses/UserList"
  1423. }
  1424. }
  1425. }
  1426. },
  1427. "/repos/{owner}/{repo}/collaborators/{collaborator}": {
  1428. "get": {
  1429. "produces": [
  1430. "application/json"
  1431. ],
  1432. "tags": [
  1433. "repository"
  1434. ],
  1435. "summary": "Check if a user is a collaborator of a repository",
  1436. "operationId": "repoCheckCollaborator",
  1437. "parameters": [
  1438. {
  1439. "type": "string",
  1440. "description": "owner of the repo",
  1441. "name": "owner",
  1442. "in": "path",
  1443. "required": true
  1444. },
  1445. {
  1446. "type": "string",
  1447. "description": "name of the repo",
  1448. "name": "repo",
  1449. "in": "path",
  1450. "required": true
  1451. },
  1452. {
  1453. "type": "string",
  1454. "description": "username of the collaborator",
  1455. "name": "collaborator",
  1456. "in": "path",
  1457. "required": true
  1458. }
  1459. ],
  1460. "responses": {
  1461. "204": {
  1462. "$ref": "#/responses/empty"
  1463. },
  1464. "404": {
  1465. "$ref": "#/responses/empty"
  1466. }
  1467. }
  1468. },
  1469. "put": {
  1470. "produces": [
  1471. "application/json"
  1472. ],
  1473. "tags": [
  1474. "repository"
  1475. ],
  1476. "summary": "Add a collaborator to a repository",
  1477. "operationId": "repoAddCollaborator",
  1478. "parameters": [
  1479. {
  1480. "type": "string",
  1481. "description": "owner of the repo",
  1482. "name": "owner",
  1483. "in": "path",
  1484. "required": true
  1485. },
  1486. {
  1487. "type": "string",
  1488. "description": "name of the repo",
  1489. "name": "repo",
  1490. "in": "path",
  1491. "required": true
  1492. },
  1493. {
  1494. "type": "string",
  1495. "description": "username of the collaborator to add",
  1496. "name": "collaborator",
  1497. "in": "path",
  1498. "required": true
  1499. },
  1500. {
  1501. "name": "body",
  1502. "in": "body",
  1503. "schema": {
  1504. "$ref": "#/definitions/AddCollaboratorOption"
  1505. }
  1506. }
  1507. ],
  1508. "responses": {
  1509. "204": {
  1510. "$ref": "#/responses/empty"
  1511. }
  1512. }
  1513. },
  1514. "delete": {
  1515. "produces": [
  1516. "application/json"
  1517. ],
  1518. "tags": [
  1519. "repository"
  1520. ],
  1521. "summary": "Delete a collaborator from a repository",
  1522. "operationId": "repoDeleteCollaborator",
  1523. "parameters": [
  1524. {
  1525. "type": "string",
  1526. "description": "owner of the repo",
  1527. "name": "owner",
  1528. "in": "path",
  1529. "required": true
  1530. },
  1531. {
  1532. "type": "string",
  1533. "description": "name of the repo",
  1534. "name": "repo",
  1535. "in": "path",
  1536. "required": true
  1537. },
  1538. {
  1539. "type": "string",
  1540. "description": "username of the collaborator to delete",
  1541. "name": "collaborator",
  1542. "in": "path",
  1543. "required": true
  1544. }
  1545. ],
  1546. "responses": {
  1547. "204": {
  1548. "$ref": "#/responses/empty"
  1549. }
  1550. }
  1551. }
  1552. },
  1553. "/repos/{owner}/{repo}/commits/{ref}/statuses": {
  1554. "get": {
  1555. "produces": [
  1556. "application/json"
  1557. ],
  1558. "tags": [
  1559. "repository"
  1560. ],
  1561. "summary": "Get a commit's combined status, by branch/tag/commit reference",
  1562. "operationId": "repoGetCombinedStatusByRef",
  1563. "parameters": [
  1564. {
  1565. "type": "string",
  1566. "description": "owner of the repo",
  1567. "name": "owner",
  1568. "in": "path",
  1569. "required": true
  1570. },
  1571. {
  1572. "type": "string",
  1573. "description": "name of the repo",
  1574. "name": "repo",
  1575. "in": "path",
  1576. "required": true
  1577. },
  1578. {
  1579. "type": "string",
  1580. "description": "name of branch/tag/commit",
  1581. "name": "ref",
  1582. "in": "path",
  1583. "required": true
  1584. },
  1585. {
  1586. "type": "integer",
  1587. "description": "page number of results",
  1588. "name": "page",
  1589. "in": "query"
  1590. }
  1591. ],
  1592. "responses": {
  1593. "200": {
  1594. "$ref": "#/responses/Status"
  1595. }
  1596. }
  1597. }
  1598. },
  1599. "/repos/{owner}/{repo}/contents": {
  1600. "get": {
  1601. "produces": [
  1602. "application/json"
  1603. ],
  1604. "tags": [
  1605. "repository"
  1606. ],
  1607. "summary": "Gets the metadata of all the entries of the root dir",
  1608. "operationId": "repoGetContentsList",
  1609. "parameters": [
  1610. {
  1611. "type": "string",
  1612. "description": "owner of the repo",
  1613. "name": "owner",
  1614. "in": "path",
  1615. "required": true
  1616. },
  1617. {
  1618. "type": "string",
  1619. "description": "name of the repo",
  1620. "name": "repo",
  1621. "in": "path",
  1622. "required": true
  1623. },
  1624. {
  1625. "type": "string",
  1626. "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)",
  1627. "name": "ref",
  1628. "in": "query"
  1629. }
  1630. ],
  1631. "responses": {
  1632. "200": {
  1633. "$ref": "#/responses/ContentsListResponse"
  1634. }
  1635. }
  1636. }
  1637. },
  1638. "/repos/{owner}/{repo}/contents/{filepath}": {
  1639. "get": {
  1640. "produces": [
  1641. "application/json"
  1642. ],
  1643. "tags": [
  1644. "repository"
  1645. ],
  1646. "summary": "Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir",
  1647. "operationId": "repoGetContents",
  1648. "parameters": [
  1649. {
  1650. "type": "string",
  1651. "description": "owner of the repo",
  1652. "name": "owner",
  1653. "in": "path",
  1654. "required": true
  1655. },
  1656. {
  1657. "type": "string",
  1658. "description": "name of the repo",
  1659. "name": "repo",
  1660. "in": "path",
  1661. "required": true
  1662. },
  1663. {
  1664. "type": "string",
  1665. "description": "path of the dir, file, symlink or submodule in the repo",
  1666. "name": "filepath",
  1667. "in": "path",
  1668. "required": true
  1669. },
  1670. {
  1671. "type": "string",
  1672. "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)",
  1673. "name": "ref",
  1674. "in": "query"
  1675. }
  1676. ],
  1677. "responses": {
  1678. "200": {
  1679. "$ref": "#/responses/ContentsResponse"
  1680. }
  1681. }
  1682. },
  1683. "put": {
  1684. "consumes": [
  1685. "application/json"
  1686. ],
  1687. "produces": [
  1688. "application/json"
  1689. ],
  1690. "tags": [
  1691. "repository"
  1692. ],
  1693. "summary": "Update a file in a repository",
  1694. "operationId": "repoUpdateFile",
  1695. "parameters": [
  1696. {
  1697. "type": "string",
  1698. "description": "owner of the repo",
  1699. "name": "owner",
  1700. "in": "path",
  1701. "required": true
  1702. },
  1703. {
  1704. "type": "string",
  1705. "description": "name of the repo",
  1706. "name": "repo",
  1707. "in": "path",
  1708. "required": true
  1709. },
  1710. {
  1711. "type": "string",
  1712. "description": "path of the file to update",
  1713. "name": "filepath",
  1714. "in": "path",
  1715. "required": true
  1716. },
  1717. {
  1718. "name": "body",
  1719. "in": "body",
  1720. "required": true,
  1721. "schema": {
  1722. "$ref": "#/definitions/UpdateFileOptions"
  1723. }
  1724. }
  1725. ],
  1726. "responses": {
  1727. "200": {
  1728. "$ref": "#/responses/FileResponse"
  1729. }
  1730. }
  1731. },
  1732. "post": {
  1733. "consumes": [
  1734. "application/json"
  1735. ],
  1736. "produces": [
  1737. "application/json"
  1738. ],
  1739. "tags": [
  1740. "repository"
  1741. ],
  1742. "summary": "Create a file in a repository",
  1743. "operationId": "repoCreateFile",
  1744. "parameters": [
  1745. {
  1746. "type": "string",
  1747. "description": "owner of the repo",
  1748. "name": "owner",
  1749. "in": "path",
  1750. "required": true
  1751. },
  1752. {
  1753. "type": "string",
  1754. "description": "name of the repo",
  1755. "name": "repo",
  1756. "in": "path",
  1757. "required": true
  1758. },
  1759. {
  1760. "type": "string",
  1761. "description": "path of the file to create",
  1762. "name": "filepath",
  1763. "in": "path",
  1764. "required": true
  1765. },
  1766. {
  1767. "name": "body",
  1768. "in": "body",
  1769. "required": true,
  1770. "schema": {
  1771. "$ref": "#/definitions/CreateFileOptions"
  1772. }
  1773. }
  1774. ],
  1775. "responses": {
  1776. "201": {
  1777. "$ref": "#/responses/FileResponse"
  1778. }
  1779. }
  1780. },
  1781. "delete": {
  1782. "consumes": [
  1783. "application/json"
  1784. ],
  1785. "produces": [
  1786. "application/json"
  1787. ],
  1788. "tags": [
  1789. "repository"
  1790. ],
  1791. "summary": "Delete a file in a repository",
  1792. "operationId": "repoDeleteFile",
  1793. "parameters": [
  1794. {
  1795. "type": "string",
  1796. "description": "owner of the repo",
  1797. "name": "owner",
  1798. "in": "path",
  1799. "required": true
  1800. },
  1801. {
  1802. "type": "string",
  1803. "description": "name of the repo",
  1804. "name": "repo",
  1805. "in": "path",
  1806. "required": true
  1807. },
  1808. {
  1809. "type": "string",
  1810. "description": "path of the file to delete",
  1811. "name": "filepath",
  1812. "in": "path",
  1813. "required": true
  1814. },
  1815. {
  1816. "name": "body",
  1817. "in": "body",
  1818. "required": true,
  1819. "schema": {
  1820. "$ref": "#/definitions/DeleteFileOptions"
  1821. }
  1822. }
  1823. ],
  1824. "responses": {
  1825. "200": {
  1826. "$ref": "#/responses/FileDeleteResponse"
  1827. }
  1828. }
  1829. }
  1830. },
  1831. "/repos/{owner}/{repo}/editorconfig/{filepath}": {
  1832. "get": {
  1833. "produces": [
  1834. "application/json"
  1835. ],
  1836. "tags": [
  1837. "repository"
  1838. ],
  1839. "summary": "Get the EditorConfig definitions of a file in a repository",
  1840. "operationId": "repoGetEditorConfig",
  1841. "parameters": [
  1842. {
  1843. "type": "string",
  1844. "description": "owner of the repo",
  1845. "name": "owner",
  1846. "in": "path",
  1847. "required": true
  1848. },
  1849. {
  1850. "type": "string",
  1851. "description": "name of the repo",
  1852. "name": "repo",
  1853. "in": "path",
  1854. "required": true
  1855. },
  1856. {
  1857. "type": "string",
  1858. "description": "filepath of file to get",
  1859. "name": "filepath",
  1860. "in": "path",
  1861. "required": true
  1862. }
  1863. ],
  1864. "responses": {
  1865. "200": {
  1866. "description": "success"
  1867. }
  1868. }
  1869. }
  1870. },
  1871. "/repos/{owner}/{repo}/forks": {
  1872. "get": {
  1873. "produces": [
  1874. "application/json"
  1875. ],
  1876. "tags": [
  1877. "repository"
  1878. ],
  1879. "summary": "List a repository's forks",
  1880. "operationId": "listForks",
  1881. "parameters": [
  1882. {
  1883. "type": "string",
  1884. "description": "owner of the repo",
  1885. "name": "owner",
  1886. "in": "path",
  1887. "required": true
  1888. },
  1889. {
  1890. "type": "string",
  1891. "description": "name of the repo",
  1892. "name": "repo",
  1893. "in": "path",
  1894. "required": true
  1895. }
  1896. ],
  1897. "responses": {
  1898. "200": {
  1899. "$ref": "#/responses/RepositoryList"
  1900. }
  1901. }
  1902. },
  1903. "post": {
  1904. "produces": [
  1905. "application/json"
  1906. ],
  1907. "tags": [
  1908. "repository"
  1909. ],
  1910. "summary": "Fork a repository",
  1911. "operationId": "createFork",
  1912. "parameters": [
  1913. {
  1914. "type": "string",
  1915. "description": "owner of the repo to fork",
  1916. "name": "owner",
  1917. "in": "path",
  1918. "required": true
  1919. },
  1920. {
  1921. "type": "string",
  1922. "description": "name of the repo to fork",
  1923. "name": "repo",
  1924. "in": "path",
  1925. "required": true
  1926. },
  1927. {
  1928. "name": "body",
  1929. "in": "body",
  1930. "schema": {
  1931. "$ref": "#/definitions/CreateForkOption"
  1932. }
  1933. }
  1934. ],
  1935. "responses": {
  1936. "202": {
  1937. "$ref": "#/responses/Repository"
  1938. }
  1939. }
  1940. }
  1941. },
  1942. "/repos/{owner}/{repo}/git/blobs/{sha}": {
  1943. "get": {
  1944. "produces": [
  1945. "application/json"
  1946. ],
  1947. "tags": [
  1948. "repository"
  1949. ],
  1950. "summary": "Gets the blob of a repository.",
  1951. "operationId": "GetBlob",
  1952. "parameters": [
  1953. {
  1954. "type": "string",
  1955. "description": "owner of the repo",
  1956. "name": "owner",
  1957. "in": "path",
  1958. "required": true
  1959. },
  1960. {
  1961. "type": "string",
  1962. "description": "name of the repo",
  1963. "name": "repo",
  1964. "in": "path",
  1965. "required": true
  1966. },
  1967. {
  1968. "type": "string",
  1969. "description": "sha of the commit",
  1970. "name": "sha",
  1971. "in": "path",
  1972. "required": true
  1973. }
  1974. ],
  1975. "responses": {
  1976. "200": {
  1977. "$ref": "#/responses/GitBlobResponse"
  1978. }
  1979. }
  1980. }
  1981. },
  1982. "/repos/{owner}/{repo}/git/commits/{sha}": {
  1983. "get": {
  1984. "produces": [
  1985. "application/json"
  1986. ],
  1987. "tags": [
  1988. "repository"
  1989. ],
  1990. "summary": "Get a single commit from a repository",
  1991. "operationId": "repoGetSingleCommit",
  1992. "parameters": [
  1993. {
  1994. "type": "string",
  1995. "description": "owner of the repo",
  1996. "name": "owner",
  1997. "in": "path",
  1998. "required": true
  1999. },
  2000. {
  2001. "type": "string",
  2002. "description": "name of the repo",
  2003. "name": "repo",
  2004. "in": "path",
  2005. "required": true
  2006. },
  2007. {
  2008. "type": "string",
  2009. "description": "the commit hash",
  2010. "name": "sha",
  2011. "in": "path",
  2012. "required": true
  2013. }
  2014. ],
  2015. "responses": {
  2016. "200": {
  2017. "$ref": "#/responses/Commit"
  2018. },
  2019. "404": {
  2020. "$ref": "#/responses/notFound"
  2021. }
  2022. }
  2023. }
  2024. },
  2025. "/repos/{owner}/{repo}/git/refs": {
  2026. "get": {
  2027. "produces": [
  2028. "application/json"
  2029. ],
  2030. "tags": [
  2031. "repository"
  2032. ],
  2033. "summary": "Get specified ref or filtered repository's refs",
  2034. "operationId": "repoListAllGitRefs",
  2035. "parameters": [
  2036. {
  2037. "type": "string",
  2038. "description": "owner of the repo",
  2039. "name": "owner",
  2040. "in": "path",
  2041. "required": true
  2042. },
  2043. {
  2044. "type": "string",
  2045. "description": "name of the repo",
  2046. "name": "repo",
  2047. "in": "path",
  2048. "required": true
  2049. }
  2050. ],
  2051. "responses": {
  2052. "200": {
  2053. "$ref": "#/responses/ReferenceList"
  2054. },
  2055. "404": {
  2056. "$ref": "#/responses/notFound"
  2057. }
  2058. }
  2059. }
  2060. },
  2061. "/repos/{owner}/{repo}/git/refs/{ref}": {
  2062. "get": {
  2063. "produces": [
  2064. "application/json"
  2065. ],
  2066. "tags": [
  2067. "repository"
  2068. ],
  2069. "summary": "Get specified ref or filtered repository's refs",
  2070. "operationId": "repoListGitRefs",
  2071. "parameters": [
  2072. {
  2073. "type": "string",
  2074. "description": "owner of the repo",
  2075. "name": "owner",
  2076. "in": "path",
  2077. "required": true
  2078. },
  2079. {
  2080. "type": "string",
  2081. "description": "name of the repo",
  2082. "name": "repo",
  2083. "in": "path",
  2084. "required": true
  2085. },
  2086. {
  2087. "type": "string",
  2088. "description": "part or full name of the ref",
  2089. "name": "ref",
  2090. "in": "path",
  2091. "required": true
  2092. }
  2093. ],
  2094. "responses": {
  2095. "200": {
  2096. "$ref": "#/responses/ReferenceList"
  2097. },
  2098. "404": {
  2099. "$ref": "#/responses/notFound"
  2100. }
  2101. }
  2102. }
  2103. },
  2104. "/repos/{owner}/{repo}/git/tags/{sha}": {
  2105. "get": {
  2106. "produces": [
  2107. "application/json"
  2108. ],
  2109. "tags": [
  2110. "repository"
  2111. ],
  2112. "summary": "Gets the tag of a repository.",
  2113. "operationId": "GetTag",
  2114. "parameters": [
  2115. {
  2116. "type": "string",
  2117. "description": "owner of the repo",
  2118. "name": "owner",
  2119. "in": "path",
  2120. "required": true
  2121. },
  2122. {
  2123. "type": "string",
  2124. "description": "name of the repo",
  2125. "name": "repo",
  2126. "in": "path",
  2127. "required": true
  2128. },
  2129. {
  2130. "type": "string",
  2131. "description": "sha of the tag",
  2132. "name": "sha",
  2133. "in": "path",
  2134. "required": true
  2135. }
  2136. ],
  2137. "responses": {
  2138. "200": {
  2139. "$ref": "#/responses/AnnotatedTag"
  2140. }
  2141. }
  2142. }
  2143. },
  2144. "/repos/{owner}/{repo}/git/trees/{sha}": {
  2145. "get": {
  2146. "produces": [
  2147. "application/json"
  2148. ],
  2149. "tags": [
  2150. "repository"
  2151. ],
  2152. "summary": "Gets the tree of a repository.",
  2153. "operationId": "GetTree",
  2154. "parameters": [
  2155. {
  2156. "type": "string",
  2157. "description": "owner of the repo",
  2158. "name": "owner",
  2159. "in": "path",
  2160. "required": true
  2161. },
  2162. {
  2163. "type": "string",
  2164. "description": "name of the repo",
  2165. "name": "repo",
  2166. "in": "path",
  2167. "required": true
  2168. },
  2169. {
  2170. "type": "string",
  2171. "description": "sha of the commit",
  2172. "name": "sha",
  2173. "in": "path",
  2174. "required": true
  2175. },
  2176. {
  2177. "type": "boolean",
  2178. "description": "show all directories and files",
  2179. "name": "recursive",
  2180. "in": "query"
  2181. },
  2182. {
  2183. "type": "integer",
  2184. "description": "page number; the 'truncated' field in the response will be true if there are still more items after this page, false if the last page",
  2185. "name": "page",
  2186. "in": "query"
  2187. },
  2188. {
  2189. "type": "integer",
  2190. "description": "number of items per page; default is 1000 or what is set in app.ini as DEFAULT_GIT_TREES_PER_PAGE",
  2191. "name": "per_page",
  2192. "in": "query"
  2193. }
  2194. ],
  2195. "responses": {
  2196. "200": {
  2197. "$ref": "#/responses/GitTreeResponse"
  2198. }
  2199. }
  2200. }
  2201. },
  2202. "/repos/{owner}/{repo}/hooks": {
  2203. "get": {
  2204. "produces": [
  2205. "application/json"
  2206. ],
  2207. "tags": [
  2208. "repository"
  2209. ],
  2210. "summary": "List the hooks in a repository",
  2211. "operationId": "repoListHooks",
  2212. "parameters": [
  2213. {
  2214. "type": "string",
  2215. "description": "owner of the repo",
  2216. "name": "owner",
  2217. "in": "path",
  2218. "required": true
  2219. },
  2220. {
  2221. "type": "string",
  2222. "description": "name of the repo",
  2223. "name": "repo",
  2224. "in": "path",
  2225. "required": true
  2226. }
  2227. ],
  2228. "responses": {
  2229. "200": {
  2230. "$ref": "#/responses/HookList"
  2231. }
  2232. }
  2233. },
  2234. "post": {
  2235. "consumes": [
  2236. "application/json"
  2237. ],
  2238. "produces": [
  2239. "application/json"
  2240. ],
  2241. "tags": [
  2242. "repository"
  2243. ],
  2244. "summary": "Create a hook",
  2245. "operationId": "repoCreateHook",
  2246. "parameters": [
  2247. {
  2248. "type": "string",
  2249. "description": "owner of the repo",
  2250. "name": "owner",
  2251. "in": "path",
  2252. "required": true
  2253. },
  2254. {
  2255. "type": "string",
  2256. "description": "name of the repo",
  2257. "name": "repo",
  2258. "in": "path",
  2259. "required": true
  2260. },
  2261. {
  2262. "name": "body",
  2263. "in": "body",
  2264. "schema": {
  2265. "$ref": "#/definitions/CreateHookOption"
  2266. }
  2267. }
  2268. ],
  2269. "responses": {
  2270. "201": {
  2271. "$ref": "#/responses/Hook"
  2272. }
  2273. }
  2274. }
  2275. },
  2276. "/repos/{owner}/{repo}/hooks/git": {
  2277. "get": {
  2278. "produces": [
  2279. "application/json"
  2280. ],
  2281. "tags": [
  2282. "repository"
  2283. ],
  2284. "summary": "List the Git hooks in a repository",
  2285. "operationId": "repoListGitHooks",
  2286. "parameters": [
  2287. {
  2288. "type": "string",
  2289. "description": "owner of the repo",
  2290. "name": "owner",
  2291. "in": "path",
  2292. "required": true
  2293. },
  2294. {
  2295. "type": "string",
  2296. "description": "name of the repo",
  2297. "name": "repo",
  2298. "in": "path",
  2299. "required": true
  2300. }
  2301. ],
  2302. "responses": {
  2303. "200": {
  2304. "$ref": "#/responses/GitHookList"
  2305. }
  2306. }
  2307. }
  2308. },
  2309. "/repos/{owner}/{repo}/hooks/git/{id}": {
  2310. "get": {
  2311. "produces": [
  2312. "application/json"
  2313. ],
  2314. "tags": [
  2315. "repository"
  2316. ],
  2317. "summary": "Get a Git hook",
  2318. "operationId": "repoGetGitHook",
  2319. "parameters": [
  2320. {
  2321. "type": "string",
  2322. "description": "owner of the repo",
  2323. "name": "owner",
  2324. "in": "path",
  2325. "required": true
  2326. },
  2327. {
  2328. "type": "string",
  2329. "description": "name of the repo",
  2330. "name": "repo",
  2331. "in": "path",
  2332. "required": true
  2333. },
  2334. {
  2335. "type": "string",
  2336. "description": "id of the hook to get",
  2337. "name": "id",
  2338. "in": "path",
  2339. "required": true
  2340. }
  2341. ],
  2342. "responses": {
  2343. "200": {
  2344. "$ref": "#/responses/GitHook"
  2345. },
  2346. "404": {
  2347. "$ref": "#/responses/notFound"
  2348. }
  2349. }
  2350. },
  2351. "delete": {
  2352. "produces": [
  2353. "application/json"
  2354. ],
  2355. "tags": [
  2356. "repository"
  2357. ],
  2358. "summary": "Delete a Git hook in a repository",
  2359. "operationId": "repoDeleteGitHook",
  2360. "parameters": [
  2361. {
  2362. "type": "string",
  2363. "description": "owner of the repo",
  2364. "name": "owner",
  2365. "in": "path",
  2366. "required": true
  2367. },
  2368. {
  2369. "type": "string",
  2370. "description": "name of the repo",
  2371. "name": "repo",
  2372. "in": "path",
  2373. "required": true
  2374. },
  2375. {
  2376. "type": "string",
  2377. "description": "id of the hook to get",
  2378. "name": "id",
  2379. "in": "path",
  2380. "required": true
  2381. }
  2382. ],
  2383. "responses": {
  2384. "204": {
  2385. "$ref": "#/responses/empty"
  2386. },
  2387. "404": {
  2388. "$ref": "#/responses/notFound"
  2389. }
  2390. }
  2391. },
  2392. "patch": {
  2393. "produces": [
  2394. "application/json"
  2395. ],
  2396. "tags": [
  2397. "repository"
  2398. ],
  2399. "summary": "Edit a Git hook in a repository",
  2400. "operationId": "repoEditGitHook",
  2401. "parameters": [
  2402. {
  2403. "type": "string",
  2404. "description": "owner of the repo",
  2405. "name": "owner",
  2406. "in": "path",
  2407. "required": true
  2408. },
  2409. {
  2410. "type": "string",
  2411. "description": "name of the repo",
  2412. "name": "repo",
  2413. "in": "path",
  2414. "required": true
  2415. },
  2416. {
  2417. "type": "string",
  2418. "description": "id of the hook to get",
  2419. "name": "id",
  2420. "in": "path",
  2421. "required": true
  2422. },
  2423. {
  2424. "name": "body",
  2425. "in": "body",
  2426. "schema": {
  2427. "$ref": "#/definitions/EditGitHookOption"
  2428. }
  2429. }
  2430. ],
  2431. "responses": {
  2432. "200": {
  2433. "$ref": "#/responses/GitHook"
  2434. },
  2435. "404": {
  2436. "$ref": "#/responses/notFound"
  2437. }
  2438. }
  2439. }
  2440. },
  2441. "/repos/{owner}/{repo}/hooks/{id}": {
  2442. "get": {
  2443. "produces": [
  2444. "application/json"
  2445. ],
  2446. "tags": [
  2447. "repository"
  2448. ],
  2449. "summary": "Get a hook",
  2450. "operationId": "repoGetHook",
  2451. "parameters": [
  2452. {
  2453. "type": "string",
  2454. "description": "owner of the repo",
  2455. "name": "owner",
  2456. "in": "path",
  2457. "required": true
  2458. },
  2459. {
  2460. "type": "string",
  2461. "description": "name of the repo",
  2462. "name": "repo",
  2463. "in": "path",
  2464. "required": true
  2465. },
  2466. {
  2467. "type": "integer",
  2468. "format": "int64",
  2469. "description": "id of the hook to get",
  2470. "name": "id",
  2471. "in": "path",
  2472. "required": true
  2473. }
  2474. ],
  2475. "responses": {
  2476. "200": {
  2477. "$ref": "#/responses/Hook"
  2478. }
  2479. }
  2480. },
  2481. "delete": {
  2482. "produces": [
  2483. "application/json"
  2484. ],
  2485. "tags": [
  2486. "repository"
  2487. ],
  2488. "summary": "Delete a hook in a repository",
  2489. "operationId": "repoDeleteHook",
  2490. "parameters": [
  2491. {
  2492. "type": "string",
  2493. "description": "owner of the repo",
  2494. "name": "owner",
  2495. "in": "path",
  2496. "required": true
  2497. },
  2498. {
  2499. "type": "string",
  2500. "description": "name of the repo",
  2501. "name": "repo",
  2502. "in": "path",
  2503. "required": true
  2504. },
  2505. {
  2506. "type": "integer",
  2507. "format": "int64",
  2508. "description": "id of the hook to delete",
  2509. "name": "id",
  2510. "in": "path",
  2511. "required": true
  2512. }
  2513. ],
  2514. "responses": {
  2515. "204": {
  2516. "$ref": "#/responses/empty"
  2517. },
  2518. "404": {
  2519. "$ref": "#/responses/notFound"
  2520. }
  2521. }
  2522. },
  2523. "patch": {
  2524. "produces": [
  2525. "application/json"
  2526. ],
  2527. "tags": [
  2528. "repository"
  2529. ],
  2530. "summary": "Edit a hook in a repository",
  2531. "operationId": "repoEditHook",
  2532. "parameters": [
  2533. {
  2534. "type": "string",
  2535. "description": "owner of the repo",
  2536. "name": "owner",
  2537. "in": "path",
  2538. "required": true
  2539. },
  2540. {
  2541. "type": "string",
  2542. "description": "name of the repo",
  2543. "name": "repo",
  2544. "in": "path",
  2545. "required": true
  2546. },
  2547. {
  2548. "type": "integer",
  2549. "format": "int64",
  2550. "description": "index of the hook",
  2551. "name": "id",
  2552. "in": "path",
  2553. "required": true
  2554. },
  2555. {
  2556. "name": "body",
  2557. "in": "body",
  2558. "schema": {
  2559. "$ref": "#/definitions/EditHookOption"
  2560. }
  2561. }
  2562. ],
  2563. "responses": {
  2564. "200": {
  2565. "$ref": "#/responses/Hook"
  2566. }
  2567. }
  2568. }
  2569. },
  2570. "/repos/{owner}/{repo}/hooks/{id}/tests": {
  2571. "post": {
  2572. "produces": [
  2573. "application/json"
  2574. ],
  2575. "tags": [
  2576. "repository"
  2577. ],
  2578. "summary": "Test a push webhook",
  2579. "operationId": "repoTestHook",
  2580. "parameters": [
  2581. {
  2582. "type": "string",
  2583. "description": "owner of the repo",
  2584. "name": "owner",
  2585. "in": "path",
  2586. "required": true
  2587. },
  2588. {
  2589. "type": "string",
  2590. "description": "name of the repo",
  2591. "name": "repo",
  2592. "in": "path",
  2593. "required": true
  2594. },
  2595. {
  2596. "type": "integer",
  2597. "format": "int64",
  2598. "description": "id of the hook to test",
  2599. "name": "id",
  2600. "in": "path",
  2601. "required": true
  2602. }
  2603. ],
  2604. "responses": {
  2605. "204": {
  2606. "$ref": "#/responses/empty"
  2607. }
  2608. }
  2609. }
  2610. },
  2611. "/repos/{owner}/{repo}/issues": {
  2612. "get": {
  2613. "produces": [
  2614. "application/json"
  2615. ],
  2616. "tags": [
  2617. "issue"
  2618. ],
  2619. "summary": "List a repository's issues",
  2620. "operationId": "issueListIssues",
  2621. "parameters": [
  2622. {
  2623. "type": "string",
  2624. "description": "owner of the repo",
  2625. "name": "owner",
  2626. "in": "path",
  2627. "required": true
  2628. },
  2629. {
  2630. "type": "string",
  2631. "description": "name of the repo",
  2632. "name": "repo",
  2633. "in": "path",
  2634. "required": true
  2635. },
  2636. {
  2637. "type": "string",
  2638. "description": "whether issue is open or closed",
  2639. "name": "state",
  2640. "in": "query"
  2641. },
  2642. {
  2643. "type": "string",
  2644. "description": "comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded",
  2645. "name": "labels",
  2646. "in": "query"
  2647. },
  2648. {
  2649. "type": "integer",
  2650. "description": "page number of requested issues",
  2651. "name": "page",
  2652. "in": "query"
  2653. },
  2654. {
  2655. "type": "string",
  2656. "description": "search string",
  2657. "name": "q",
  2658. "in": "query"
  2659. }
  2660. ],
  2661. "responses": {
  2662. "200": {
  2663. "$ref": "#/responses/IssueList"
  2664. }
  2665. }
  2666. },
  2667. "post": {
  2668. "consumes": [
  2669. "application/json"
  2670. ],
  2671. "produces": [
  2672. "application/json"
  2673. ],
  2674. "tags": [
  2675. "issue"
  2676. ],
  2677. "summary": "Create an issue. If using deadline only the date will be taken into account, and time of day ignored.",
  2678. "operationId": "issueCreateIssue",
  2679. "parameters": [
  2680. {
  2681. "type": "string",
  2682. "description": "owner of the repo",
  2683. "name": "owner",
  2684. "in": "path",
  2685. "required": true
  2686. },
  2687. {
  2688. "type": "string",
  2689. "description": "name of the repo",
  2690. "name": "repo",
  2691. "in": "path",
  2692. "required": true
  2693. },
  2694. {
  2695. "name": "body",
  2696. "in": "body",
  2697. "schema": {
  2698. "$ref": "#/definitions/CreateIssueOption"
  2699. }
  2700. }
  2701. ],
  2702. "responses": {
  2703. "201": {
  2704. "$ref": "#/responses/Issue"
  2705. }
  2706. }
  2707. }
  2708. },
  2709. "/repos/{owner}/{repo}/issues/comments": {
  2710. "get": {
  2711. "produces": [
  2712. "application/json"
  2713. ],
  2714. "tags": [
  2715. "issue"
  2716. ],
  2717. "summary": "List all comments in a repository",
  2718. "operationId": "issueGetRepoComments",
  2719. "parameters": [
  2720. {
  2721. "type": "string",
  2722. "description": "owner of the repo",
  2723. "name": "owner",
  2724. "in": "path",
  2725. "required": true
  2726. },
  2727. {
  2728. "type": "string",
  2729. "description": "name of the repo",
  2730. "name": "repo",
  2731. "in": "path",
  2732. "required": true
  2733. },
  2734. {
  2735. "type": "string",
  2736. "description": "if provided, only comments updated since the provided time are returned.",
  2737. "name": "since",
  2738. "in": "query"
  2739. }
  2740. ],
  2741. "responses": {
  2742. "200": {
  2743. "$ref": "#/responses/CommentList"
  2744. }
  2745. }
  2746. }
  2747. },
  2748. "/repos/{owner}/{repo}/issues/comments/{id}": {
  2749. "delete": {
  2750. "tags": [
  2751. "issue"
  2752. ],
  2753. "summary": "Delete a comment",
  2754. "operationId": "issueDeleteComment",
  2755. "parameters": [
  2756. {
  2757. "type": "string",
  2758. "description": "owner of the repo",
  2759. "name": "owner",
  2760. "in": "path",
  2761. "required": true
  2762. },
  2763. {
  2764. "type": "string",
  2765. "description": "name of the repo",
  2766. "name": "repo",
  2767. "in": "path",
  2768. "required": true
  2769. },
  2770. {
  2771. "type": "integer",
  2772. "format": "int64",
  2773. "description": "id of comment to delete",
  2774. "name": "id",
  2775. "in": "path",
  2776. "required": true
  2777. }
  2778. ],
  2779. "responses": {
  2780. "204": {
  2781. "$ref": "#/responses/empty"
  2782. }
  2783. }
  2784. },
  2785. "patch": {
  2786. "consumes": [
  2787. "application/json"
  2788. ],
  2789. "produces": [
  2790. "application/json"
  2791. ],
  2792. "tags": [
  2793. "issue"
  2794. ],
  2795. "summary": "Edit a comment",
  2796. "operationId": "issueEditComment",
  2797. "parameters": [
  2798. {
  2799. "type": "string",
  2800. "description": "owner of the repo",
  2801. "name": "owner",
  2802. "in": "path",
  2803. "required": true
  2804. },
  2805. {
  2806. "type": "string",
  2807. "description": "name of the repo",
  2808. "name": "repo",
  2809. "in": "path",
  2810. "required": true
  2811. },
  2812. {
  2813. "type": "integer",
  2814. "format": "int64",
  2815. "description": "id of the comment to edit",
  2816. "name": "id",
  2817. "in": "path",
  2818. "required": true
  2819. },
  2820. {
  2821. "name": "body",
  2822. "in": "body",
  2823. "schema": {
  2824. "$ref": "#/definitions/EditIssueCommentOption"
  2825. }
  2826. }
  2827. ],
  2828. "responses": {
  2829. "200": {
  2830. "$ref": "#/responses/Comment"
  2831. }
  2832. }
  2833. }
  2834. },
  2835. "/repos/{owner}/{repo}/issues/{id}/times": {
  2836. "get": {
  2837. "produces": [
  2838. "application/json"
  2839. ],
  2840. "tags": [
  2841. "issue"
  2842. ],
  2843. "summary": "List an issue's tracked times",
  2844. "operationId": "issueTrackedTimes",
  2845. "parameters": [
  2846. {
  2847. "type": "string",
  2848. "description": "owner of the repo",
  2849. "name": "owner",
  2850. "in": "path",
  2851. "required": true
  2852. },
  2853. {
  2854. "type": "string",
  2855. "description": "name of the repo",
  2856. "name": "repo",
  2857. "in": "path",
  2858. "required": true
  2859. },
  2860. {
  2861. "type": "integer",
  2862. "format": "int64",
  2863. "description": "index of the issue",
  2864. "name": "id",
  2865. "in": "path",
  2866. "required": true
  2867. }
  2868. ],
  2869. "responses": {
  2870. "200": {
  2871. "$ref": "#/responses/TrackedTimeList"
  2872. }
  2873. }
  2874. },
  2875. "post": {
  2876. "consumes": [
  2877. "application/json"
  2878. ],
  2879. "produces": [
  2880. "application/json"
  2881. ],
  2882. "tags": [
  2883. "issue"
  2884. ],
  2885. "summary": "Add a tracked time to a issue",
  2886. "operationId": "issueAddTime",
  2887. "parameters": [
  2888. {
  2889. "type": "string",
  2890. "description": "owner of the repo",
  2891. "name": "owner",
  2892. "in": "path",
  2893. "required": true
  2894. },
  2895. {
  2896. "type": "string",
  2897. "description": "name of the repo",
  2898. "name": "repo",
  2899. "in": "path",
  2900. "required": true
  2901. },
  2902. {
  2903. "type": "integer",
  2904. "format": "int64",
  2905. "description": "index of the issue to add tracked time to",
  2906. "name": "id",
  2907. "in": "path",
  2908. "required": true
  2909. },
  2910. {
  2911. "name": "body",
  2912. "in": "body",
  2913. "schema": {
  2914. "$ref": "#/definitions/AddTimeOption"
  2915. }
  2916. }
  2917. ],
  2918. "responses": {
  2919. "200": {
  2920. "$ref": "#/responses/TrackedTime"
  2921. },
  2922. "400": {
  2923. "$ref": "#/responses/error"
  2924. },
  2925. "403": {
  2926. "$ref": "#/responses/error"
  2927. }
  2928. }
  2929. }
  2930. },
  2931. "/repos/{owner}/{repo}/issues/{index}": {
  2932. "get": {
  2933. "produces": [
  2934. "application/json"
  2935. ],
  2936. "tags": [
  2937. "issue"
  2938. ],
  2939. "summary": "Get an issue",
  2940. "operationId": "issueGetIssue",
  2941. "parameters": [
  2942. {
  2943. "type": "string",
  2944. "description": "owner of the repo",
  2945. "name": "owner",
  2946. "in": "path",
  2947. "required": true
  2948. },
  2949. {
  2950. "type": "string",
  2951. "description": "name of the repo",
  2952. "name": "repo",
  2953. "in": "path",
  2954. "required": true
  2955. },
  2956. {
  2957. "type": "integer",
  2958. "format": "int64",
  2959. "description": "index of the issue to get",
  2960. "name": "index",
  2961. "in": "path",
  2962. "required": true
  2963. }
  2964. ],
  2965. "responses": {
  2966. "200": {
  2967. "$ref": "#/responses/Issue"
  2968. }
  2969. }
  2970. },
  2971. "patch": {
  2972. "consumes": [
  2973. "application/json"
  2974. ],
  2975. "produces": [
  2976. "application/json"
  2977. ],
  2978. "tags": [
  2979. "issue"
  2980. ],
  2981. "summary": "Edit an issue. If using deadline only the date will be taken into account, and time of day ignored.",
  2982. "operationId": "issueEditIssue",
  2983. "parameters": [
  2984. {
  2985. "type": "string",
  2986. "description": "owner of the repo",
  2987. "name": "owner",
  2988. "in": "path",
  2989. "required": true
  2990. },
  2991. {
  2992. "type": "string",
  2993. "description": "name of the repo",
  2994. "name": "repo",
  2995. "in": "path",
  2996. "required": true
  2997. },
  2998. {
  2999. "type": "integer",
  3000. "format": "int64",
  3001. "description": "index of the issue to edit",
  3002. "name": "index",
  3003. "in": "path",
  3004. "required": true
  3005. },
  3006. {
  3007. "name": "body",
  3008. "in": "body",
  3009. "schema": {
  3010. "$ref": "#/definitions/EditIssueOption"
  3011. }
  3012. }
  3013. ],
  3014. "responses": {
  3015. "201": {
  3016. "$ref": "#/responses/Issue"
  3017. }
  3018. }
  3019. }
  3020. },
  3021. "/repos/{owner}/{repo}/issues/{index}/comments": {
  3022. "get": {
  3023. "produces": [
  3024. "application/json"
  3025. ],
  3026. "tags": [
  3027. "issue"
  3028. ],
  3029. "summary": "List all comments on an issue",
  3030. "operationId": "issueGetComments",
  3031. "parameters": [
  3032. {
  3033. "type": "string",
  3034. "description": "owner of the repo",
  3035. "name": "owner",
  3036. "in": "path",
  3037. "required": true
  3038. },
  3039. {
  3040. "type": "string",
  3041. "description": "name of the repo",
  3042. "name": "repo",
  3043. "in": "path",
  3044. "required": true
  3045. },
  3046. {
  3047. "type": "integer",
  3048. "format": "int64",
  3049. "description": "index of the issue",
  3050. "name": "index",
  3051. "in": "path",
  3052. "required": true
  3053. },
  3054. {
  3055. "type": "string",
  3056. "description": "if provided, only comments updated since the specified time are returned.",
  3057. "name": "since",
  3058. "in": "query"
  3059. }
  3060. ],
  3061. "responses": {
  3062. "200": {
  3063. "$ref": "#/responses/CommentList"
  3064. }
  3065. }
  3066. },
  3067. "post": {
  3068. "consumes": [
  3069. "application/json"
  3070. ],
  3071. "produces": [
  3072. "application/json"
  3073. ],
  3074. "tags": [
  3075. "issue"
  3076. ],
  3077. "summary": "Add a comment to an issue",
  3078. "operationId": "issueCreateComment",
  3079. "parameters": [
  3080. {
  3081. "type": "string",
  3082. "description": "owner of the repo",
  3083. "name": "owner",
  3084. "in": "path",
  3085. "required": true
  3086. },
  3087. {
  3088. "type": "string",
  3089. "description": "name of the repo",
  3090. "name": "repo",
  3091. "in": "path",
  3092. "required": true
  3093. },
  3094. {
  3095. "type": "integer",
  3096. "format": "int64",
  3097. "description": "index of the issue",
  3098. "name": "index",
  3099. "in": "path",
  3100. "required": true
  3101. },
  3102. {
  3103. "name": "body",
  3104. "in": "body",
  3105. "schema": {
  3106. "$ref": "#/definitions/CreateIssueCommentOption"
  3107. }
  3108. }
  3109. ],
  3110. "responses": {
  3111. "201": {
  3112. "$ref": "#/responses/Comment"
  3113. }
  3114. }
  3115. }
  3116. },
  3117. "/repos/{owner}/{repo}/issues/{index}/comments/{id}": {
  3118. "delete": {
  3119. "tags": [
  3120. "issue"
  3121. ],
  3122. "summary": "Delete a comment",
  3123. "operationId": "issueDeleteCommentDeprecated",
  3124. "deprecated": true,
  3125. "parameters": [
  3126. {
  3127. "type": "string",
  3128. "description": "owner of the repo",
  3129. "name": "owner",
  3130. "in": "path",
  3131. "required": true
  3132. },
  3133. {
  3134. "type": "string",
  3135. "description": "name of the repo",
  3136. "name": "repo",
  3137. "in": "path",
  3138. "required": true
  3139. },
  3140. {
  3141. "type": "integer",
  3142. "description": "this parameter is ignored",
  3143. "name": "index",
  3144. "in": "path",
  3145. "required": true
  3146. },
  3147. {
  3148. "type": "integer",
  3149. "format": "int64",
  3150. "description": "id of comment to delete",
  3151. "name": "id",
  3152. "in": "path",
  3153. "required": true
  3154. }
  3155. ],
  3156. "responses": {
  3157. "204": {
  3158. "$ref": "#/responses/empty"
  3159. }
  3160. }
  3161. },
  3162. "patch": {
  3163. "consumes": [
  3164. "application/json"
  3165. ],
  3166. "produces": [
  3167. "application/json"
  3168. ],
  3169. "tags": [
  3170. "issue"
  3171. ],
  3172. "summary": "Edit a comment",
  3173. "operationId": "issueEditCommentDeprecated",
  3174. "deprecated": true,
  3175. "parameters": [
  3176. {
  3177. "type": "string",
  3178. "description": "owner of the repo",
  3179. "name": "owner",
  3180. "in": "path",
  3181. "required": true
  3182. },
  3183. {
  3184. "type": "string",
  3185. "description": "name of the repo",
  3186. "name": "repo",
  3187. "in": "path",
  3188. "required": true
  3189. },
  3190. {
  3191. "type": "integer",
  3192. "description": "this parameter is ignored",
  3193. "name": "index",
  3194. "in": "path",
  3195. "required": true
  3196. },
  3197. {
  3198. "type": "integer",
  3199. "format": "int64",
  3200. "description": "id of the comment to edit",
  3201. "name": "id",
  3202. "in": "path",
  3203. "required": true
  3204. },
  3205. {
  3206. "name": "body",
  3207. "in": "body",
  3208. "schema": {
  3209. "$ref": "#/definitions/EditIssueCommentOption"
  3210. }
  3211. }
  3212. ],
  3213. "responses": {
  3214. "200": {
  3215. "$ref": "#/responses/Comment"
  3216. }
  3217. }
  3218. }
  3219. },
  3220. "/repos/{owner}/{repo}/issues/{index}/deadline": {
  3221. "post": {
  3222. "consumes": [
  3223. "application/json"
  3224. ],
  3225. "produces": [
  3226. "application/json"
  3227. ],
  3228. "tags": [
  3229. "issue"
  3230. ],
  3231. "summary": "Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored.",
  3232. "operationId": "issueEditIssueDeadline",
  3233. "parameters": [
  3234. {
  3235. "type": "string",
  3236. "description": "owner of the repo",
  3237. "name": "owner",
  3238. "in": "path",
  3239. "required": true
  3240. },
  3241. {
  3242. "type": "string",
  3243. "description": "name of the repo",
  3244. "name": "repo",
  3245. "in": "path",
  3246. "required": true
  3247. },
  3248. {
  3249. "type": "integer",
  3250. "format": "int64",
  3251. "description": "index of the issue to create or update a deadline on",
  3252. "name": "index",
  3253. "in": "path",
  3254. "required": true
  3255. },
  3256. {
  3257. "name": "body",
  3258. "in": "body",
  3259. "schema": {
  3260. "$ref": "#/definitions/EditDeadlineOption"
  3261. }
  3262. }
  3263. ],
  3264. "responses": {
  3265. "201": {
  3266. "$ref": "#/responses/IssueDeadline"
  3267. },
  3268. "403": {
  3269. "description": "Not repo writer"
  3270. },
  3271. "404": {
  3272. "description": "Issue not found"
  3273. }
  3274. }
  3275. }
  3276. },
  3277. "/repos/{owner}/{repo}/issues/{index}/labels": {
  3278. "get": {
  3279. "produces": [
  3280. "application/json"
  3281. ],
  3282. "tags": [
  3283. "issue"
  3284. ],
  3285. "summary": "Get an issue's labels",
  3286. "operationId": "issueGetLabels",
  3287. "parameters": [
  3288. {
  3289. "type": "string",
  3290. "description": "owner of the repo",
  3291. "name": "owner",
  3292. "in": "path",
  3293. "required": true
  3294. },
  3295. {
  3296. "type": "string",
  3297. "description": "name of the repo",
  3298. "name": "repo",
  3299. "in": "path",
  3300. "required": true
  3301. },
  3302. {
  3303. "type": "integer",
  3304. "format": "int64",
  3305. "description": "index of the issue",
  3306. "name": "index",
  3307. "in": "path",
  3308. "required": true
  3309. }
  3310. ],
  3311. "responses": {
  3312. "200": {
  3313. "$ref": "#/responses/LabelList"
  3314. },
  3315. "404": {
  3316. "$ref": "#/responses/notFound"
  3317. }
  3318. }
  3319. },
  3320. "put": {
  3321. "consumes": [
  3322. "application/json"
  3323. ],
  3324. "produces": [
  3325. "application/json"
  3326. ],
  3327. "tags": [
  3328. "issue"
  3329. ],
  3330. "summary": "Replace an issue's labels",
  3331. "operationId": "issueReplaceLabels",
  3332. "parameters": [
  3333. {
  3334. "type": "string",
  3335. "description": "owner of the repo",
  3336. "name": "owner",
  3337. "in": "path",
  3338. "required": true
  3339. },
  3340. {
  3341. "type": "string",
  3342. "description": "name of the repo",
  3343. "name": "repo",
  3344. "in": "path",
  3345. "required": true
  3346. },
  3347. {
  3348. "type": "integer",
  3349. "format": "int64",
  3350. "description": "index of the issue",
  3351. "name": "index",
  3352. "in": "path",
  3353. "required": true
  3354. },
  3355. {
  3356. "name": "body",
  3357. "in": "body",
  3358. "schema": {
  3359. "$ref": "#/definitions/IssueLabelsOption"
  3360. }
  3361. }
  3362. ],
  3363. "responses": {
  3364. "200": {
  3365. "$ref": "#/responses/LabelList"
  3366. }
  3367. }
  3368. },
  3369. "post": {
  3370. "consumes": [
  3371. "application/json"
  3372. ],
  3373. "produces": [
  3374. "application/json"
  3375. ],
  3376. "tags": [
  3377. "issue"
  3378. ],
  3379. "summary": "Add a label to an issue",
  3380. "operationId": "issueAddLabel",
  3381. "parameters": [
  3382. {
  3383. "type": "string",
  3384. "description": "owner of the repo",
  3385. "name": "owner",
  3386. "in": "path",
  3387. "required": true
  3388. },
  3389. {
  3390. "type": "string",
  3391. "description": "name of the repo",
  3392. "name": "repo",
  3393. "in": "path",
  3394. "required": true
  3395. },
  3396. {
  3397. "type": "integer",
  3398. "format": "int64",
  3399. "description": "index of the issue",
  3400. "name": "index",
  3401. "in": "path",
  3402. "required": true
  3403. },
  3404. {
  3405. "name": "body",
  3406. "in": "body",
  3407. "schema": {
  3408. "$ref": "#/definitions/IssueLabelsOption"
  3409. }
  3410. }
  3411. ],
  3412. "responses": {
  3413. "200": {
  3414. "$ref": "#/responses/LabelList"
  3415. }
  3416. }
  3417. },
  3418. "delete": {
  3419. "produces": [
  3420. "application/json"
  3421. ],
  3422. "tags": [
  3423. "issue"
  3424. ],
  3425. "summary": "Remove all labels from an issue",
  3426. "operationId": "issueClearLabels",
  3427. "parameters": [
  3428. {
  3429. "type": "string",
  3430. "description": "owner of the repo",
  3431. "name": "owner",
  3432. "in": "path",
  3433. "required": true
  3434. },
  3435. {
  3436. "type": "string",
  3437. "description": "name of the repo",
  3438. "name": "repo",
  3439. "in": "path",
  3440. "required": true
  3441. },
  3442. {
  3443. "type": "integer",
  3444. "format": "int64",
  3445. "description": "index of the issue",
  3446. "name": "index",
  3447. "in": "path",
  3448. "required": true
  3449. }
  3450. ],
  3451. "responses": {
  3452. "204": {
  3453. "$ref": "#/responses/empty"
  3454. }
  3455. }
  3456. }
  3457. },
  3458. "/repos/{owner}/{repo}/issues/{index}/labels/{id}": {
  3459. "delete": {
  3460. "produces": [
  3461. "application/json"
  3462. ],
  3463. "tags": [
  3464. "issue"
  3465. ],
  3466. "summary": "Remove a label from an issue",
  3467. "operationId": "issueRemoveLabel",
  3468. "parameters": [
  3469. {
  3470. "type": "string",
  3471. "description": "owner of the repo",
  3472. "name": "owner",
  3473. "in": "path",
  3474. "required": true
  3475. },
  3476. {
  3477. "type": "string",
  3478. "description": "name of the repo",
  3479. "name": "repo",
  3480. "in": "path",
  3481. "required": true
  3482. },
  3483. {
  3484. "type": "integer",
  3485. "format": "int64",
  3486. "description": "index of the issue",
  3487. "name": "index",
  3488. "in": "path",
  3489. "required": true
  3490. },
  3491. {
  3492. "type": "integer",
  3493. "format": "int64",
  3494. "description": "id of the label to remove",
  3495. "name": "id",
  3496. "in": "path",
  3497. "required": true
  3498. }
  3499. ],
  3500. "responses": {
  3501. "204": {
  3502. "$ref": "#/responses/empty"
  3503. }
  3504. }
  3505. }
  3506. },
  3507. "/repos/{owner}/{repo}/issues/{index}/stopwatch/start": {
  3508. "post": {
  3509. "consumes": [
  3510. "application/json"
  3511. ],
  3512. "produces": [
  3513. "application/json"
  3514. ],
  3515. "tags": [
  3516. "issue"
  3517. ],
  3518. "summary": "Start stopwatch on an issue.",
  3519. "operationId": "issueStartStopWatch",
  3520. "parameters": [
  3521. {
  3522. "type": "string",
  3523. "description": "owner of the repo",
  3524. "name": "owner",
  3525. "in": "path",
  3526. "required": true
  3527. },
  3528. {
  3529. "type": "string",
  3530. "description": "name of the repo",
  3531. "name": "repo",
  3532. "in": "path",
  3533. "required": true
  3534. },
  3535. {
  3536. "type": "integer",
  3537. "format": "int64",
  3538. "description": "index of the issue to create the stopwatch on",
  3539. "name": "index",
  3540. "in": "path",
  3541. "required": true
  3542. }
  3543. ],
  3544. "responses": {
  3545. "201": {
  3546. "$ref": "#/responses/empty"
  3547. },
  3548. "403": {
  3549. "description": "Not repo writer, user does not have rights to toggle stopwatch"
  3550. },
  3551. "404": {
  3552. "description": "Issue not found"
  3553. },
  3554. "409": {
  3555. "description": "Cannot start a stopwatch again if it already exists"
  3556. }
  3557. }
  3558. }
  3559. },
  3560. "/repos/{owner}/{repo}/issues/{index}/stopwatch/stop": {
  3561. "post": {
  3562. "consumes": [
  3563. "application/json"
  3564. ],
  3565. "produces": [
  3566. "application/json"
  3567. ],
  3568. "tags": [
  3569. "issue"
  3570. ],
  3571. "summary": "Stop an issue's existing stopwatch.",
  3572. "operationId": "issueStopWatch",
  3573. "parameters": [
  3574. {
  3575. "type": "string",
  3576. "description": "owner of the repo",
  3577. "name": "owner",
  3578. "in": "path",
  3579. "required": true
  3580. },
  3581. {
  3582. "type": "string",
  3583. "description": "name of the repo",
  3584. "name": "repo",
  3585. "in": "path",
  3586. "required": true
  3587. },
  3588. {
  3589. "type": "integer",
  3590. "format": "int64",
  3591. "description": "index of the issue to stop the stopwatch on",
  3592. "name": "index",
  3593. "in": "path",
  3594. "required": true
  3595. }
  3596. ],
  3597. "responses": {
  3598. "201": {
  3599. "$ref": "#/responses/empty"
  3600. },
  3601. "403": {
  3602. "description": "Not repo writer, user does not have rights to toggle stopwatch"
  3603. },
  3604. "404": {
  3605. "description": "Issue not found"
  3606. },
  3607. "409": {
  3608. "description": "Cannot stop a non existent stopwatch"
  3609. }
  3610. }
  3611. }
  3612. },
  3613. "/repos/{owner}/{repo}/keys": {
  3614. "get": {
  3615. "produces": [
  3616. "application/json"
  3617. ],
  3618. "tags": [
  3619. "repository"
  3620. ],
  3621. "summary": "List a repository's keys",
  3622. "operationId": "repoListKeys",
  3623. "parameters": [
  3624. {
  3625. "type": "string",
  3626. "description": "owner of the repo",
  3627. "name": "owner",
  3628. "in": "path",
  3629. "required": true
  3630. },
  3631. {
  3632. "type": "string",
  3633. "description": "name of the repo",
  3634. "name": "repo",
  3635. "in": "path",
  3636. "required": true
  3637. },
  3638. {
  3639. "type": "integer",
  3640. "description": "the key_id to search for",
  3641. "name": "key_id",
  3642. "in": "query"
  3643. },
  3644. {
  3645. "type": "string",
  3646. "description": "fingerprint of the key",
  3647. "name": "fingerprint",
  3648. "in": "query"
  3649. }
  3650. ],
  3651. "responses": {
  3652. "200": {
  3653. "$ref": "#/responses/DeployKeyList"
  3654. }
  3655. }
  3656. },
  3657. "post": {
  3658. "consumes": [
  3659. "application/json"
  3660. ],
  3661. "produces": [
  3662. "application/json"
  3663. ],
  3664. "tags": [
  3665. "repository"
  3666. ],
  3667. "summary": "Add a key to a repository",
  3668. "operationId": "repoCreateKey",
  3669. "parameters": [
  3670. {
  3671. "type": "string",
  3672. "description": "owner of the repo",
  3673. "name": "owner",
  3674. "in": "path",
  3675. "required": true
  3676. },
  3677. {
  3678. "type": "string",
  3679. "description": "name of the repo",
  3680. "name": "repo",
  3681. "in": "path",
  3682. "required": true
  3683. },
  3684. {
  3685. "name": "body",
  3686. "in": "body",
  3687. "schema": {
  3688. "$ref": "#/definitions/CreateKeyOption"
  3689. }
  3690. }
  3691. ],
  3692. "responses": {
  3693. "201": {
  3694. "$ref": "#/responses/DeployKey"
  3695. }
  3696. }
  3697. }
  3698. },
  3699. "/repos/{owner}/{repo}/keys/{id}": {
  3700. "get": {
  3701. "produces": [
  3702. "application/json"
  3703. ],
  3704. "tags": [
  3705. "repository"
  3706. ],
  3707. "summary": "Get a repository's key by id",
  3708. "operationId": "repoGetKey",
  3709. "parameters": [
  3710. {
  3711. "type": "string",
  3712. "description": "owner of the repo",
  3713. "name": "owner",
  3714. "in": "path",
  3715. "required": true
  3716. },
  3717. {
  3718. "type": "string",
  3719. "description": "name of the repo",
  3720. "name": "repo",
  3721. "in": "path",
  3722. "required": true
  3723. },
  3724. {
  3725. "type": "integer",
  3726. "format": "int64",
  3727. "description": "id of the key to get",
  3728. "name": "id",
  3729. "in": "path",
  3730. "required": true
  3731. }
  3732. ],
  3733. "responses": {
  3734. "200": {
  3735. "$ref": "#/responses/DeployKey"
  3736. }
  3737. }
  3738. },
  3739. "delete": {
  3740. "tags": [
  3741. "repository"
  3742. ],
  3743. "summary": "Delete a key from a repository",
  3744. "operationId": "repoDeleteKey",
  3745. "parameters": [
  3746. {
  3747. "type": "string",
  3748. "description": "owner of the repo",
  3749. "name": "owner",
  3750. "in": "path",
  3751. "required": true
  3752. },
  3753. {
  3754. "type": "string",
  3755. "description": "name of the repo",
  3756. "name": "repo",
  3757. "in": "path",
  3758. "required": true
  3759. },
  3760. {
  3761. "type": "integer",
  3762. "format": "int64",
  3763. "description": "id of the key to delete",
  3764. "name": "id",
  3765. "in": "path",
  3766. "required": true
  3767. }
  3768. ],
  3769. "responses": {
  3770. "204": {
  3771. "$ref": "#/responses/empty"
  3772. }
  3773. }
  3774. }
  3775. },
  3776. "/repos/{owner}/{repo}/labels": {
  3777. "get": {
  3778. "produces": [
  3779. "application/json"
  3780. ],
  3781. "tags": [
  3782. "issue"
  3783. ],
  3784. "summary": "Get all of a repository's labels",
  3785. "operationId": "issueListLabels",
  3786. "parameters": [
  3787. {
  3788. "type": "string",
  3789. "description": "owner of the repo",
  3790. "name": "owner",
  3791. "in": "path",
  3792. "required": true
  3793. },
  3794. {
  3795. "type": "string",
  3796. "description": "name of the repo",
  3797. "name": "repo",
  3798. "in": "path",
  3799. "required": true
  3800. }
  3801. ],
  3802. "responses": {
  3803. "200": {
  3804. "$ref": "#/responses/LabelList"
  3805. }
  3806. }
  3807. },
  3808. "post": {
  3809. "consumes": [
  3810. "application/json"
  3811. ],
  3812. "produces": [
  3813. "application/json"
  3814. ],
  3815. "tags": [
  3816. "issue"
  3817. ],
  3818. "summary": "Create a label",
  3819. "operationId": "issueCreateLabel",
  3820. "parameters": [
  3821. {
  3822. "type": "string",
  3823. "description": "owner of the repo",
  3824. "name": "owner",
  3825. "in": "path",
  3826. "required": true
  3827. },
  3828. {
  3829. "type": "string",
  3830. "description": "name of the repo",
  3831. "name": "repo",
  3832. "in": "path",
  3833. "required": true
  3834. },
  3835. {
  3836. "name": "body",
  3837. "in": "body",
  3838. "schema": {
  3839. "$ref": "#/definitions/CreateLabelOption"
  3840. }
  3841. }
  3842. ],
  3843. "responses": {
  3844. "201": {
  3845. "$ref": "#/responses/Label"
  3846. }
  3847. }
  3848. }
  3849. },
  3850. "/repos/{owner}/{repo}/labels/{id}": {
  3851. "get": {
  3852. "produces": [
  3853. "application/json"
  3854. ],
  3855. "tags": [
  3856. "issue"
  3857. ],
  3858. "summary": "Get a single label",
  3859. "operationId": "issueGetLabel",
  3860. "parameters": [
  3861. {
  3862. "type": "string",
  3863. "description": "owner of the repo",
  3864. "name": "owner",
  3865. "in": "path",
  3866. "required": true
  3867. },
  3868. {
  3869. "type": "string",
  3870. "description": "name of the repo",
  3871. "name": "repo",
  3872. "in": "path",
  3873. "required": true
  3874. },
  3875. {
  3876. "type": "integer",
  3877. "format": "int64",
  3878. "description": "id of the label to get",
  3879. "name": "id",
  3880. "in": "path",
  3881. "required": true
  3882. }
  3883. ],
  3884. "responses": {
  3885. "200": {
  3886. "$ref": "#/responses/Label"
  3887. }
  3888. }
  3889. },
  3890. "delete": {
  3891. "tags": [
  3892. "issue"
  3893. ],
  3894. "summary": "Delete a label",
  3895. "operationId": "issueDeleteLabel",
  3896. "parameters": [
  3897. {
  3898. "type": "string",
  3899. "description": "owner of the repo",
  3900. "name": "owner",
  3901. "in": "path",
  3902. "required": true
  3903. },
  3904. {
  3905. "type": "string",
  3906. "description": "name of the repo",
  3907. "name": "repo",
  3908. "in": "path",
  3909. "required": true
  3910. },
  3911. {
  3912. "type": "integer",
  3913. "format": "int64",
  3914. "description": "id of the label to delete",
  3915. "name": "id",
  3916. "in": "path",
  3917. "required": true
  3918. }
  3919. ],
  3920. "responses": {
  3921. "204": {
  3922. "$ref": "#/responses/empty"
  3923. }
  3924. }
  3925. },
  3926. "patch": {
  3927. "consumes": [
  3928. "application/json"
  3929. ],
  3930. "produces": [
  3931. "application/json"
  3932. ],
  3933. "tags": [
  3934. "issue"
  3935. ],
  3936. "summary": "Update a label",
  3937. "operationId": "issueEditLabel",
  3938. "parameters": [
  3939. {
  3940. "type": "string",
  3941. "description": "owner of the repo",
  3942. "name": "owner",
  3943. "in": "path",
  3944. "required": true
  3945. },
  3946. {
  3947. "type": "string",
  3948. "description": "name of the repo",
  3949. "name": "repo",
  3950. "in": "path",
  3951. "required": true
  3952. },
  3953. {
  3954. "type": "integer",
  3955. "format": "int64",
  3956. "description": "id of the label to edit",
  3957. "name": "id",
  3958. "in": "path",
  3959. "required": true
  3960. },
  3961. {
  3962. "name": "body",
  3963. "in": "body",
  3964. "schema": {
  3965. "$ref": "#/definitions/EditLabelOption"
  3966. }
  3967. }
  3968. ],
  3969. "responses": {
  3970. "200": {
  3971. "$ref": "#/responses/Label"
  3972. }
  3973. }
  3974. }
  3975. },
  3976. "/repos/{owner}/{repo}/milestones": {
  3977. "get": {
  3978. "produces": [
  3979. "application/json"
  3980. ],
  3981. "tags": [
  3982. "issue"
  3983. ],
  3984. "summary": "Get all of a repository's opened milestones",
  3985. "operationId": "issueGetMilestonesList",
  3986. "parameters": [
  3987. {
  3988. "type": "string",
  3989. "description": "owner of the repo",
  3990. "name": "owner",
  3991. "in": "path",
  3992. "required": true
  3993. },
  3994. {
  3995. "type": "string",
  3996. "description": "name of the repo",
  3997. "name": "repo",
  3998. "in": "path",
  3999. "required": true
  4000. },
  4001. {
  4002. "type": "string",
  4003. "description": "Milestone state, Recognised values are open, closed and all. Defaults to \"open\"",
  4004. "name": "state",
  4005. "in": "query"
  4006. }
  4007. ],
  4008. "responses": {
  4009. "200": {
  4010. "$ref": "#/responses/MilestoneList"
  4011. }
  4012. }
  4013. },
  4014. "post": {
  4015. "consumes": [
  4016. "application/json"
  4017. ],
  4018. "produces": [
  4019. "application/json"
  4020. ],
  4021. "tags": [
  4022. "issue"
  4023. ],
  4024. "summary": "Create a milestone",
  4025. "operationId": "issueCreateMilestone",
  4026. "parameters": [
  4027. {
  4028. "type": "string",
  4029. "description": "owner of the repo",
  4030. "name": "owner",
  4031. "in": "path",
  4032. "required": true
  4033. },
  4034. {
  4035. "type": "string",
  4036. "description": "name of the repo",
  4037. "name": "repo",
  4038. "in": "path",
  4039. "required": true
  4040. },
  4041. {
  4042. "name": "body",
  4043. "in": "body",
  4044. "schema": {
  4045. "$ref": "#/definitions/CreateMilestoneOption"
  4046. }
  4047. }
  4048. ],
  4049. "responses": {
  4050. "201": {
  4051. "$ref": "#/responses/Milestone"
  4052. }
  4053. }
  4054. }
  4055. },
  4056. "/repos/{owner}/{repo}/milestones/{id}": {
  4057. "get": {
  4058. "produces": [
  4059. "application/json"
  4060. ],
  4061. "tags": [
  4062. "issue"
  4063. ],
  4064. "summary": "Get a milestone",
  4065. "operationId": "issueGetMilestone",
  4066. "parameters": [
  4067. {
  4068. "type": "string",
  4069. "description": "owner of the repo",
  4070. "name": "owner",
  4071. "in": "path",
  4072. "required": true
  4073. },
  4074. {
  4075. "type": "string",
  4076. "description": "name of the repo",
  4077. "name": "repo",
  4078. "in": "path",
  4079. "required": true
  4080. },
  4081. {
  4082. "type": "integer",
  4083. "format": "int64",
  4084. "description": "id of the milestone",
  4085. "name": "id",
  4086. "in": "path",
  4087. "required": true
  4088. }
  4089. ],
  4090. "responses": {
  4091. "200": {
  4092. "$ref": "#/responses/Milestone"
  4093. }
  4094. }
  4095. },
  4096. "delete": {
  4097. "tags": [
  4098. "issue"
  4099. ],
  4100. "summary": "Delete a milestone",
  4101. "operationId": "issueDeleteMilestone",
  4102. "parameters": [
  4103. {
  4104. "type": "string",
  4105. "description": "owner of the repo",
  4106. "name": "owner",
  4107. "in": "path",
  4108. "required": true
  4109. },
  4110. {
  4111. "type": "string",
  4112. "description": "name of the repo",
  4113. "name": "repo",
  4114. "in": "path",
  4115. "required": true
  4116. },
  4117. {
  4118. "type": "integer",
  4119. "format": "int64",
  4120. "description": "id of the milestone to delete",
  4121. "name": "id",
  4122. "in": "path",
  4123. "required": true
  4124. }
  4125. ],
  4126. "responses": {
  4127. "204": {
  4128. "$ref": "#/responses/empty"
  4129. }
  4130. }
  4131. },
  4132. "patch": {
  4133. "consumes": [
  4134. "application/json"
  4135. ],
  4136. "produces": [
  4137. "application/json"
  4138. ],
  4139. "tags": [
  4140. "issue"
  4141. ],
  4142. "summary": "Update a milestone",
  4143. "operationId": "issueEditMilestone",
  4144. "parameters": [
  4145. {
  4146. "type": "string",
  4147. "description": "owner of the repo",
  4148. "name": "owner",
  4149. "in": "path",
  4150. "required": true
  4151. },
  4152. {
  4153. "type": "string",
  4154. "description": "name of the repo",
  4155. "name": "repo",
  4156. "in": "path",
  4157. "required": true
  4158. },
  4159. {
  4160. "type": "integer",
  4161. "format": "int64",
  4162. "description": "id of the milestone",
  4163. "name": "id",
  4164. "in": "path",
  4165. "required": true
  4166. },
  4167. {
  4168. "name": "body",
  4169. "in": "body",
  4170. "schema": {
  4171. "$ref": "#/definitions/EditMilestoneOption"
  4172. }
  4173. }
  4174. ],
  4175. "responses": {
  4176. "200": {
  4177. "$ref": "#/responses/Milestone"
  4178. }
  4179. }
  4180. }
  4181. },
  4182. "/repos/{owner}/{repo}/mirror-sync": {
  4183. "post": {
  4184. "produces": [
  4185. "application/json"
  4186. ],
  4187. "tags": [
  4188. "repository"
  4189. ],
  4190. "summary": "Sync a mirrored repository",
  4191. "operationId": "repoMirrorSync",
  4192. "parameters": [
  4193. {
  4194. "type": "string",
  4195. "description": "owner of the repo to sync",
  4196. "name": "owner",
  4197. "in": "path",
  4198. "required": true
  4199. },
  4200. {
  4201. "type": "string",
  4202. "description": "name of the repo to sync",
  4203. "name": "repo",
  4204. "in": "path",
  4205. "required": true
  4206. }
  4207. ],
  4208. "responses": {
  4209. "200": {
  4210. "$ref": "#/responses/empty"
  4211. }
  4212. }
  4213. }
  4214. },
  4215. "/repos/{owner}/{repo}/pulls": {
  4216. "get": {
  4217. "produces": [
  4218. "application/json"
  4219. ],
  4220. "tags": [
  4221. "repository"
  4222. ],
  4223. "summary": "List a repo's pull requests",
  4224. "operationId": "repoListPullRequests",
  4225. "parameters": [
  4226. {
  4227. "type": "string",
  4228. "description": "owner of the repo",
  4229. "name": "owner",
  4230. "in": "path",
  4231. "required": true
  4232. },
  4233. {
  4234. "type": "string",
  4235. "description": "name of the repo",
  4236. "name": "repo",
  4237. "in": "path",
  4238. "required": true
  4239. },
  4240. {
  4241. "type": "integer",
  4242. "description": "Page number",
  4243. "name": "page",
  4244. "in": "query"
  4245. },
  4246. {
  4247. "enum": [
  4248. "closed",
  4249. "open",
  4250. "all"
  4251. ],
  4252. "type": "string",
  4253. "description": "State of pull request: open or closed (optional)",
  4254. "name": "state",
  4255. "in": "query"
  4256. },
  4257. {
  4258. "enum": [
  4259. "oldest",
  4260. "recentupdate",
  4261. "leastupdate",
  4262. "mostcomment",
  4263. "leastcomment",
  4264. "priority"
  4265. ],
  4266. "type": "string",
  4267. "description": "Type of sort",
  4268. "name": "sort",
  4269. "in": "query"
  4270. },
  4271. {
  4272. "type": "integer",
  4273. "format": "int64",
  4274. "description": "ID of the milestone",
  4275. "name": "milestone",
  4276. "in": "query"
  4277. },
  4278. {
  4279. "type": "array",
  4280. "items": {
  4281. "type": "integer",
  4282. "format": "int64"
  4283. },
  4284. "collectionFormat": "multi",
  4285. "description": "Label IDs",
  4286. "name": "labels",
  4287. "in": "query"
  4288. }
  4289. ],
  4290. "responses": {
  4291. "200": {
  4292. "$ref": "#/responses/PullRequestList"
  4293. }
  4294. }
  4295. },
  4296. "post": {
  4297. "consumes": [
  4298. "application/json"
  4299. ],
  4300. "produces": [
  4301. "application/json"
  4302. ],
  4303. "tags": [
  4304. "repository"
  4305. ],
  4306. "summary": "Create a pull request",
  4307. "operationId": "repoCreatePullRequest",
  4308. "parameters": [
  4309. {
  4310. "type": "string",
  4311. "description": "owner of the repo",
  4312. "name": "owner",
  4313. "in": "path",
  4314. "required": true
  4315. },
  4316. {
  4317. "type": "string",
  4318. "description": "name of the repo",
  4319. "name": "repo",
  4320. "in": "path",
  4321. "required": true
  4322. },
  4323. {
  4324. "name": "body",
  4325. "in": "body",
  4326. "schema": {
  4327. "$ref": "#/definitions/CreatePullRequestOption"
  4328. }
  4329. }
  4330. ],
  4331. "responses": {
  4332. "201": {
  4333. "$ref": "#/responses/PullRequest"
  4334. }
  4335. }
  4336. }
  4337. },
  4338. "/repos/{owner}/{repo}/pulls/{index}": {
  4339. "get": {
  4340. "produces": [
  4341. "application/json"
  4342. ],
  4343. "tags": [
  4344. "repository"
  4345. ],
  4346. "summary": "Get a pull request",
  4347. "operationId": "repoGetPullRequest",
  4348. "parameters": [
  4349. {
  4350. "type": "string",
  4351. "description": "owner of the repo",
  4352. "name": "owner",
  4353. "in": "path",
  4354. "required": true
  4355. },
  4356. {
  4357. "type": "string",
  4358. "description": "name of the repo",
  4359. "name": "repo",
  4360. "in": "path",
  4361. "required": true
  4362. },
  4363. {
  4364. "type": "integer",
  4365. "format": "int64",
  4366. "description": "index of the pull request to get",
  4367. "name": "index",
  4368. "in": "path",
  4369. "required": true
  4370. }
  4371. ],
  4372. "responses": {
  4373. "200": {
  4374. "$ref": "#/responses/PullRequest"
  4375. }
  4376. }
  4377. },
  4378. "patch": {
  4379. "consumes": [
  4380. "application/json"
  4381. ],
  4382. "produces": [
  4383. "application/json"
  4384. ],
  4385. "tags": [
  4386. "repository"
  4387. ],
  4388. "summary": "Update a pull request",
  4389. "operationId": "repoEditPullRequest",
  4390. "parameters": [
  4391. {
  4392. "type": "string",
  4393. "description": "owner of the repo",
  4394. "name": "owner",
  4395. "in": "path",
  4396. "required": true
  4397. },
  4398. {
  4399. "type": "string",
  4400. "description": "name of the repo",
  4401. "name": "repo",
  4402. "in": "path",
  4403. "required": true
  4404. },
  4405. {
  4406. "type": "integer",
  4407. "format": "int64",
  4408. "description": "index of the pull request to edit",
  4409. "name": "index",
  4410. "in": "path",
  4411. "required": true
  4412. },
  4413. {
  4414. "name": "body",
  4415. "in": "body",
  4416. "schema": {
  4417. "$ref": "#/definitions/EditPullRequestOption"
  4418. }
  4419. }
  4420. ],
  4421. "responses": {
  4422. "201": {
  4423. "$ref": "#/responses/PullRequest"
  4424. }
  4425. }
  4426. }
  4427. },
  4428. "/repos/{owner}/{repo}/pulls/{index}/merge": {
  4429. "get": {
  4430. "produces": [
  4431. "application/json"
  4432. ],
  4433. "tags": [
  4434. "repository"
  4435. ],
  4436. "summary": "Check if a pull request has been merged",
  4437. "operationId": "repoPullRequestIsMerged",
  4438. "parameters": [
  4439. {
  4440. "type": "string",
  4441. "description": "owner of the repo",
  4442. "name": "owner",
  4443. "in": "path",
  4444. "required": true
  4445. },
  4446. {
  4447. "type": "string",
  4448. "description": "name of the repo",
  4449. "name": "repo",
  4450. "in": "path",
  4451. "required": true
  4452. },
  4453. {
  4454. "type": "integer",
  4455. "format": "int64",
  4456. "description": "index of the pull request",
  4457. "name": "index",
  4458. "in": "path",
  4459. "required": true
  4460. }
  4461. ],
  4462. "responses": {
  4463. "204": {
  4464. "description": "pull request has been merged"
  4465. },
  4466. "404": {
  4467. "description": "pull request has not been merged"
  4468. }
  4469. }
  4470. },
  4471. "post": {
  4472. "produces": [
  4473. "application/json"
  4474. ],
  4475. "tags": [
  4476. "repository"
  4477. ],
  4478. "summary": "Merge a pull request",
  4479. "operationId": "repoMergePullRequest",
  4480. "parameters": [
  4481. {
  4482. "type": "string",
  4483. "description": "owner of the repo",
  4484. "name": "owner",
  4485. "in": "path",
  4486. "required": true
  4487. },
  4488. {
  4489. "type": "string",
  4490. "description": "name of the repo",
  4491. "name": "repo",
  4492. "in": "path",
  4493. "required": true
  4494. },
  4495. {
  4496. "type": "integer",
  4497. "format": "int64",
  4498. "description": "index of the pull request to merge",
  4499. "name": "index",
  4500. "in": "path",
  4501. "required": true
  4502. },
  4503. {
  4504. "name": "body",
  4505. "in": "body",
  4506. "schema": {
  4507. "$ref": "#/definitions/MergePullRequestOption"
  4508. }
  4509. }
  4510. ],
  4511. "responses": {
  4512. "200": {
  4513. "$ref": "#/responses/empty"
  4514. },
  4515. "405": {
  4516. "$ref": "#/responses/empty"
  4517. }
  4518. }
  4519. }
  4520. },
  4521. "/repos/{owner}/{repo}/raw/{filepath}": {
  4522. "get": {
  4523. "produces": [
  4524. "application/json"
  4525. ],
  4526. "tags": [
  4527. "repository"
  4528. ],
  4529. "summary": "Get a file from a repository",
  4530. "operationId": "repoGetRawFile",
  4531. "parameters": [
  4532. {
  4533. "type": "string",
  4534. "description": "owner of the repo",
  4535. "name": "owner",
  4536. "in": "path",
  4537. "required": true
  4538. },
  4539. {
  4540. "type": "string",
  4541. "description": "name of the repo",
  4542. "name": "repo",
  4543. "in": "path",
  4544. "required": true
  4545. },
  4546. {
  4547. "type": "string",
  4548. "description": "filepath of the file to get",
  4549. "name": "filepath",
  4550. "in": "path",
  4551. "required": true
  4552. }
  4553. ],
  4554. "responses": {
  4555. "200": {
  4556. "description": "success"
  4557. }
  4558. }
  4559. }
  4560. },
  4561. "/repos/{owner}/{repo}/releases": {
  4562. "get": {
  4563. "produces": [
  4564. "application/json"
  4565. ],
  4566. "tags": [
  4567. "repository"
  4568. ],
  4569. "summary": "List a repo's releases",
  4570. "operationId": "repoListReleases",
  4571. "parameters": [
  4572. {
  4573. "type": "string",
  4574. "description": "owner of the repo",
  4575. "name": "owner",
  4576. "in": "path",
  4577. "required": true
  4578. },
  4579. {
  4580. "type": "string",
  4581. "description": "name of the repo",
  4582. "name": "repo",
  4583. "in": "path",
  4584. "required": true
  4585. },
  4586. {
  4587. "type": "integer",
  4588. "description": "page wants to load",
  4589. "name": "page",
  4590. "in": "query"
  4591. },
  4592. {
  4593. "type": "integer",
  4594. "description": "items count every page wants to load",
  4595. "name": "per_page",
  4596. "in": "query"
  4597. }
  4598. ],
  4599. "responses": {
  4600. "200": {
  4601. "$ref": "#/responses/ReleaseList"
  4602. }
  4603. }
  4604. },
  4605. "post": {
  4606. "consumes": [
  4607. "application/json"
  4608. ],
  4609. "produces": [
  4610. "application/json"
  4611. ],
  4612. "tags": [
  4613. "repository"
  4614. ],
  4615. "summary": "Create a release",
  4616. "operationId": "repoCreateRelease",
  4617. "parameters": [
  4618. {
  4619. "type": "string",
  4620. "description": "owner of the repo",
  4621. "name": "owner",
  4622. "in": "path",
  4623. "required": true
  4624. },
  4625. {
  4626. "type": "string",
  4627. "description": "name of the repo",
  4628. "name": "repo",
  4629. "in": "path",
  4630. "required": true
  4631. },
  4632. {
  4633. "name": "body",
  4634. "in": "body",
  4635. "schema": {
  4636. "$ref": "#/definitions/CreateReleaseOption"
  4637. }
  4638. }
  4639. ],
  4640. "responses": {
  4641. "201": {
  4642. "$ref": "#/responses/Release"
  4643. }
  4644. }
  4645. }
  4646. },
  4647. "/repos/{owner}/{repo}/releases/{id}": {
  4648. "get": {
  4649. "produces": [
  4650. "application/json"
  4651. ],
  4652. "tags": [
  4653. "repository"
  4654. ],
  4655. "summary": "Get a release",
  4656. "operationId": "repoGetRelease",
  4657. "parameters": [
  4658. {
  4659. "type": "string",
  4660. "description": "owner of the repo",
  4661. "name": "owner",
  4662. "in": "path",
  4663. "required": true
  4664. },
  4665. {
  4666. "type": "string",
  4667. "description": "name of the repo",
  4668. "name": "repo",
  4669. "in": "path",
  4670. "required": true
  4671. },
  4672. {
  4673. "type": "integer",
  4674. "format": "int64",
  4675. "description": "id of the release to get",
  4676. "name": "id",
  4677. "in": "path",
  4678. "required": true
  4679. }
  4680. ],
  4681. "responses": {
  4682. "200": {
  4683. "$ref": "#/responses/Release"
  4684. }
  4685. }
  4686. },
  4687. "delete": {
  4688. "tags": [
  4689. "repository"
  4690. ],
  4691. "summary": "Delete a release",
  4692. "operationId": "repoDeleteRelease",
  4693. "parameters": [
  4694. {
  4695. "type": "string",
  4696. "description": "owner of the repo",
  4697. "name": "owner",
  4698. "in": "path",
  4699. "required": true
  4700. },
  4701. {
  4702. "type": "string",
  4703. "description": "name of the repo",
  4704. "name": "repo",
  4705. "in": "path",
  4706. "required": true
  4707. },
  4708. {
  4709. "type": "integer",
  4710. "format": "int64",
  4711. "description": "id of the release to delete",
  4712. "name": "id",
  4713. "in": "path",
  4714. "required": true
  4715. }
  4716. ],
  4717. "responses": {
  4718. "204": {
  4719. "$ref": "#/responses/empty"
  4720. }
  4721. }
  4722. },
  4723. "patch": {
  4724. "consumes": [
  4725. "application/json"
  4726. ],
  4727. "produces": [
  4728. "application/json"
  4729. ],
  4730. "tags": [
  4731. "repository"
  4732. ],
  4733. "summary": "Update a release",
  4734. "operationId": "repoEditRelease",
  4735. "parameters": [
  4736. {
  4737. "type": "string",
  4738. "description": "owner of the repo",
  4739. "name": "owner",
  4740. "in": "path",
  4741. "required": true
  4742. },
  4743. {
  4744. "type": "string",
  4745. "description": "name of the repo",
  4746. "name": "repo",
  4747. "in": "path",
  4748. "required": true
  4749. },
  4750. {
  4751. "type": "integer",
  4752. "format": "int64",
  4753. "description": "id of the release to edit",
  4754. "name": "id",
  4755. "in": "path",
  4756. "required": true
  4757. },
  4758. {
  4759. "name": "body",
  4760. "in": "body",
  4761. "schema": {
  4762. "$ref": "#/definitions/EditReleaseOption"
  4763. }
  4764. }
  4765. ],
  4766. "responses": {
  4767. "200": {
  4768. "$ref": "#/responses/Release"
  4769. }
  4770. }
  4771. }
  4772. },
  4773. "/repos/{owner}/{repo}/releases/{id}/assets": {
  4774. "get": {
  4775. "produces": [
  4776. "application/json"
  4777. ],
  4778. "tags": [
  4779. "repository"
  4780. ],
  4781. "summary": "List release's attachments",
  4782. "operationId": "repoListReleaseAttachments",
  4783. "parameters": [
  4784. {
  4785. "type": "string",
  4786. "description": "owner of the repo",
  4787. "name": "owner",
  4788. "in": "path",
  4789. "required": true
  4790. },
  4791. {
  4792. "type": "string",
  4793. "description": "name of the repo",
  4794. "name": "repo",
  4795. "in": "path",
  4796. "required": true
  4797. },
  4798. {
  4799. "type": "integer",
  4800. "format": "int64",
  4801. "description": "id of the release",
  4802. "name": "id",
  4803. "in": "path",
  4804. "required": true
  4805. }
  4806. ],
  4807. "responses": {
  4808. "200": {
  4809. "$ref": "#/responses/AttachmentList"
  4810. }
  4811. }
  4812. },
  4813. "post": {
  4814. "consumes": [
  4815. "multipart/form-data"
  4816. ],
  4817. "produces": [
  4818. "application/json"
  4819. ],
  4820. "tags": [
  4821. "repository"
  4822. ],
  4823. "summary": "Create a release attachment",
  4824. "operationId": "repoCreateReleaseAttachment",
  4825. "parameters": [
  4826. {
  4827. "type": "string",
  4828. "description": "owner of the repo",
  4829. "name": "owner",
  4830. "in": "path",
  4831. "required": true
  4832. },
  4833. {
  4834. "type": "string",
  4835. "description": "name of the repo",
  4836. "name": "repo",
  4837. "in": "path",
  4838. "required": true
  4839. },
  4840. {
  4841. "type": "integer",
  4842. "format": "int64",
  4843. "description": "id of the release",
  4844. "name": "id",
  4845. "in": "path",
  4846. "required": true
  4847. },
  4848. {
  4849. "type": "string",
  4850. "description": "name of the attachment",
  4851. "name": "name",
  4852. "in": "query"
  4853. },
  4854. {
  4855. "type": "file",
  4856. "description": "attachment to upload",
  4857. "name": "attachment",
  4858. "in": "formData",
  4859. "required": true
  4860. }
  4861. ],
  4862. "responses": {
  4863. "201": {
  4864. "$ref": "#/responses/Attachment"
  4865. }
  4866. }
  4867. }
  4868. },
  4869. "/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}": {
  4870. "get": {
  4871. "produces": [
  4872. "application/json"
  4873. ],
  4874. "tags": [
  4875. "repository"
  4876. ],
  4877. "summary": "Get a release attachment",
  4878. "operationId": "repoGetReleaseAttachment",
  4879. "parameters": [
  4880. {
  4881. "type": "string",
  4882. "description": "owner of the repo",
  4883. "name": "owner",
  4884. "in": "path",
  4885. "required": true
  4886. },
  4887. {
  4888. "type": "string",
  4889. "description": "name of the repo",
  4890. "name": "repo",
  4891. "in": "path",
  4892. "required": true
  4893. },
  4894. {
  4895. "type": "integer",
  4896. "format": "int64",
  4897. "description": "id of the release",
  4898. "name": "id",
  4899. "in": "path",
  4900. "required": true
  4901. },
  4902. {
  4903. "type": "integer",
  4904. "format": "int64",
  4905. "description": "id of the attachment to get",
  4906. "name": "attachment_id",
  4907. "in": "path",
  4908. "required": true
  4909. }
  4910. ],
  4911. "responses": {
  4912. "200": {
  4913. "$ref": "#/responses/Attachment"
  4914. }
  4915. }
  4916. },
  4917. "delete": {
  4918. "produces": [
  4919. "application/json"
  4920. ],
  4921. "tags": [
  4922. "repository"
  4923. ],
  4924. "summary": "Delete a release attachment",
  4925. "operationId": "repoDeleteReleaseAttachment",
  4926. "parameters": [
  4927. {
  4928. "type": "string",
  4929. "description": "owner of the repo",
  4930. "name": "owner",
  4931. "in": "path",
  4932. "required": true
  4933. },
  4934. {
  4935. "type": "string",
  4936. "description": "name of the repo",
  4937. "name": "repo",
  4938. "in": "path",
  4939. "required": true
  4940. },
  4941. {
  4942. "type": "integer",
  4943. "format": "int64",
  4944. "description": "id of the release",
  4945. "name": "id",
  4946. "in": "path",
  4947. "required": true
  4948. },
  4949. {
  4950. "type": "integer",
  4951. "format": "int64",
  4952. "description": "id of the attachment to delete",
  4953. "name": "attachment_id",
  4954. "in": "path",
  4955. "required": true
  4956. }
  4957. ],
  4958. "responses": {
  4959. "204": {
  4960. "$ref": "#/responses/empty"
  4961. }
  4962. }
  4963. },
  4964. "patch": {
  4965. "consumes": [
  4966. "application/json"
  4967. ],
  4968. "produces": [
  4969. "application/json"
  4970. ],
  4971. "tags": [
  4972. "repository"
  4973. ],
  4974. "summary": "Edit a release attachment",
  4975. "operationId": "repoEditReleaseAttachment",
  4976. "parameters": [
  4977. {
  4978. "type": "string",
  4979. "description": "owner of the repo",
  4980. "name": "owner",
  4981. "in": "path",
  4982. "required": true
  4983. },
  4984. {
  4985. "type": "string",
  4986. "description": "name of the repo",
  4987. "name": "repo",
  4988. "in": "path",
  4989. "required": true
  4990. },
  4991. {
  4992. "type": "integer",
  4993. "format": "int64",
  4994. "description": "id of the release",
  4995. "name": "id",
  4996. "in": "path",
  4997. "required": true
  4998. },
  4999. {
  5000. "type": "integer",
  5001. "format": "int64",
  5002. "description": "id of the attachment to edit",
  5003. "name": "attachment_id",
  5004. "in": "path",
  5005. "required": true
  5006. },
  5007. {
  5008. "name": "body",
  5009. "in": "body",
  5010. "schema": {
  5011. "$ref": "#/definitions/EditAttachmentOptions"
  5012. }
  5013. }
  5014. ],
  5015. "responses": {
  5016. "201": {
  5017. "$ref": "#/responses/Attachment"
  5018. }
  5019. }
  5020. }
  5021. },
  5022. "/repos/{owner}/{repo}/stargazers": {
  5023. "get": {
  5024. "produces": [
  5025. "application/json"
  5026. ],
  5027. "tags": [
  5028. "repository"
  5029. ],
  5030. "summary": "List a repo's stargazers",
  5031. "operationId": "repoListStargazers",
  5032. "parameters": [
  5033. {
  5034. "type": "string",
  5035. "description": "owner of the repo",
  5036. "name": "owner",
  5037. "in": "path",
  5038. "required": true
  5039. },
  5040. {
  5041. "type": "string",
  5042. "description": "name of the repo",
  5043. "name": "repo",
  5044. "in": "path",
  5045. "required": true
  5046. }
  5047. ],
  5048. "responses": {
  5049. "200": {
  5050. "$ref": "#/responses/UserList"
  5051. }
  5052. }
  5053. }
  5054. },
  5055. "/repos/{owner}/{repo}/statuses/{sha}": {
  5056. "get": {
  5057. "produces": [
  5058. "application/json"
  5059. ],
  5060. "tags": [
  5061. "repository"
  5062. ],
  5063. "summary": "Get a commit's statuses",
  5064. "operationId": "repoListStatuses",
  5065. "parameters": [
  5066. {
  5067. "type": "string",
  5068. "description": "owner of the repo",
  5069. "name": "owner",
  5070. "in": "path",
  5071. "required": true
  5072. },
  5073. {
  5074. "type": "string",
  5075. "description": "name of the repo",
  5076. "name": "repo",
  5077. "in": "path",
  5078. "required": true
  5079. },
  5080. {
  5081. "type": "string",
  5082. "description": "sha of the commit",
  5083. "name": "sha",
  5084. "in": "path",
  5085. "required": true
  5086. },
  5087. {
  5088. "type": "integer",
  5089. "description": "page number of results",
  5090. "name": "page",
  5091. "in": "query"
  5092. },
  5093. {
  5094. "enum": [
  5095. "oldest",
  5096. "recentupdate",
  5097. "leastupdate",
  5098. "leastindex",
  5099. "highestindex"
  5100. ],
  5101. "type": "string",
  5102. "description": "type of sort",
  5103. "name": "sort",
  5104. "in": "query"
  5105. },
  5106. {
  5107. "enum": [
  5108. "pending",
  5109. "success",
  5110. "error",
  5111. "failure",
  5112. "warning"
  5113. ],
  5114. "type": "string",
  5115. "description": "type of state",
  5116. "name": "state",
  5117. "in": "query"
  5118. }
  5119. ],
  5120. "responses": {
  5121. "200": {
  5122. "$ref": "#/responses/StatusList"
  5123. }
  5124. }
  5125. },
  5126. "post": {
  5127. "produces": [
  5128. "application/json"
  5129. ],
  5130. "tags": [
  5131. "repository"
  5132. ],
  5133. "summary": "Create a commit status",
  5134. "operationId": "repoCreateStatus",
  5135. "parameters": [
  5136. {
  5137. "type": "string",
  5138. "description": "owner of the repo",
  5139. "name": "owner",
  5140. "in": "path",
  5141. "required": true
  5142. },
  5143. {
  5144. "type": "string",
  5145. "description": "name of the repo",
  5146. "name": "repo",
  5147. "in": "path",
  5148. "required": true
  5149. },
  5150. {
  5151. "type": "string",
  5152. "description": "sha of the commit",
  5153. "name": "sha",
  5154. "in": "path",
  5155. "required": true
  5156. },
  5157. {
  5158. "name": "body",
  5159. "in": "body",
  5160. "schema": {
  5161. "$ref": "#/definitions/CreateStatusOption"
  5162. }
  5163. }
  5164. ],
  5165. "responses": {
  5166. "200": {
  5167. "$ref": "#/responses/StatusList"
  5168. }
  5169. }
  5170. }
  5171. },
  5172. "/repos/{owner}/{repo}/subscribers": {
  5173. "get": {
  5174. "produces": [
  5175. "application/json"
  5176. ],
  5177. "tags": [
  5178. "repository"
  5179. ],
  5180. "summary": "List a repo's watchers",
  5181. "operationId": "repoListSubscribers",
  5182. "parameters": [
  5183. {
  5184. "type": "string",
  5185. "description": "owner of the repo",
  5186. "name": "owner",
  5187. "in": "path",
  5188. "required": true
  5189. },
  5190. {
  5191. "type": "string",
  5192. "description": "name of the repo",
  5193. "name": "repo",
  5194. "in": "path",
  5195. "required": true
  5196. }
  5197. ],
  5198. "responses": {
  5199. "200": {
  5200. "$ref": "#/responses/UserList"
  5201. }
  5202. }
  5203. }
  5204. },
  5205. "/repos/{owner}/{repo}/subscription": {
  5206. "get": {
  5207. "tags": [
  5208. "repository"
  5209. ],
  5210. "summary": "Check if the current user is watching a repo",
  5211. "operationId": "userCurrentCheckSubscription",
  5212. "parameters": [
  5213. {
  5214. "type": "string",
  5215. "description": "owner of the repo",
  5216. "name": "owner",
  5217. "in": "path",
  5218. "required": true
  5219. },
  5220. {
  5221. "type": "string",
  5222. "description": "name of the repo",
  5223. "name": "repo",
  5224. "in": "path",
  5225. "required": true
  5226. }
  5227. ],
  5228. "responses": {
  5229. "200": {
  5230. "$ref": "#/responses/WatchInfo"
  5231. }
  5232. }
  5233. },
  5234. "put": {
  5235. "tags": [
  5236. "repository"
  5237. ],
  5238. "summary": "Watch a repo",
  5239. "operationId": "userCurrentPutSubscription",
  5240. "parameters": [
  5241. {
  5242. "type": "string",
  5243. "description": "owner of the repo",
  5244. "name": "owner",
  5245. "in": "path",
  5246. "required": true
  5247. },
  5248. {
  5249. "type": "string",
  5250. "description": "name of the repo",
  5251. "name": "repo",
  5252. "in": "path",
  5253. "required": true
  5254. }
  5255. ],
  5256. "responses": {
  5257. "200": {
  5258. "$ref": "#/responses/WatchInfo"
  5259. }
  5260. }
  5261. },
  5262. "delete": {
  5263. "tags": [
  5264. "repository"
  5265. ],
  5266. "summary": "Unwatch a repo",
  5267. "operationId": "userCurrentDeleteSubscription",
  5268. "parameters": [
  5269. {
  5270. "type": "string",
  5271. "description": "owner of the repo",
  5272. "name": "owner",
  5273. "in": "path",
  5274. "required": true
  5275. },
  5276. {
  5277. "type": "string",
  5278. "description": "name of the repo",
  5279. "name": "repo",
  5280. "in": "path",
  5281. "required": true
  5282. }
  5283. ],
  5284. "responses": {
  5285. "204": {
  5286. "$ref": "#/responses/empty"
  5287. }
  5288. }
  5289. }
  5290. },
  5291. "/repos/{owner}/{repo}/tags": {
  5292. "get": {
  5293. "produces": [
  5294. "application/json"
  5295. ],
  5296. "tags": [
  5297. "repository"
  5298. ],
  5299. "summary": "List a repository's tags",
  5300. "operationId": "repoListTags",
  5301. "parameters": [
  5302. {
  5303. "type": "string",
  5304. "description": "owner of the repo",
  5305. "name": "owner",
  5306. "in": "path",
  5307. "required": true
  5308. },
  5309. {
  5310. "type": "string",
  5311. "description": "name of the repo",
  5312. "name": "repo",
  5313. "in": "path",
  5314. "required": true
  5315. }
  5316. ],
  5317. "responses": {
  5318. "200": {
  5319. "$ref": "#/responses/TagList"
  5320. }
  5321. }
  5322. }
  5323. },
  5324. "/repos/{owner}/{repo}/times": {
  5325. "get": {
  5326. "produces": [
  5327. "application/json"
  5328. ],
  5329. "tags": [
  5330. "repository"
  5331. ],
  5332. "summary": "List a repo's tracked times",
  5333. "operationId": "repoTrackedTimes",
  5334. "parameters": [
  5335. {
  5336. "type": "string",
  5337. "description": "owner of the repo",
  5338. "name": "owner",
  5339. "in": "path",
  5340. "required": true
  5341. },
  5342. {
  5343. "type": "string",
  5344. "description": "name of the repo",
  5345. "name": "repo",
  5346. "in": "path",
  5347. "required": true
  5348. }
  5349. ],
  5350. "responses": {
  5351. "200": {
  5352. "$ref": "#/responses/TrackedTimeList"
  5353. }
  5354. }
  5355. }
  5356. },
  5357. "/repos/{owner}/{repo}/times/{user}": {
  5358. "get": {
  5359. "produces": [
  5360. "application/json"
  5361. ],
  5362. "tags": [
  5363. "user"
  5364. ],
  5365. "summary": "List a user's tracked times in a repo",
  5366. "operationId": "userTrackedTimes",
  5367. "parameters": [
  5368. {
  5369. "type": "string",
  5370. "description": "owner of the repo",
  5371. "name": "owner",
  5372. "in": "path",
  5373. "required": true
  5374. },
  5375. {
  5376. "type": "string",
  5377. "description": "name of the repo",
  5378. "name": "repo",
  5379. "in": "path",
  5380. "required": true
  5381. },
  5382. {
  5383. "type": "string",
  5384. "description": "username of user",
  5385. "name": "user",
  5386. "in": "path",
  5387. "required": true
  5388. }
  5389. ],
  5390. "responses": {
  5391. "200": {
  5392. "$ref": "#/responses/TrackedTimeList"
  5393. }
  5394. }
  5395. }
  5396. },
  5397. "/repositories/{id}": {
  5398. "get": {
  5399. "produces": [
  5400. "application/json"
  5401. ],
  5402. "tags": [
  5403. "repository"
  5404. ],
  5405. "summary": "Get a repository by id",
  5406. "operationId": "repoGetByID",
  5407. "parameters": [
  5408. {
  5409. "type": "integer",
  5410. "format": "int64",
  5411. "description": "id of the repo to get",
  5412. "name": "id",
  5413. "in": "path",
  5414. "required": true
  5415. }
  5416. ],
  5417. "responses": {
  5418. "200": {
  5419. "$ref": "#/responses/Repository"
  5420. }
  5421. }
  5422. }
  5423. },
  5424. "/teams/{id}": {
  5425. "get": {
  5426. "produces": [
  5427. "application/json"
  5428. ],
  5429. "tags": [
  5430. "organization"
  5431. ],
  5432. "summary": "Get a team",
  5433. "operationId": "orgGetTeam",
  5434. "parameters": [
  5435. {
  5436. "type": "integer",
  5437. "format": "int64",
  5438. "description": "id of the team to get",
  5439. "name": "id",
  5440. "in": "path",
  5441. "required": true
  5442. }
  5443. ],
  5444. "responses": {
  5445. "200": {
  5446. "$ref": "#/responses/Team"
  5447. }
  5448. }
  5449. },
  5450. "delete": {
  5451. "tags": [
  5452. "organization"
  5453. ],
  5454. "summary": "Delete a team",
  5455. "operationId": "orgDeleteTeam",
  5456. "parameters": [
  5457. {
  5458. "type": "integer",
  5459. "format": "int64",
  5460. "description": "id of the team to delete",
  5461. "name": "id",
  5462. "in": "path",
  5463. "required": true
  5464. }
  5465. ],
  5466. "responses": {
  5467. "204": {
  5468. "description": "team deleted"
  5469. }
  5470. }
  5471. },
  5472. "patch": {
  5473. "consumes": [
  5474. "application/json"
  5475. ],
  5476. "produces": [
  5477. "application/json"
  5478. ],
  5479. "tags": [
  5480. "organization"
  5481. ],
  5482. "summary": "Edit a team",
  5483. "operationId": "orgEditTeam",
  5484. "parameters": [
  5485. {
  5486. "type": "integer",
  5487. "description": "id of the team to edit",
  5488. "name": "id",
  5489. "in": "path",
  5490. "required": true
  5491. },
  5492. {
  5493. "name": "body",
  5494. "in": "body",
  5495. "schema": {
  5496. "$ref": "#/definitions/EditTeamOption"
  5497. }
  5498. }
  5499. ],
  5500. "responses": {
  5501. "200": {
  5502. "$ref": "#/responses/Team"
  5503. }
  5504. }
  5505. }
  5506. },
  5507. "/teams/{id}/members": {
  5508. "get": {
  5509. "produces": [
  5510. "application/json"
  5511. ],
  5512. "tags": [
  5513. "organization"
  5514. ],
  5515. "summary": "List a team's members",
  5516. "operationId": "orgListTeamMembers",
  5517. "parameters": [
  5518. {
  5519. "type": "integer",
  5520. "format": "int64",
  5521. "description": "id of the team",
  5522. "name": "id",
  5523. "in": "path",
  5524. "required": true
  5525. }
  5526. ],
  5527. "responses": {
  5528. "200": {
  5529. "$ref": "#/responses/UserList"
  5530. }
  5531. }
  5532. }
  5533. },
  5534. "/teams/{id}/members/{username}": {
  5535. "get": {
  5536. "produces": [
  5537. "application/json"
  5538. ],
  5539. "tags": [
  5540. "organization"
  5541. ],
  5542. "summary": "List a particular member of team",
  5543. "operationId": "orgListTeamMember",
  5544. "parameters": [
  5545. {
  5546. "type": "integer",
  5547. "format": "int64",
  5548. "description": "id of the team",
  5549. "name": "id",
  5550. "in": "path",
  5551. "required": true
  5552. },
  5553. {
  5554. "type": "string",
  5555. "description": "username of the member to list",
  5556. "name": "username",
  5557. "in": "path",
  5558. "required": true
  5559. }
  5560. ],
  5561. "responses": {
  5562. "200": {
  5563. "$ref": "#/responses/User"
  5564. }
  5565. }
  5566. },
  5567. "put": {
  5568. "produces": [
  5569. "application/json"
  5570. ],
  5571. "tags": [
  5572. "organization"
  5573. ],
  5574. "summary": "Add a team member",
  5575. "operationId": "orgAddTeamMember",
  5576. "parameters": [
  5577. {
  5578. "type": "integer",
  5579. "format": "int64",
  5580. "description": "id of the team",
  5581. "name": "id",
  5582. "in": "path",
  5583. "required": true
  5584. },
  5585. {
  5586. "type": "string",
  5587. "description": "username of the user to add",
  5588. "name": "username",
  5589. "in": "path",
  5590. "required": true
  5591. }
  5592. ],
  5593. "responses": {
  5594. "204": {
  5595. "$ref": "#/responses/empty"
  5596. }
  5597. }
  5598. },
  5599. "delete": {
  5600. "produces": [
  5601. "application/json"
  5602. ],
  5603. "tags": [
  5604. "organization"
  5605. ],
  5606. "summary": "Remove a team member",
  5607. "operationId": "orgRemoveTeamMember",
  5608. "parameters": [
  5609. {
  5610. "type": "integer",
  5611. "format": "int64",
  5612. "description": "id of the team",
  5613. "name": "id",
  5614. "in": "path",
  5615. "required": true
  5616. },
  5617. {
  5618. "type": "string",
  5619. "description": "username of the user to remove",
  5620. "name": "username",
  5621. "in": "path",
  5622. "required": true
  5623. }
  5624. ],
  5625. "responses": {
  5626. "204": {
  5627. "$ref": "#/responses/empty"
  5628. }
  5629. }
  5630. }
  5631. },
  5632. "/teams/{id}/repos": {
  5633. "get": {
  5634. "produces": [
  5635. "application/json"
  5636. ],
  5637. "tags": [
  5638. "organization"
  5639. ],
  5640. "summary": "List a team's repos",
  5641. "operationId": "orgListTeamRepos",
  5642. "parameters": [
  5643. {
  5644. "type": "integer",
  5645. "format": "int64",
  5646. "description": "id of the team",
  5647. "name": "id",
  5648. "in": "path",
  5649. "required": true
  5650. }
  5651. ],
  5652. "responses": {
  5653. "200": {
  5654. "$ref": "#/responses/RepositoryList"
  5655. }
  5656. }
  5657. }
  5658. },
  5659. "/teams/{id}/repos/{org}/{repo}": {
  5660. "put": {
  5661. "produces": [
  5662. "application/json"
  5663. ],
  5664. "tags": [
  5665. "organization"
  5666. ],
  5667. "summary": "Add a repository to a team",
  5668. "operationId": "orgAddTeamRepository",
  5669. "parameters": [
  5670. {
  5671. "type": "integer",
  5672. "format": "int64",
  5673. "description": "id of the team",
  5674. "name": "id",
  5675. "in": "path",
  5676. "required": true
  5677. },
  5678. {
  5679. "type": "string",
  5680. "description": "organization that owns the repo to add",
  5681. "name": "org",
  5682. "in": "path",
  5683. "required": true
  5684. },
  5685. {
  5686. "type": "string",
  5687. "description": "name of the repo to add",
  5688. "name": "repo",
  5689. "in": "path",
  5690. "required": true
  5691. }
  5692. ],
  5693. "responses": {
  5694. "204": {
  5695. "$ref": "#/responses/empty"
  5696. }
  5697. }
  5698. },
  5699. "delete": {
  5700. "description": "This does not delete the repository, it only removes the repository from the team.",
  5701. "produces": [
  5702. "application/json"
  5703. ],
  5704. "tags": [
  5705. "organization"
  5706. ],
  5707. "summary": "Remove a repository from a team",
  5708. "operationId": "orgRemoveTeamRepository",
  5709. "parameters": [
  5710. {
  5711. "type": "integer",
  5712. "format": "int64",
  5713. "description": "id of the team",
  5714. "name": "id",
  5715. "in": "path",
  5716. "required": true
  5717. },
  5718. {
  5719. "type": "string",
  5720. "description": "organization that owns the repo to remove",
  5721. "name": "org",
  5722. "in": "path",
  5723. "required": true
  5724. },
  5725. {
  5726. "type": "string",
  5727. "description": "name of the repo to remove",
  5728. "name": "repo",
  5729. "in": "path",
  5730. "required": true
  5731. }
  5732. ],
  5733. "responses": {
  5734. "204": {
  5735. "$ref": "#/responses/empty"
  5736. }
  5737. }
  5738. }
  5739. },
  5740. "/topics/search": {
  5741. "get": {
  5742. "produces": [
  5743. "application/json"
  5744. ],
  5745. "tags": [
  5746. "repository"
  5747. ],
  5748. "summary": "search topics via keyword",
  5749. "operationId": "topicSearch",
  5750. "parameters": [
  5751. {
  5752. "type": "string",
  5753. "description": "keywords to search",
  5754. "name": "q",
  5755. "in": "query",
  5756. "required": true
  5757. }
  5758. ],
  5759. "responses": {
  5760. "200": {
  5761. "$ref": "#/responses/Repository"
  5762. }
  5763. }
  5764. }
  5765. },
  5766. "/user": {
  5767. "get": {
  5768. "produces": [
  5769. "application/json"
  5770. ],
  5771. "tags": [
  5772. "user"
  5773. ],
  5774. "summary": "Get the authenticated user",
  5775. "operationId": "userGetCurrent",
  5776. "responses": {
  5777. "200": {
  5778. "$ref": "#/responses/User"
  5779. }
  5780. }
  5781. }
  5782. },
  5783. "/user/emails": {
  5784. "get": {
  5785. "produces": [
  5786. "application/json"
  5787. ],
  5788. "tags": [
  5789. "user"
  5790. ],
  5791. "summary": "List the authenticated user's email addresses",
  5792. "operationId": "userListEmails",
  5793. "responses": {
  5794. "200": {
  5795. "$ref": "#/responses/EmailList"
  5796. }
  5797. }
  5798. },
  5799. "post": {
  5800. "produces": [
  5801. "application/json"
  5802. ],
  5803. "tags": [
  5804. "user"
  5805. ],
  5806. "summary": "Add email addresses",
  5807. "operationId": "userAddEmail",
  5808. "parameters": [
  5809. {
  5810. "name": "body",
  5811. "in": "body",
  5812. "schema": {
  5813. "$ref": "#/definitions/CreateEmailOption"
  5814. }
  5815. }
  5816. ],
  5817. "responses": {
  5818. "201": {
  5819. "$ref": "#/responses/EmailList"
  5820. }
  5821. }
  5822. },
  5823. "delete": {
  5824. "produces": [
  5825. "application/json"
  5826. ],
  5827. "tags": [
  5828. "user"
  5829. ],
  5830. "summary": "Delete email addresses",
  5831. "operationId": "userDeleteEmail",
  5832. "parameters": [
  5833. {
  5834. "name": "body",
  5835. "in": "body",
  5836. "schema": {
  5837. "$ref": "#/definitions/DeleteEmailOption"
  5838. }
  5839. }
  5840. ],
  5841. "responses": {
  5842. "204": {
  5843. "$ref": "#/responses/empty"
  5844. }
  5845. }
  5846. }
  5847. },
  5848. "/user/followers": {
  5849. "get": {
  5850. "produces": [
  5851. "application/json"
  5852. ],
  5853. "tags": [
  5854. "user"
  5855. ],
  5856. "summary": "List the authenticated user's followers",
  5857. "operationId": "userCurrentListFollowers",
  5858. "responses": {
  5859. "200": {
  5860. "$ref": "#/responses/UserList"
  5861. }
  5862. }
  5863. }
  5864. },
  5865. "/user/following": {
  5866. "get": {
  5867. "produces": [
  5868. "application/json"
  5869. ],
  5870. "tags": [
  5871. "user"
  5872. ],
  5873. "summary": "List the users that the authenticated user is following",
  5874. "operationId": "userCurrentListFollowing",
  5875. "responses": {
  5876. "200": {
  5877. "$ref": "#/responses/UserList"
  5878. }
  5879. }
  5880. }
  5881. },
  5882. "/user/following/{username}": {
  5883. "get": {
  5884. "tags": [
  5885. "user"
  5886. ],
  5887. "summary": "Check whether a user is followed by the authenticated user",
  5888. "operationId": "userCurrentCheckFollowing",
  5889. "parameters": [
  5890. {
  5891. "type": "string",
  5892. "description": "username of followed user",
  5893. "name": "username",
  5894. "in": "path",
  5895. "required": true
  5896. }
  5897. ],
  5898. "responses": {
  5899. "204": {
  5900. "$ref": "#/responses/empty"
  5901. },
  5902. "404": {
  5903. "$ref": "#/responses/notFound"
  5904. }
  5905. }
  5906. },
  5907. "put": {
  5908. "tags": [
  5909. "user"
  5910. ],
  5911. "summary": "Follow a user",
  5912. "operationId": "userCurrentPutFollow",
  5913. "parameters": [
  5914. {
  5915. "type": "string",
  5916. "description": "username of user to follow",
  5917. "name": "username",
  5918. "in": "path",
  5919. "required": true
  5920. }
  5921. ],
  5922. "responses": {
  5923. "204": {
  5924. "$ref": "#/responses/empty"
  5925. }
  5926. }
  5927. },
  5928. "delete": {
  5929. "tags": [
  5930. "user"
  5931. ],
  5932. "summary": "Unfollow a user",
  5933. "operationId": "userCurrentDeleteFollow",
  5934. "parameters": [
  5935. {
  5936. "type": "string",
  5937. "description": "username of user to unfollow",
  5938. "name": "username",
  5939. "in": "path",
  5940. "required": true
  5941. }
  5942. ],
  5943. "responses": {
  5944. "204": {
  5945. "$ref": "#/responses/empty"
  5946. }
  5947. }
  5948. }
  5949. },
  5950. "/user/gpg_keys": {
  5951. "get": {
  5952. "produces": [
  5953. "application/json"
  5954. ],
  5955. "tags": [
  5956. "user"
  5957. ],
  5958. "summary": "List the authenticated user's GPG keys",
  5959. "operationId": "userCurrentListGPGKeys",
  5960. "responses": {
  5961. "200": {
  5962. "$ref": "#/responses/GPGKeyList"
  5963. }
  5964. }
  5965. },
  5966. "post": {
  5967. "consumes": [
  5968. "application/json"
  5969. ],
  5970. "produces": [
  5971. "application/json"
  5972. ],
  5973. "tags": [
  5974. "user"
  5975. ],
  5976. "summary": "Create a GPG key",
  5977. "operationId": "userCurrentPostGPGKey",
  5978. "parameters": [
  5979. {
  5980. "name": "Form",
  5981. "in": "body",
  5982. "schema": {
  5983. "$ref": "#/definitions/CreateGPGKeyOption"
  5984. }
  5985. }
  5986. ],
  5987. "responses": {
  5988. "201": {
  5989. "$ref": "#/responses/GPGKey"
  5990. },
  5991. "422": {
  5992. "$ref": "#/responses/validationError"
  5993. }
  5994. }
  5995. }
  5996. },
  5997. "/user/gpg_keys/{id}": {
  5998. "get": {
  5999. "produces": [
  6000. "application/json"
  6001. ],
  6002. "tags": [
  6003. "user"
  6004. ],
  6005. "summary": "Get a GPG key",
  6006. "operationId": "userCurrentGetGPGKey",
  6007. "parameters": [
  6008. {
  6009. "type": "integer",
  6010. "format": "int64",
  6011. "description": "id of key to get",
  6012. "name": "id",
  6013. "in": "path",
  6014. "required": true
  6015. }
  6016. ],
  6017. "responses": {
  6018. "200": {
  6019. "$ref": "#/responses/GPGKey"
  6020. },
  6021. "404": {
  6022. "$ref": "#/responses/notFound"
  6023. }
  6024. }
  6025. },
  6026. "delete": {
  6027. "produces": [
  6028. "application/json"
  6029. ],
  6030. "tags": [
  6031. "user"
  6032. ],
  6033. "summary": "Remove a GPG key",
  6034. "operationId": "userCurrentDeleteGPGKey",
  6035. "parameters": [
  6036. {
  6037. "type": "integer",
  6038. "format": "int64",
  6039. "description": "id of key to delete",
  6040. "name": "id",
  6041. "in": "path",
  6042. "required": true
  6043. }
  6044. ],
  6045. "responses": {
  6046. "204": {
  6047. "$ref": "#/responses/empty"
  6048. },
  6049. "403": {
  6050. "$ref": "#/responses/forbidden"
  6051. }
  6052. }
  6053. }
  6054. },
  6055. "/user/keys": {
  6056. "get": {
  6057. "produces": [
  6058. "application/json"
  6059. ],
  6060. "tags": [
  6061. "user"
  6062. ],
  6063. "summary": "List the authenticated user's public keys",
  6064. "operationId": "userCurrentListKeys",
  6065. "parameters": [
  6066. {
  6067. "type": "string",
  6068. "description": "fingerprint of the key",
  6069. "name": "fingerprint",
  6070. "in": "query"
  6071. }
  6072. ],
  6073. "responses": {
  6074. "200": {
  6075. "$ref": "#/responses/PublicKeyList"
  6076. }
  6077. }
  6078. },
  6079. "post": {
  6080. "consumes": [
  6081. "application/json"
  6082. ],
  6083. "produces": [
  6084. "application/json"
  6085. ],
  6086. "tags": [
  6087. "user"
  6088. ],
  6089. "summary": "Create a public key",
  6090. "operationId": "userCurrentPostKey",
  6091. "parameters": [
  6092. {
  6093. "name": "body",
  6094. "in": "body",
  6095. "schema": {
  6096. "$ref": "#/definitions/CreateKeyOption"
  6097. }
  6098. }
  6099. ],
  6100. "responses": {
  6101. "201": {
  6102. "$ref": "#/responses/PublicKey"
  6103. },
  6104. "422": {
  6105. "$ref": "#/responses/validationError"
  6106. }
  6107. }
  6108. }
  6109. },
  6110. "/user/keys/{id}": {
  6111. "get": {
  6112. "produces": [
  6113. "application/json"
  6114. ],
  6115. "tags": [
  6116. "user"
  6117. ],
  6118. "summary": "Get a public key",
  6119. "operationId": "userCurrentGetKey",
  6120. "parameters": [
  6121. {
  6122. "type": "integer",
  6123. "format": "int64",
  6124. "description": "id of key to get",
  6125. "name": "id",
  6126. "in": "path",
  6127. "required": true
  6128. }
  6129. ],
  6130. "responses": {
  6131. "200": {
  6132. "$ref": "#/responses/PublicKey"
  6133. },
  6134. "404": {
  6135. "$ref": "#/responses/notFound"
  6136. }
  6137. }
  6138. },
  6139. "delete": {
  6140. "produces": [
  6141. "application/json"
  6142. ],
  6143. "tags": [
  6144. "user"
  6145. ],
  6146. "summary": "Delete a public key",
  6147. "operationId": "userCurrentDeleteKey",
  6148. "parameters": [
  6149. {
  6150. "type": "integer",
  6151. "format": "int64",
  6152. "description": "id of key to delete",
  6153. "name": "id",
  6154. "in": "path",
  6155. "required": true
  6156. }
  6157. ],
  6158. "responses": {
  6159. "204": {
  6160. "$ref": "#/responses/empty"
  6161. },
  6162. "403": {
  6163. "$ref": "#/responses/forbidden"
  6164. },
  6165. "404": {
  6166. "$ref": "#/responses/notFound"
  6167. }
  6168. }
  6169. }
  6170. },
  6171. "/user/orgs": {
  6172. "get": {
  6173. "produces": [
  6174. "application/json"
  6175. ],
  6176. "tags": [
  6177. "organization"
  6178. ],
  6179. "summary": "List the current user's organizations",
  6180. "operationId": "orgListCurrentUserOrgs",
  6181. "responses": {
  6182. "200": {
  6183. "$ref": "#/responses/OrganizationList"
  6184. }
  6185. }
  6186. }
  6187. },
  6188. "/user/repos": {
  6189. "get": {
  6190. "produces": [
  6191. "application/json"
  6192. ],
  6193. "tags": [
  6194. "user"
  6195. ],
  6196. "summary": "List the repos that the authenticated user owns or has access to",
  6197. "operationId": "userCurrentListRepos",
  6198. "responses": {
  6199. "200": {
  6200. "$ref": "#/responses/RepositoryList"
  6201. }
  6202. }
  6203. },
  6204. "post": {
  6205. "consumes": [
  6206. "application/json"
  6207. ],
  6208. "produces": [
  6209. "application/json"
  6210. ],
  6211. "tags": [
  6212. "repository",
  6213. "user"
  6214. ],
  6215. "summary": "Create a repository",
  6216. "operationId": "createCurrentUserRepo",
  6217. "parameters": [
  6218. {
  6219. "name": "body",
  6220. "in": "body",
  6221. "schema": {
  6222. "$ref": "#/definitions/CreateRepoOption"
  6223. }
  6224. }
  6225. ],
  6226. "responses": {
  6227. "201": {
  6228. "$ref": "#/responses/Repository"
  6229. },
  6230. "409": {
  6231. "description": "The repository with the same name already exists."
  6232. },
  6233. "422": {
  6234. "$ref": "#/responses/validationError"
  6235. }
  6236. }
  6237. }
  6238. },
  6239. "/user/starred": {
  6240. "get": {
  6241. "produces": [
  6242. "application/json"
  6243. ],
  6244. "tags": [
  6245. "user"
  6246. ],
  6247. "summary": "The repos that the authenticated user has starred",
  6248. "operationId": "userCurrentListStarred",
  6249. "responses": {
  6250. "200": {
  6251. "$ref": "#/responses/RepositoryList"
  6252. }
  6253. }
  6254. }
  6255. },
  6256. "/user/starred/{owner}/{repo}": {
  6257. "get": {
  6258. "tags": [
  6259. "user"
  6260. ],
  6261. "summary": "Whether the authenticated is starring the repo",
  6262. "operationId": "userCurrentCheckStarring",
  6263. "parameters": [
  6264. {
  6265. "type": "string",
  6266. "description": "owner of the repo",
  6267. "name": "owner",
  6268. "in": "path",
  6269. "required": true
  6270. },
  6271. {
  6272. "type": "string",
  6273. "description": "name of the repo",
  6274. "name": "repo",
  6275. "in": "path",
  6276. "required": true
  6277. }
  6278. ],
  6279. "responses": {
  6280. "204": {
  6281. "$ref": "#/responses/empty"
  6282. },
  6283. "404": {
  6284. "$ref": "#/responses/notFound"
  6285. }
  6286. }
  6287. },
  6288. "put": {
  6289. "tags": [
  6290. "user"
  6291. ],
  6292. "summary": "Star the given repo",
  6293. "operationId": "userCurrentPutStar",
  6294. "parameters": [
  6295. {
  6296. "type": "string",
  6297. "description": "owner of the repo to star",
  6298. "name": "owner",
  6299. "in": "path",
  6300. "required": true
  6301. },
  6302. {
  6303. "type": "string",
  6304. "description": "name of the repo to star",
  6305. "name": "repo",
  6306. "in": "path",
  6307. "required": true
  6308. }
  6309. ],
  6310. "responses": {
  6311. "204": {
  6312. "$ref": "#/responses/empty"
  6313. }
  6314. }
  6315. },
  6316. "delete": {
  6317. "tags": [
  6318. "user"
  6319. ],
  6320. "summary": "Unstar the given repo",
  6321. "operationId": "userCurrentDeleteStar",
  6322. "parameters": [
  6323. {
  6324. "type": "string",
  6325. "description": "owner of the repo to unstar",
  6326. "name": "owner",
  6327. "in": "path",
  6328. "required": true
  6329. },
  6330. {
  6331. "type": "string",
  6332. "description": "name of the repo to unstar",
  6333. "name": "repo",
  6334. "in": "path",
  6335. "required": true
  6336. }
  6337. ],
  6338. "responses": {
  6339. "204": {
  6340. "$ref": "#/responses/empty"
  6341. }
  6342. }
  6343. }
  6344. },
  6345. "/user/subscriptions": {
  6346. "get": {
  6347. "produces": [
  6348. "application/json"
  6349. ],
  6350. "tags": [
  6351. "user"
  6352. ],
  6353. "summary": "List repositories watched by the authenticated user",
  6354. "operationId": "userCurrentListSubscriptions",
  6355. "responses": {
  6356. "200": {
  6357. "$ref": "#/responses/RepositoryList"
  6358. }
  6359. }
  6360. }
  6361. },
  6362. "/user/teams": {
  6363. "get": {
  6364. "produces": [
  6365. "application/json"
  6366. ],
  6367. "tags": [
  6368. "user"
  6369. ],
  6370. "summary": "List all the teams a user belongs to",
  6371. "operationId": "userListTeams",
  6372. "responses": {
  6373. "200": {
  6374. "$ref": "#/responses/TeamList"
  6375. }
  6376. }
  6377. }
  6378. },
  6379. "/user/times": {
  6380. "get": {
  6381. "produces": [
  6382. "application/json"
  6383. ],
  6384. "tags": [
  6385. "user"
  6386. ],
  6387. "summary": "List the current user's tracked times",
  6388. "operationId": "userCurrentTrackedTimes",
  6389. "responses": {
  6390. "200": {
  6391. "$ref": "#/responses/TrackedTimeList"
  6392. }
  6393. }
  6394. }
  6395. },
  6396. "/users/search": {
  6397. "get": {
  6398. "produces": [
  6399. "application/json"
  6400. ],
  6401. "tags": [
  6402. "user"
  6403. ],
  6404. "summary": "Search for users",
  6405. "operationId": "userSearch",
  6406. "parameters": [
  6407. {
  6408. "type": "string",
  6409. "description": "keyword",
  6410. "name": "q",
  6411. "in": "query"
  6412. },
  6413. {
  6414. "type": "integer",
  6415. "format": "int64",
  6416. "description": "ID of the user to search for",
  6417. "name": "uid",
  6418. "in": "query"
  6419. },
  6420. {
  6421. "type": "integer",
  6422. "description": "maximum number of users to return",
  6423. "name": "limit",
  6424. "in": "query"
  6425. }
  6426. ],
  6427. "responses": {
  6428. "200": {
  6429. "description": "SearchResults of a successful search",
  6430. "schema": {
  6431. "type": "object",
  6432. "properties": {
  6433. "data": {
  6434. "type": "array",
  6435. "items": {
  6436. "$ref": "#/definitions/User"
  6437. }
  6438. },
  6439. "ok": {
  6440. "type": "boolean"
  6441. }
  6442. }
  6443. }
  6444. }
  6445. }
  6446. }
  6447. },
  6448. "/users/{follower}/following/{followee}": {
  6449. "get": {
  6450. "tags": [
  6451. "user"
  6452. ],
  6453. "summary": "Check if one user is following another user",
  6454. "operationId": "userCheckFollowing",
  6455. "parameters": [
  6456. {
  6457. "type": "string",
  6458. "description": "username of following user",
  6459. "name": "follower",
  6460. "in": "path",
  6461. "required": true
  6462. },
  6463. {
  6464. "type": "string",
  6465. "description": "username of followed user",
  6466. "name": "followee",
  6467. "in": "path",
  6468. "required": true
  6469. }
  6470. ],
  6471. "responses": {
  6472. "204": {
  6473. "$ref": "#/responses/empty"
  6474. },
  6475. "404": {
  6476. "$ref": "#/responses/notFound"
  6477. }
  6478. }
  6479. }
  6480. },
  6481. "/users/{username}": {
  6482. "get": {
  6483. "produces": [
  6484. "application/json"
  6485. ],
  6486. "tags": [
  6487. "user"
  6488. ],
  6489. "summary": "Get a user",
  6490. "operationId": "userGet",
  6491. "parameters": [
  6492. {
  6493. "type": "string",
  6494. "description": "username of user to get",
  6495. "name": "username",
  6496. "in": "path",
  6497. "required": true
  6498. }
  6499. ],
  6500. "responses": {
  6501. "200": {
  6502. "$ref": "#/responses/User"
  6503. },
  6504. "404": {
  6505. "$ref": "#/responses/notFound"
  6506. }
  6507. }
  6508. }
  6509. },
  6510. "/users/{username}/followers": {
  6511. "get": {
  6512. "produces": [
  6513. "application/json"
  6514. ],
  6515. "tags": [
  6516. "user"
  6517. ],
  6518. "summary": "List the given user's followers",
  6519. "operationId": "userListFollowers",
  6520. "parameters": [
  6521. {
  6522. "type": "string",
  6523. "description": "username of user",
  6524. "name": "username",
  6525. "in": "path",
  6526. "required": true
  6527. }
  6528. ],
  6529. "responses": {
  6530. "200": {
  6531. "$ref": "#/responses/UserList"
  6532. }
  6533. }
  6534. }
  6535. },
  6536. "/users/{username}/following": {
  6537. "get": {
  6538. "produces": [
  6539. "application/json"
  6540. ],
  6541. "tags": [
  6542. "user"
  6543. ],
  6544. "summary": "List the users that the given user is following",
  6545. "operationId": "userListFollowing",
  6546. "parameters": [
  6547. {
  6548. "type": "string",
  6549. "description": "username of user",
  6550. "name": "username",
  6551. "in": "path",
  6552. "required": true
  6553. }
  6554. ],
  6555. "responses": {
  6556. "200": {
  6557. "$ref": "#/responses/UserList"
  6558. }
  6559. }
  6560. }
  6561. },
  6562. "/users/{username}/gpg_keys": {
  6563. "get": {
  6564. "produces": [
  6565. "application/json"
  6566. ],
  6567. "tags": [
  6568. "user"
  6569. ],
  6570. "summary": "List the given user's GPG keys",
  6571. "operationId": "userListGPGKeys",
  6572. "parameters": [
  6573. {
  6574. "type": "string",
  6575. "description": "username of user",
  6576. "name": "username",
  6577. "in": "path",
  6578. "required": true
  6579. }
  6580. ],
  6581. "responses": {
  6582. "200": {
  6583. "$ref": "#/responses/GPGKeyList"
  6584. }
  6585. }
  6586. }
  6587. },
  6588. "/users/{username}/heatmap": {
  6589. "get": {
  6590. "produces": [
  6591. "application/json"
  6592. ],
  6593. "tags": [
  6594. "user"
  6595. ],
  6596. "summary": "Get a user's heatmap",
  6597. "operationId": "userGetHeatmapData",
  6598. "parameters": [
  6599. {
  6600. "type": "string",
  6601. "description": "username of user to get",
  6602. "name": "username",
  6603. "in": "path",
  6604. "required": true
  6605. }
  6606. ],
  6607. "responses": {
  6608. "200": {
  6609. "$ref": "#/responses/UserHeatmapData"
  6610. },
  6611. "404": {
  6612. "$ref": "#/responses/notFound"
  6613. }
  6614. }
  6615. }
  6616. },
  6617. "/users/{username}/keys": {
  6618. "get": {
  6619. "produces": [
  6620. "application/json"
  6621. ],
  6622. "tags": [
  6623. "user"
  6624. ],
  6625. "summary": "List the given user's public keys",
  6626. "operationId": "userListKeys",
  6627. "parameters": [
  6628. {
  6629. "type": "string",
  6630. "description": "username of user",
  6631. "name": "username",
  6632. "in": "path",
  6633. "required": true
  6634. },
  6635. {
  6636. "type": "string",
  6637. "description": "fingerprint of the key",
  6638. "name": "fingerprint",
  6639. "in": "query"
  6640. }
  6641. ],
  6642. "responses": {
  6643. "200": {
  6644. "$ref": "#/responses/PublicKeyList"
  6645. }
  6646. }
  6647. }
  6648. },
  6649. "/users/{username}/orgs": {
  6650. "get": {
  6651. "produces": [
  6652. "application/json"
  6653. ],
  6654. "tags": [
  6655. "organization"
  6656. ],
  6657. "summary": "List a user's organizations",
  6658. "operationId": "orgListUserOrgs",
  6659. "parameters": [
  6660. {
  6661. "type": "string",
  6662. "description": "username of user",
  6663. "name": "username",
  6664. "in": "path",
  6665. "required": true
  6666. }
  6667. ],
  6668. "responses": {
  6669. "200": {
  6670. "$ref": "#/responses/OrganizationList"
  6671. }
  6672. }
  6673. }
  6674. },
  6675. "/users/{username}/repos": {
  6676. "get": {
  6677. "produces": [
  6678. "application/json"
  6679. ],
  6680. "tags": [
  6681. "user"
  6682. ],
  6683. "summary": "List the repos owned by the given user",
  6684. "operationId": "userListRepos",
  6685. "parameters": [
  6686. {
  6687. "type": "string",
  6688. "description": "username of user",
  6689. "name": "username",
  6690. "in": "path",
  6691. "required": true
  6692. }
  6693. ],
  6694. "responses": {
  6695. "200": {
  6696. "$ref": "#/responses/RepositoryList"
  6697. }
  6698. }
  6699. }
  6700. },
  6701. "/users/{username}/starred": {
  6702. "get": {
  6703. "produces": [
  6704. "application/json"
  6705. ],
  6706. "tags": [
  6707. "user"
  6708. ],
  6709. "summary": "The repos that the given user has starred",
  6710. "operationId": "userListStarred",
  6711. "parameters": [
  6712. {
  6713. "type": "string",
  6714. "description": "username of user",
  6715. "name": "username",
  6716. "in": "path",
  6717. "required": true
  6718. }
  6719. ],
  6720. "responses": {
  6721. "200": {
  6722. "$ref": "#/responses/RepositoryList"
  6723. }
  6724. }
  6725. }
  6726. },
  6727. "/users/{username}/subscriptions": {
  6728. "get": {
  6729. "produces": [
  6730. "application/json"
  6731. ],
  6732. "tags": [
  6733. "user"
  6734. ],
  6735. "summary": "List the repositories watched by a user",
  6736. "operationId": "userListSubscriptions",
  6737. "parameters": [
  6738. {
  6739. "type": "string",
  6740. "description": "username of the user",
  6741. "name": "username",
  6742. "in": "path",
  6743. "required": true
  6744. }
  6745. ],
  6746. "responses": {
  6747. "200": {
  6748. "$ref": "#/responses/RepositoryList"
  6749. }
  6750. }
  6751. }
  6752. },
  6753. "/users/{username}/tokens": {
  6754. "get": {
  6755. "produces": [
  6756. "application/json"
  6757. ],
  6758. "tags": [
  6759. "user"
  6760. ],
  6761. "summary": "List the authenticated user's access tokens",
  6762. "operationId": "userGetTokens",
  6763. "parameters": [
  6764. {
  6765. "type": "string",
  6766. "description": "username of user",
  6767. "name": "username",
  6768. "in": "path",
  6769. "required": true
  6770. }
  6771. ],
  6772. "responses": {
  6773. "200": {
  6774. "$ref": "#/responses/AccessTokenList"
  6775. }
  6776. }
  6777. },
  6778. "post": {
  6779. "consumes": [
  6780. "application/json"
  6781. ],
  6782. "produces": [
  6783. "application/json"
  6784. ],
  6785. "tags": [
  6786. "user"
  6787. ],
  6788. "summary": "Create an access token",
  6789. "operationId": "userCreateToken",
  6790. "parameters": [
  6791. {
  6792. "type": "string",
  6793. "x-go-name": "Name",
  6794. "description": "username of user",
  6795. "name": "username",
  6796. "in": "path",
  6797. "required": true
  6798. },
  6799. {
  6800. "name": "accessToken",
  6801. "in": "body",
  6802. "schema": {
  6803. "type": "object",
  6804. "required": [
  6805. "name"
  6806. ],
  6807. "properties": {
  6808. "name": {
  6809. "type": "string"
  6810. }
  6811. }
  6812. }
  6813. }
  6814. ],
  6815. "responses": {
  6816. "200": {
  6817. "$ref": "#/responses/AccessToken"
  6818. }
  6819. }
  6820. }
  6821. },
  6822. "/users/{username}/tokens/{token}": {
  6823. "delete": {
  6824. "produces": [
  6825. "application/json"
  6826. ],
  6827. "tags": [
  6828. "user"
  6829. ],
  6830. "summary": "delete an access token",
  6831. "operationId": "userDeleteAccessToken",
  6832. "parameters": [
  6833. {
  6834. "type": "string",
  6835. "description": "username of user",
  6836. "name": "username",
  6837. "in": "path",
  6838. "required": true
  6839. },
  6840. {
  6841. "type": "integer",
  6842. "format": "int64",
  6843. "description": "token to be deleted",
  6844. "name": "token",
  6845. "in": "path",
  6846. "required": true
  6847. }
  6848. ],
  6849. "responses": {
  6850. "204": {
  6851. "$ref": "#/responses/empty"
  6852. }
  6853. }
  6854. }
  6855. },
  6856. "/version": {
  6857. "get": {
  6858. "produces": [
  6859. "application/json"
  6860. ],
  6861. "tags": [
  6862. "miscellaneous"
  6863. ],
  6864. "summary": "Returns the version of the Gitea application",
  6865. "operationId": "getVersion",
  6866. "responses": {
  6867. "200": {
  6868. "$ref": "#/responses/ServerVersion"
  6869. }
  6870. }
  6871. }
  6872. }
  6873. },
  6874. "definitions": {
  6875. "AddCollaboratorOption": {
  6876. "description": "AddCollaboratorOption options when adding a user as a collaborator of a repository",
  6877. "type": "object",
  6878. "properties": {
  6879. "permission": {
  6880. "type": "string",
  6881. "x-go-name": "Permission"
  6882. }
  6883. },
  6884. "x-go-package": "code.gitea.io/gitea/modules/structs"
  6885. },
  6886. "AddTimeOption": {
  6887. "description": "AddTimeOption options for adding time to an issue",
  6888. "type": "object",
  6889. "required": [
  6890. "time"
  6891. ],
  6892. "properties": {
  6893. "time": {
  6894. "description": "time in seconds",
  6895. "type": "integer",
  6896. "format": "int64",
  6897. "x-go-name": "Time"
  6898. }
  6899. },
  6900. "x-go-package": "code.gitea.io/gitea/modules/structs"
  6901. },
  6902. "AnnotatedTag": {
  6903. "description": "AnnotatedTag represents an annotated tag",
  6904. "type": "object",
  6905. "properties": {
  6906. "message": {
  6907. "type": "string",
  6908. "x-go-name": "Message"
  6909. },
  6910. "object": {
  6911. "$ref": "#/definitions/AnnotatedTagObject"
  6912. },
  6913. "sha": {
  6914. "type": "string",
  6915. "x-go-name": "SHA"
  6916. },
  6917. "tag": {
  6918. "type": "string",
  6919. "x-go-name": "Tag"
  6920. },
  6921. "tagger": {
  6922. "$ref": "#/definitions/CommitUser"
  6923. },
  6924. "url": {
  6925. "type": "string",
  6926. "x-go-name": "URL"
  6927. },
  6928. "verification": {
  6929. "$ref": "#/definitions/PayloadCommitVerification"
  6930. }
  6931. },
  6932. "x-go-package": "code.gitea.io/gitea/modules/structs"
  6933. },
  6934. "AnnotatedTagObject": {
  6935. "description": "AnnotatedTagObject contains meta information of the tag object",
  6936. "type": "object",
  6937. "properties": {
  6938. "sha": {
  6939. "type": "string",
  6940. "x-go-name": "SHA"
  6941. },
  6942. "type": {
  6943. "type": "string",
  6944. "x-go-name": "Type"
  6945. },
  6946. "url": {
  6947. "type": "string",
  6948. "x-go-name": "URL"
  6949. }
  6950. },
  6951. "x-go-package": "code.gitea.io/gitea/modules/structs"
  6952. },
  6953. "Attachment": {
  6954. "description": "Attachment a generic attachment",
  6955. "type": "object",
  6956. "properties": {
  6957. "browser_download_url": {
  6958. "type": "string",
  6959. "x-go-name": "DownloadURL"
  6960. },
  6961. "created_at": {
  6962. "type": "string",
  6963. "format": "date-time",
  6964. "x-go-name": "Created"
  6965. },
  6966. "download_count": {
  6967. "type": "integer",
  6968. "format": "int64",
  6969. "x-go-name": "DownloadCount"
  6970. },
  6971. "id": {
  6972. "type": "integer",
  6973. "format": "int64",
  6974. "x-go-name": "ID"
  6975. },
  6976. "name": {
  6977. "type": "string",
  6978. "x-go-name": "Name"
  6979. },
  6980. "size": {
  6981. "type": "integer",
  6982. "format": "int64",
  6983. "x-go-name": "Size"
  6984. },
  6985. "uuid": {
  6986. "type": "string",
  6987. "x-go-name": "UUID"
  6988. }
  6989. },
  6990. "x-go-package": "code.gitea.io/gitea/modules/structs"
  6991. },
  6992. "Branch": {
  6993. "description": "Branch represents a repository branch",
  6994. "type": "object",
  6995. "properties": {
  6996. "commit": {
  6997. "$ref": "#/definitions/PayloadCommit"
  6998. },
  6999. "name": {
  7000. "type": "string",
  7001. "x-go-name": "Name"
  7002. }
  7003. },
  7004. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7005. },
  7006. "Comment": {
  7007. "description": "Comment represents a comment on a commit or issue",
  7008. "type": "object",
  7009. "properties": {
  7010. "body": {
  7011. "type": "string",
  7012. "x-go-name": "Body"
  7013. },
  7014. "created_at": {
  7015. "type": "string",
  7016. "format": "date-time",
  7017. "x-go-name": "Created"
  7018. },
  7019. "html_url": {
  7020. "type": "string",
  7021. "x-go-name": "HTMLURL"
  7022. },
  7023. "id": {
  7024. "type": "integer",
  7025. "format": "int64",
  7026. "x-go-name": "ID"
  7027. },
  7028. "issue_url": {
  7029. "type": "string",
  7030. "x-go-name": "IssueURL"
  7031. },
  7032. "original_author": {
  7033. "type": "string",
  7034. "x-go-name": "OriginalAuthor"
  7035. },
  7036. "original_author_id": {
  7037. "type": "integer",
  7038. "format": "int64",
  7039. "x-go-name": "OriginalAuthorID"
  7040. },
  7041. "pull_request_url": {
  7042. "type": "string",
  7043. "x-go-name": "PRURL"
  7044. },
  7045. "updated_at": {
  7046. "type": "string",
  7047. "format": "date-time",
  7048. "x-go-name": "Updated"
  7049. },
  7050. "user": {
  7051. "$ref": "#/definitions/User"
  7052. }
  7053. },
  7054. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7055. },
  7056. "Commit": {
  7057. "type": "object",
  7058. "title": "Commit contains information generated from a Git commit.",
  7059. "properties": {
  7060. "author": {
  7061. "$ref": "#/definitions/User"
  7062. },
  7063. "commit": {
  7064. "$ref": "#/definitions/RepoCommit"
  7065. },
  7066. "committer": {
  7067. "$ref": "#/definitions/User"
  7068. },
  7069. "html_url": {
  7070. "type": "string",
  7071. "x-go-name": "HTMLURL"
  7072. },
  7073. "parents": {
  7074. "type": "array",
  7075. "items": {
  7076. "$ref": "#/definitions/CommitMeta"
  7077. },
  7078. "x-go-name": "Parents"
  7079. },
  7080. "sha": {
  7081. "type": "string",
  7082. "x-go-name": "SHA"
  7083. },
  7084. "url": {
  7085. "type": "string",
  7086. "x-go-name": "URL"
  7087. }
  7088. },
  7089. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7090. },
  7091. "CommitMeta": {
  7092. "type": "object",
  7093. "title": "CommitMeta contains meta information of a commit in terms of API.",
  7094. "properties": {
  7095. "sha": {
  7096. "type": "string",
  7097. "x-go-name": "SHA"
  7098. },
  7099. "url": {
  7100. "type": "string",
  7101. "x-go-name": "URL"
  7102. }
  7103. },
  7104. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7105. },
  7106. "CommitUser": {
  7107. "type": "object",
  7108. "title": "CommitUser contains information of a user in the context of a commit.",
  7109. "properties": {
  7110. "date": {
  7111. "type": "string",
  7112. "x-go-name": "Date"
  7113. },
  7114. "email": {
  7115. "type": "string",
  7116. "format": "email",
  7117. "x-go-name": "Email"
  7118. },
  7119. "name": {
  7120. "type": "string",
  7121. "x-go-name": "Name"
  7122. }
  7123. },
  7124. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7125. },
  7126. "ContentsResponse": {
  7127. "description": "ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content",
  7128. "type": "object",
  7129. "properties": {
  7130. "_links": {
  7131. "$ref": "#/definitions/FileLinksResponse"
  7132. },
  7133. "content": {
  7134. "description": "`content` is populated when `type` is `file`, otherwise null",
  7135. "type": "string",
  7136. "x-go-name": "Content"
  7137. },
  7138. "download_url": {
  7139. "type": "string",
  7140. "x-go-name": "DownloadURL"
  7141. },
  7142. "encoding": {
  7143. "description": "`encoding` is populated when `type` is `file`, otherwise null",
  7144. "type": "string",
  7145. "x-go-name": "Encoding"
  7146. },
  7147. "git_url": {
  7148. "type": "string",
  7149. "x-go-name": "GitURL"
  7150. },
  7151. "html_url": {
  7152. "type": "string",
  7153. "x-go-name": "HTMLURL"
  7154. },
  7155. "name": {
  7156. "type": "string",
  7157. "x-go-name": "Name"
  7158. },
  7159. "path": {
  7160. "type": "string",
  7161. "x-go-name": "Path"
  7162. },
  7163. "sha": {
  7164. "type": "string",
  7165. "x-go-name": "SHA"
  7166. },
  7167. "size": {
  7168. "type": "integer",
  7169. "format": "int64",
  7170. "x-go-name": "Size"
  7171. },
  7172. "submodule_git_url": {
  7173. "description": "`submodule_git_url` is populated when `type` is `submodule`, otherwise null",
  7174. "type": "string",
  7175. "x-go-name": "SubmoduleGitURL"
  7176. },
  7177. "target": {
  7178. "description": "`target` is populated when `type` is `symlink`, otherwise null",
  7179. "type": "string",
  7180. "x-go-name": "Target"
  7181. },
  7182. "type": {
  7183. "description": "`type` will be `file`, `dir`, `symlink`, or `submodule`",
  7184. "type": "string",
  7185. "x-go-name": "Type"
  7186. },
  7187. "url": {
  7188. "type": "string",
  7189. "x-go-name": "URL"
  7190. }
  7191. },
  7192. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7193. },
  7194. "CreateEmailOption": {
  7195. "description": "CreateEmailOption options when creating email addresses",
  7196. "type": "object",
  7197. "properties": {
  7198. "emails": {
  7199. "description": "email addresses to add",
  7200. "type": "array",
  7201. "items": {
  7202. "type": "string"
  7203. },
  7204. "x-go-name": "Emails"
  7205. }
  7206. },
  7207. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7208. },
  7209. "CreateFileOptions": {
  7210. "description": "CreateFileOptions options for creating files\nNote: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)",
  7211. "type": "object",
  7212. "required": [
  7213. "content"
  7214. ],
  7215. "properties": {
  7216. "author": {
  7217. "$ref": "#/definitions/Identity"
  7218. },
  7219. "branch": {
  7220. "description": "branch (optional) to base this file from. if not given, the default branch is used",
  7221. "type": "string",
  7222. "x-go-name": "BranchName"
  7223. },
  7224. "committer": {
  7225. "$ref": "#/definitions/Identity"
  7226. },
  7227. "content": {
  7228. "description": "content must be base64 encoded",
  7229. "type": "string",
  7230. "x-go-name": "Content"
  7231. },
  7232. "message": {
  7233. "description": "message (optional) for the commit of this file. if not supplied, a default message will be used",
  7234. "type": "string",
  7235. "x-go-name": "Message"
  7236. },
  7237. "new_branch": {
  7238. "description": "new_branch (optional) will make a new branch from `branch` before creating the file",
  7239. "type": "string",
  7240. "x-go-name": "NewBranchName"
  7241. }
  7242. },
  7243. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7244. },
  7245. "CreateForkOption": {
  7246. "description": "CreateForkOption options for creating a fork",
  7247. "type": "object",
  7248. "properties": {
  7249. "organization": {
  7250. "description": "organization name, if forking into an organization",
  7251. "type": "string",
  7252. "x-go-name": "Organization"
  7253. }
  7254. },
  7255. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7256. },
  7257. "CreateGPGKeyOption": {
  7258. "description": "CreateGPGKeyOption options create user GPG key",
  7259. "type": "object",
  7260. "required": [
  7261. "armored_public_key"
  7262. ],
  7263. "properties": {
  7264. "armored_public_key": {
  7265. "description": "An armored GPG key to add",
  7266. "type": "string",
  7267. "uniqueItems": true,
  7268. "x-go-name": "ArmoredKey"
  7269. }
  7270. },
  7271. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7272. },
  7273. "CreateHookOption": {
  7274. "description": "CreateHookOption options when create a hook",
  7275. "type": "object",
  7276. "required": [
  7277. "type",
  7278. "config"
  7279. ],
  7280. "properties": {
  7281. "active": {
  7282. "type": "boolean",
  7283. "default": false,
  7284. "x-go-name": "Active"
  7285. },
  7286. "config": {
  7287. "type": "object",
  7288. "additionalProperties": {
  7289. "type": "string"
  7290. },
  7291. "x-go-name": "Config"
  7292. },
  7293. "events": {
  7294. "type": "array",
  7295. "items": {
  7296. "type": "string"
  7297. },
  7298. "x-go-name": "Events"
  7299. },
  7300. "type": {
  7301. "type": "string",
  7302. "enum": [
  7303. "gitea",
  7304. "gogs",
  7305. "slack",
  7306. "discord"
  7307. ],
  7308. "x-go-name": "Type"
  7309. }
  7310. },
  7311. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7312. },
  7313. "CreateIssueCommentOption": {
  7314. "description": "CreateIssueCommentOption options for creating a comment on an issue",
  7315. "type": "object",
  7316. "required": [
  7317. "body"
  7318. ],
  7319. "properties": {
  7320. "body": {
  7321. "type": "string",
  7322. "x-go-name": "Body"
  7323. }
  7324. },
  7325. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7326. },
  7327. "CreateIssueOption": {
  7328. "description": "CreateIssueOption options to create one issue",
  7329. "type": "object",
  7330. "required": [
  7331. "title"
  7332. ],
  7333. "properties": {
  7334. "assignee": {
  7335. "description": "username of assignee",
  7336. "type": "string",
  7337. "x-go-name": "Assignee"
  7338. },
  7339. "assignees": {
  7340. "type": "array",
  7341. "items": {
  7342. "type": "string"
  7343. },
  7344. "x-go-name": "Assignees"
  7345. },
  7346. "body": {
  7347. "type": "string",
  7348. "x-go-name": "Body"
  7349. },
  7350. "closed": {
  7351. "type": "boolean",
  7352. "x-go-name": "Closed"
  7353. },
  7354. "due_date": {
  7355. "type": "string",
  7356. "format": "date-time",
  7357. "x-go-name": "Deadline"
  7358. },
  7359. "labels": {
  7360. "description": "list of label ids",
  7361. "type": "array",
  7362. "items": {
  7363. "type": "integer",
  7364. "format": "int64"
  7365. },
  7366. "x-go-name": "Labels"
  7367. },
  7368. "milestone": {
  7369. "description": "milestone id",
  7370. "type": "integer",
  7371. "format": "int64",
  7372. "x-go-name": "Milestone"
  7373. },
  7374. "title": {
  7375. "type": "string",
  7376. "x-go-name": "Title"
  7377. }
  7378. },
  7379. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7380. },
  7381. "CreateKeyOption": {
  7382. "description": "CreateKeyOption options when creating a key",
  7383. "type": "object",
  7384. "required": [
  7385. "title",
  7386. "key"
  7387. ],
  7388. "properties": {
  7389. "key": {
  7390. "description": "An armored SSH key to add",
  7391. "type": "string",
  7392. "uniqueItems": true,
  7393. "x-go-name": "Key"
  7394. },
  7395. "read_only": {
  7396. "description": "Describe if the key has only read access or read/write",
  7397. "type": "boolean",
  7398. "x-go-name": "ReadOnly"
  7399. },
  7400. "title": {
  7401. "description": "Title of the key to add",
  7402. "type": "string",
  7403. "uniqueItems": true,
  7404. "x-go-name": "Title"
  7405. }
  7406. },
  7407. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7408. },
  7409. "CreateLabelOption": {
  7410. "description": "CreateLabelOption options for creating a label",
  7411. "type": "object",
  7412. "required": [
  7413. "name",
  7414. "color"
  7415. ],
  7416. "properties": {
  7417. "color": {
  7418. "type": "string",
  7419. "x-go-name": "Color",
  7420. "example": "#00aabb"
  7421. },
  7422. "description": {
  7423. "type": "string",
  7424. "x-go-name": "Description"
  7425. },
  7426. "name": {
  7427. "type": "string",
  7428. "x-go-name": "Name"
  7429. }
  7430. },
  7431. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7432. },
  7433. "CreateMilestoneOption": {
  7434. "description": "CreateMilestoneOption options for creating a milestone",
  7435. "type": "object",
  7436. "properties": {
  7437. "description": {
  7438. "type": "string",
  7439. "x-go-name": "Description"
  7440. },
  7441. "due_on": {
  7442. "type": "string",
  7443. "format": "date-time",
  7444. "x-go-name": "Deadline"
  7445. },
  7446. "title": {
  7447. "type": "string",
  7448. "x-go-name": "Title"
  7449. }
  7450. },
  7451. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7452. },
  7453. "CreateOrgOption": {
  7454. "description": "CreateOrgOption options for creating an organization",
  7455. "type": "object",
  7456. "required": [
  7457. "username"
  7458. ],
  7459. "properties": {
  7460. "description": {
  7461. "type": "string",
  7462. "x-go-name": "Description"
  7463. },
  7464. "full_name": {
  7465. "type": "string",
  7466. "x-go-name": "FullName"
  7467. },
  7468. "location": {
  7469. "type": "string",
  7470. "x-go-name": "Location"
  7471. },
  7472. "username": {
  7473. "type": "string",
  7474. "x-go-name": "UserName"
  7475. },
  7476. "visibility": {
  7477. "description": "possible values are `public` (default), `limited` or `private`",
  7478. "type": "string",
  7479. "enum": [
  7480. "public",
  7481. "limited",
  7482. "private"
  7483. ],
  7484. "x-go-name": "Visibility"
  7485. },
  7486. "website": {
  7487. "type": "string",
  7488. "x-go-name": "Website"
  7489. }
  7490. },
  7491. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7492. },
  7493. "CreatePullRequestOption": {
  7494. "description": "CreatePullRequestOption options when creating a pull request",
  7495. "type": "object",
  7496. "properties": {
  7497. "assignee": {
  7498. "type": "string",
  7499. "x-go-name": "Assignee"
  7500. },
  7501. "assignees": {
  7502. "type": "array",
  7503. "items": {
  7504. "type": "string"
  7505. },
  7506. "x-go-name": "Assignees"
  7507. },
  7508. "base": {
  7509. "type": "string",
  7510. "x-go-name": "Base"
  7511. },
  7512. "body": {
  7513. "type": "string",
  7514. "x-go-name": "Body"
  7515. },
  7516. "due_date": {
  7517. "type": "string",
  7518. "format": "date-time",
  7519. "x-go-name": "Deadline"
  7520. },
  7521. "head": {
  7522. "type": "string",
  7523. "x-go-name": "Head"
  7524. },
  7525. "labels": {
  7526. "type": "array",
  7527. "items": {
  7528. "type": "integer",
  7529. "format": "int64"
  7530. },
  7531. "x-go-name": "Labels"
  7532. },
  7533. "milestone": {
  7534. "type": "integer",
  7535. "format": "int64",
  7536. "x-go-name": "Milestone"
  7537. },
  7538. "title": {
  7539. "type": "string",
  7540. "x-go-name": "Title"
  7541. }
  7542. },
  7543. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7544. },
  7545. "CreateReleaseOption": {
  7546. "description": "CreateReleaseOption options when creating a release",
  7547. "type": "object",
  7548. "required": [
  7549. "tag_name"
  7550. ],
  7551. "properties": {
  7552. "body": {
  7553. "type": "string",
  7554. "x-go-name": "Note"
  7555. },
  7556. "draft": {
  7557. "type": "boolean",
  7558. "x-go-name": "IsDraft"
  7559. },
  7560. "name": {
  7561. "type": "string",
  7562. "x-go-name": "Title"
  7563. },
  7564. "prerelease": {
  7565. "type": "boolean",
  7566. "x-go-name": "IsPrerelease"
  7567. },
  7568. "tag_name": {
  7569. "type": "string",
  7570. "x-go-name": "TagName"
  7571. },
  7572. "target_commitish": {
  7573. "type": "string",
  7574. "x-go-name": "Target"
  7575. }
  7576. },
  7577. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7578. },
  7579. "CreateRepoOption": {
  7580. "description": "CreateRepoOption options when creating repository",
  7581. "type": "object",
  7582. "required": [
  7583. "name"
  7584. ],
  7585. "properties": {
  7586. "auto_init": {
  7587. "description": "Whether the repository should be auto-intialized?",
  7588. "type": "boolean",
  7589. "x-go-name": "AutoInit"
  7590. },
  7591. "description": {
  7592. "description": "Description of the repository to create",
  7593. "type": "string",
  7594. "x-go-name": "Description"
  7595. },
  7596. "gitignores": {
  7597. "description": "Gitignores to use",
  7598. "type": "string",
  7599. "x-go-name": "Gitignores"
  7600. },
  7601. "license": {
  7602. "description": "License to use",
  7603. "type": "string",
  7604. "x-go-name": "License"
  7605. },
  7606. "name": {
  7607. "description": "Name of the repository to create",
  7608. "type": "string",
  7609. "uniqueItems": true,
  7610. "x-go-name": "Name"
  7611. },
  7612. "private": {
  7613. "description": "Whether the repository is private",
  7614. "type": "boolean",
  7615. "x-go-name": "Private"
  7616. },
  7617. "readme": {
  7618. "description": "Readme of the repository to create",
  7619. "type": "string",
  7620. "x-go-name": "Readme"
  7621. }
  7622. },
  7623. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7624. },
  7625. "CreateStatusOption": {
  7626. "description": "CreateStatusOption holds the information needed to create a new Status for a Commit",
  7627. "type": "object",
  7628. "properties": {
  7629. "context": {
  7630. "type": "string",
  7631. "x-go-name": "Context"
  7632. },
  7633. "description": {
  7634. "type": "string",
  7635. "x-go-name": "Description"
  7636. },
  7637. "state": {
  7638. "$ref": "#/definitions/StatusState"
  7639. },
  7640. "target_url": {
  7641. "type": "string",
  7642. "x-go-name": "TargetURL"
  7643. }
  7644. },
  7645. "x-go-package": "code.gitea.io/gitea/modules/structs"
  7646. },
  7647. "CreateTeamOption": {
  7648. "description": "CreateTeamOption options for creating a team",
  7649. "type": "object",
  7650. "required": [
  7651. "name"
  7652. ],
  7653. "properties": {
  7654. "description": {
  7655. "type": "string",
  7656. "x-go-name": "Description"
  7657. },
  7658. "name": {
  7659. "type": "string",
  7660. "x-go-name": "Name"
  7661. },
  7662. "permission": {
  7663. "type": "string",
  7664. "enum": [