1
0

openapi.json 154 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "Gogs API",
  5. "version": "v1",
  6. "description": "RESTful API for interacting with your Gogs instance. Follows a format similar to the GitHub REST API v3."
  7. },
  8. "servers": [
  9. {
  10. "url": "https://gogs.example.com/api/v1"
  11. }
  12. ],
  13. "security": [
  14. {
  15. "AccessToken": []
  16. }
  17. ],
  18. "tags": [
  19. {
  20. "name": "Repositories",
  21. "description": "Create, search, and manage repositories, branches, commits, and contents"
  22. },
  23. {
  24. "name": "Collaborators and Deploy Keys",
  25. "description": "Manage repository collaborators and deploy keys"
  26. },
  27. {
  28. "name": "Releases",
  29. "description": "List repository releases"
  30. },
  31. {
  32. "name": "Webhooks",
  33. "description": "Create, edit, and delete repository webhooks"
  34. },
  35. {
  36. "name": "Issues",
  37. "description": "Manage issues, comments, labels, and milestones"
  38. },
  39. {
  40. "name": "Users",
  41. "description": "Search users, manage access tokens, emails, followers, and public keys"
  42. },
  43. {
  44. "name": "Organizations",
  45. "description": "Manage organizations, members, and teams"
  46. },
  47. {
  48. "name": "Administration",
  49. "description": "Site administration endpoints (requires admin privileges)"
  50. },
  51. {
  52. "name": "Miscellaneous",
  53. "description": "Markdown rendering and Git data endpoints"
  54. }
  55. ],
  56. "paths": {
  57. "/repos/search": {
  58. "get": {
  59. "operationId": "searchRepos",
  60. "summary": "Search repositories",
  61. "tags": [
  62. "Repositories"
  63. ],
  64. "responses": {
  65. "200": {
  66. "description": "Success",
  67. "content": {
  68. "application/json": {
  69. "schema": {
  70. "type": "object",
  71. "properties": {
  72. "data": {
  73. "type": "array",
  74. "items": {
  75. "$ref": "#/components/schemas/Repository"
  76. }
  77. },
  78. "ok": {
  79. "type": "boolean"
  80. }
  81. }
  82. }
  83. }
  84. }
  85. }
  86. },
  87. "parameters": [
  88. {
  89. "name": "q",
  90. "in": "query",
  91. "required": true,
  92. "schema": {
  93. "type": "string"
  94. },
  95. "description": "Search keyword"
  96. },
  97. {
  98. "name": "uid",
  99. "in": "query",
  100. "required": false,
  101. "schema": {
  102. "type": "integer"
  103. },
  104. "description": "User ID to filter by"
  105. },
  106. {
  107. "name": "limit",
  108. "in": "query",
  109. "required": false,
  110. "schema": {
  111. "type": "integer",
  112. "default": 10
  113. },
  114. "description": "Max results"
  115. },
  116. {
  117. "name": "page",
  118. "in": "query",
  119. "required": false,
  120. "schema": {
  121. "type": "integer",
  122. "default": 1
  123. },
  124. "description": "Page number"
  125. }
  126. ]
  127. }
  128. },
  129. "/user/repos": {
  130. "get": {
  131. "operationId": "listYourRepos",
  132. "summary": "List your repositories",
  133. "tags": [
  134. "Repositories"
  135. ],
  136. "responses": {
  137. "200": {
  138. "description": "Success",
  139. "content": {
  140. "application/json": {
  141. "schema": {
  142. "type": "array",
  143. "items": {
  144. "$ref": "#/components/schemas/Repository"
  145. }
  146. }
  147. }
  148. }
  149. }
  150. }
  151. },
  152. "post": {
  153. "operationId": "createRepo",
  154. "summary": "Create a repository",
  155. "tags": [
  156. "Repositories"
  157. ],
  158. "responses": {
  159. "201": {
  160. "description": "Created",
  161. "content": {
  162. "application/json": {
  163. "schema": {
  164. "$ref": "#/components/schemas/Repository"
  165. }
  166. }
  167. }
  168. },
  169. "422": {
  170. "description": "Validation error."
  171. }
  172. },
  173. "requestBody": {
  174. "required": true,
  175. "content": {
  176. "application/json": {
  177. "schema": {
  178. "type": "object",
  179. "properties": {
  180. "name": {
  181. "type": "string"
  182. },
  183. "description": {
  184. "type": "string"
  185. },
  186. "private": {
  187. "type": "boolean",
  188. "default": false
  189. },
  190. "auto_init": {
  191. "type": "boolean",
  192. "default": false
  193. },
  194. "gitignores": {
  195. "type": "string"
  196. },
  197. "license": {
  198. "type": "string"
  199. },
  200. "readme": {
  201. "type": "string",
  202. "default": "Default"
  203. }
  204. },
  205. "required": [
  206. "name"
  207. ]
  208. }
  209. }
  210. }
  211. }
  212. }
  213. },
  214. "/users/{username}/repos": {
  215. "get": {
  216. "operationId": "listUserRepos",
  217. "summary": "List user repositories",
  218. "tags": [
  219. "Repositories"
  220. ],
  221. "responses": {
  222. "200": {
  223. "description": "Success",
  224. "content": {
  225. "application/json": {
  226. "schema": {
  227. "type": "array",
  228. "items": {
  229. "$ref": "#/components/schemas/Repository"
  230. }
  231. }
  232. }
  233. }
  234. },
  235. "404": {
  236. "description": "Resource not found."
  237. }
  238. },
  239. "parameters": [
  240. {
  241. "name": "username",
  242. "in": "path",
  243. "required": true,
  244. "schema": {
  245. "type": "string"
  246. },
  247. "description": "Username"
  248. }
  249. ]
  250. }
  251. },
  252. "/orgs/{orgname}/repos": {
  253. "get": {
  254. "operationId": "listOrgRepos",
  255. "summary": "List organization repositories",
  256. "tags": [
  257. "Repositories"
  258. ],
  259. "responses": {
  260. "200": {
  261. "description": "Success",
  262. "content": {
  263. "application/json": {
  264. "schema": {
  265. "type": "array",
  266. "items": {
  267. "$ref": "#/components/schemas/Repository"
  268. }
  269. }
  270. }
  271. }
  272. },
  273. "404": {
  274. "description": "Resource not found."
  275. }
  276. },
  277. "parameters": [
  278. {
  279. "name": "orgname",
  280. "in": "path",
  281. "required": true,
  282. "schema": {
  283. "type": "string"
  284. },
  285. "description": "Organization name"
  286. }
  287. ]
  288. }
  289. },
  290. "/org/{org}/repos": {
  291. "post": {
  292. "operationId": "createOrgRepo",
  293. "summary": "Create a repository in an organization",
  294. "tags": [
  295. "Repositories"
  296. ],
  297. "responses": {
  298. "201": {
  299. "description": "Created",
  300. "content": {
  301. "application/json": {
  302. "schema": {
  303. "$ref": "#/components/schemas/Repository"
  304. }
  305. }
  306. }
  307. },
  308. "404": {
  309. "description": "Resource not found."
  310. },
  311. "422": {
  312. "description": "Validation error."
  313. }
  314. },
  315. "parameters": [
  316. {
  317. "name": "org",
  318. "in": "path",
  319. "required": true,
  320. "schema": {
  321. "type": "string"
  322. },
  323. "description": "Organization name"
  324. }
  325. ],
  326. "requestBody": {
  327. "required": true,
  328. "content": {
  329. "application/json": {
  330. "schema": {
  331. "type": "object",
  332. "properties": {
  333. "name": {
  334. "type": "string"
  335. },
  336. "description": {
  337. "type": "string"
  338. },
  339. "private": {
  340. "type": "boolean",
  341. "default": false
  342. },
  343. "auto_init": {
  344. "type": "boolean",
  345. "default": false
  346. },
  347. "gitignores": {
  348. "type": "string"
  349. },
  350. "license": {
  351. "type": "string"
  352. },
  353. "readme": {
  354. "type": "string",
  355. "default": "Default"
  356. }
  357. },
  358. "required": [
  359. "name"
  360. ]
  361. }
  362. }
  363. }
  364. },
  365. "description": "The authenticated user must be an owner of the specified organization."
  366. }
  367. },
  368. "/repos/migrate": {
  369. "post": {
  370. "operationId": "migrateRepo",
  371. "summary": "Migrate a repository",
  372. "tags": [
  373. "Repositories"
  374. ],
  375. "responses": {
  376. "201": {
  377. "description": "Created",
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "$ref": "#/components/schemas/Repository"
  382. }
  383. }
  384. }
  385. },
  386. "422": {
  387. "description": "Validation error."
  388. }
  389. },
  390. "requestBody": {
  391. "required": true,
  392. "content": {
  393. "application/json": {
  394. "schema": {
  395. "type": "object",
  396. "properties": {
  397. "clone_addr": {
  398. "type": "string"
  399. },
  400. "auth_username": {
  401. "type": "string"
  402. },
  403. "auth_password": {
  404. "type": "string"
  405. },
  406. "uid": {
  407. "type": "integer"
  408. },
  409. "repo_name": {
  410. "type": "string"
  411. },
  412. "mirror": {
  413. "type": "boolean",
  414. "default": false
  415. },
  416. "private": {
  417. "type": "boolean",
  418. "default": false
  419. },
  420. "description": {
  421. "type": "string"
  422. }
  423. },
  424. "required": [
  425. "clone_addr",
  426. "uid",
  427. "repo_name"
  428. ]
  429. }
  430. }
  431. }
  432. }
  433. }
  434. },
  435. "/repos/{owner}/{repo}": {
  436. "get": {
  437. "operationId": "getRepo",
  438. "summary": "Get a repository",
  439. "tags": [
  440. "Repositories"
  441. ],
  442. "responses": {
  443. "200": {
  444. "description": "Success",
  445. "content": {
  446. "application/json": {
  447. "schema": {
  448. "$ref": "#/components/schemas/Repository"
  449. }
  450. }
  451. }
  452. },
  453. "404": {
  454. "description": "Resource not found."
  455. }
  456. },
  457. "parameters": [
  458. {
  459. "name": "owner",
  460. "in": "path",
  461. "required": true,
  462. "schema": {
  463. "type": "string"
  464. },
  465. "description": "Repository owner"
  466. },
  467. {
  468. "name": "repo",
  469. "in": "path",
  470. "required": true,
  471. "schema": {
  472. "type": "string"
  473. },
  474. "description": "Repository name"
  475. }
  476. ]
  477. },
  478. "delete": {
  479. "operationId": "deleteRepo",
  480. "summary": "Delete a repository",
  481. "tags": [
  482. "Repositories"
  483. ],
  484. "responses": {
  485. "204": {
  486. "description": "The resource has been successfully deleted."
  487. },
  488. "404": {
  489. "description": "Resource not found."
  490. }
  491. },
  492. "parameters": [
  493. {
  494. "name": "owner",
  495. "in": "path",
  496. "required": true,
  497. "schema": {
  498. "type": "string"
  499. },
  500. "description": "Repository owner"
  501. },
  502. {
  503. "name": "repo",
  504. "in": "path",
  505. "required": true,
  506. "schema": {
  507. "type": "string"
  508. },
  509. "description": "Repository name"
  510. }
  511. ],
  512. "description": "Requires owner access to the repository."
  513. }
  514. },
  515. "/repos/{owner}/{repo}/issue-tracker": {
  516. "patch": {
  517. "operationId": "editIssueTracker",
  518. "summary": "Edit issue tracker settings",
  519. "tags": [
  520. "Repositories"
  521. ],
  522. "responses": {
  523. "204": {
  524. "description": "Settings updated successfully."
  525. },
  526. "404": {
  527. "description": "Resource not found."
  528. },
  529. "422": {
  530. "description": "Validation error."
  531. }
  532. },
  533. "parameters": [
  534. {
  535. "name": "owner",
  536. "in": "path",
  537. "required": true,
  538. "schema": {
  539. "type": "string"
  540. },
  541. "description": "Repository owner"
  542. },
  543. {
  544. "name": "repo",
  545. "in": "path",
  546. "required": true,
  547. "schema": {
  548. "type": "string"
  549. },
  550. "description": "Repository name"
  551. }
  552. ],
  553. "requestBody": {
  554. "required": true,
  555. "content": {
  556. "application/json": {
  557. "schema": {
  558. "type": "object",
  559. "properties": {
  560. "enable_issues": {
  561. "type": "boolean"
  562. },
  563. "enable_external_tracker": {
  564. "type": "boolean"
  565. },
  566. "external_tracker_url": {
  567. "type": "string"
  568. },
  569. "tracker_url_format": {
  570. "type": "string"
  571. },
  572. "tracker_issue_style": {
  573. "type": "string",
  574. "enum": [
  575. "numeric",
  576. "alphanumeric"
  577. ]
  578. }
  579. }
  580. }
  581. }
  582. }
  583. }
  584. }
  585. },
  586. "/repos/{owner}/{repo}/mirror-sync": {
  587. "post": {
  588. "operationId": "mirrorSync",
  589. "summary": "Mirror sync",
  590. "tags": [
  591. "Repositories"
  592. ],
  593. "responses": {
  594. "202": {
  595. "description": "Mirror sync has been queued."
  596. },
  597. "404": {
  598. "description": "Resource not found."
  599. },
  600. "422": {
  601. "description": "Validation error."
  602. }
  603. },
  604. "parameters": [
  605. {
  606. "name": "owner",
  607. "in": "path",
  608. "required": true,
  609. "schema": {
  610. "type": "string"
  611. },
  612. "description": "Repository owner"
  613. },
  614. {
  615. "name": "repo",
  616. "in": "path",
  617. "required": true,
  618. "schema": {
  619. "type": "string"
  620. },
  621. "description": "Repository name"
  622. }
  623. ],
  624. "description": "Add a mirror repository to the sync queue. Returns 404 if the repository is not a mirror."
  625. }
  626. },
  627. "/repos/{owner}/{repo}/branches": {
  628. "get": {
  629. "operationId": "listBranches",
  630. "summary": "List branches",
  631. "tags": [
  632. "Repositories"
  633. ],
  634. "responses": {
  635. "200": {
  636. "description": "Success",
  637. "content": {
  638. "application/json": {
  639. "schema": {
  640. "type": "array",
  641. "items": {
  642. "$ref": "#/components/schemas/Branch"
  643. }
  644. }
  645. }
  646. }
  647. },
  648. "404": {
  649. "description": "Resource not found."
  650. }
  651. },
  652. "parameters": [
  653. {
  654. "name": "owner",
  655. "in": "path",
  656. "required": true,
  657. "schema": {
  658. "type": "string"
  659. },
  660. "description": "Repository owner"
  661. },
  662. {
  663. "name": "repo",
  664. "in": "path",
  665. "required": true,
  666. "schema": {
  667. "type": "string"
  668. },
  669. "description": "Repository name"
  670. }
  671. ]
  672. }
  673. },
  674. "/repos/{owner}/{repo}/branches/{branch}": {
  675. "get": {
  676. "operationId": "getBranch",
  677. "summary": "Get a branch",
  678. "tags": [
  679. "Repositories"
  680. ],
  681. "responses": {
  682. "200": {
  683. "description": "Success",
  684. "content": {
  685. "application/json": {
  686. "schema": {
  687. "$ref": "#/components/schemas/Branch"
  688. }
  689. }
  690. }
  691. },
  692. "404": {
  693. "description": "Resource not found."
  694. }
  695. },
  696. "parameters": [
  697. {
  698. "name": "owner",
  699. "in": "path",
  700. "required": true,
  701. "schema": {
  702. "type": "string"
  703. },
  704. "description": "Repository owner"
  705. },
  706. {
  707. "name": "repo",
  708. "in": "path",
  709. "required": true,
  710. "schema": {
  711. "type": "string"
  712. },
  713. "description": "Repository name"
  714. },
  715. {
  716. "name": "branch",
  717. "in": "path",
  718. "required": true,
  719. "schema": {
  720. "type": "string"
  721. },
  722. "description": "Branch name"
  723. }
  724. ]
  725. }
  726. },
  727. "/repos/{owner}/{repo}/commits/{sha}": {
  728. "get": {
  729. "operationId": "getCommit",
  730. "summary": "Get a single commit",
  731. "tags": [
  732. "Repositories"
  733. ],
  734. "responses": {
  735. "200": {
  736. "description": "Success",
  737. "content": {
  738. "application/json": {
  739. "schema": {
  740. "$ref": "#/components/schemas/Commit"
  741. }
  742. }
  743. }
  744. },
  745. "404": {
  746. "description": "Resource not found."
  747. }
  748. },
  749. "parameters": [
  750. {
  751. "name": "owner",
  752. "in": "path",
  753. "required": true,
  754. "schema": {
  755. "type": "string"
  756. },
  757. "description": "Repository owner"
  758. },
  759. {
  760. "name": "repo",
  761. "in": "path",
  762. "required": true,
  763. "schema": {
  764. "type": "string"
  765. },
  766. "description": "Repository name"
  767. },
  768. {
  769. "name": "sha",
  770. "in": "path",
  771. "required": true,
  772. "schema": {
  773. "type": "string"
  774. },
  775. "description": "Commit SHA"
  776. }
  777. ],
  778. "description": "Get details for a single commit. Set Accept header to application/vnd.gogs.sha to return only the SHA-1 hash of a commit reference."
  779. }
  780. },
  781. "/repos/{owner}/{repo}/raw/{ref}/{filepath}": {
  782. "get": {
  783. "operationId": "getRawContent",
  784. "summary": "Download raw content",
  785. "tags": [
  786. "Repositories"
  787. ],
  788. "responses": {
  789. "200": {
  790. "description": "Raw file content",
  791. "content": {
  792. "text/plain": {
  793. "schema": {
  794. "type": "string"
  795. }
  796. }
  797. }
  798. },
  799. "404": {
  800. "description": "Resource not found."
  801. }
  802. },
  803. "parameters": [
  804. {
  805. "name": "owner",
  806. "in": "path",
  807. "required": true,
  808. "schema": {
  809. "type": "string"
  810. },
  811. "description": "Repository owner"
  812. },
  813. {
  814. "name": "repo",
  815. "in": "path",
  816. "required": true,
  817. "schema": {
  818. "type": "string"
  819. },
  820. "description": "Repository name"
  821. },
  822. {
  823. "name": "ref",
  824. "in": "path",
  825. "required": true,
  826. "schema": {
  827. "type": "string"
  828. },
  829. "description": "Branch, tag, or commit"
  830. },
  831. {
  832. "name": "filepath",
  833. "in": "path",
  834. "required": true,
  835. "schema": {
  836. "type": "string"
  837. },
  838. "description": "File path"
  839. }
  840. ]
  841. }
  842. },
  843. "/repos/{owner}/{repo}/archive/{archive}": {
  844. "get": {
  845. "operationId": "downloadArchive",
  846. "summary": "Download archive",
  847. "tags": [
  848. "Repositories"
  849. ],
  850. "responses": {
  851. "200": {
  852. "description": "Archive file",
  853. "content": {
  854. "application/octet-stream": {
  855. "schema": {
  856. "type": "string",
  857. "format": "binary"
  858. }
  859. }
  860. }
  861. },
  862. "404": {
  863. "description": "Resource not found."
  864. }
  865. },
  866. "parameters": [
  867. {
  868. "name": "owner",
  869. "in": "path",
  870. "required": true,
  871. "schema": {
  872. "type": "string"
  873. },
  874. "description": "Repository owner"
  875. },
  876. {
  877. "name": "repo",
  878. "in": "path",
  879. "required": true,
  880. "schema": {
  881. "type": "string"
  882. },
  883. "description": "Repository name"
  884. },
  885. {
  886. "name": "archive",
  887. "in": "path",
  888. "required": true,
  889. "schema": {
  890. "type": "string"
  891. },
  892. "description": "Ref and format, e.g. master.zip or master.tar.gz"
  893. }
  894. ]
  895. }
  896. },
  897. "/repos/{owner}/{repo}/contents/{path}": {
  898. "get": {
  899. "operationId": "getContents",
  900. "summary": "Get contents",
  901. "tags": [
  902. "Repositories"
  903. ],
  904. "responses": {
  905. "200": {
  906. "description": "Success",
  907. "content": {
  908. "application/json": {
  909. "schema": {
  910. "$ref": "#/components/schemas/Content"
  911. }
  912. }
  913. }
  914. },
  915. "404": {
  916. "description": "Resource not found."
  917. }
  918. },
  919. "parameters": [
  920. {
  921. "name": "owner",
  922. "in": "path",
  923. "required": true,
  924. "schema": {
  925. "type": "string"
  926. },
  927. "description": "Repository owner"
  928. },
  929. {
  930. "name": "repo",
  931. "in": "path",
  932. "required": true,
  933. "schema": {
  934. "type": "string"
  935. },
  936. "description": "Repository name"
  937. },
  938. {
  939. "name": "path",
  940. "in": "path",
  941. "required": true,
  942. "schema": {
  943. "type": "string"
  944. },
  945. "description": "File or directory path"
  946. },
  947. {
  948. "name": "ref",
  949. "in": "query",
  950. "required": false,
  951. "schema": {
  952. "type": "string"
  953. },
  954. "description": "Branch, tag, or commit. Defaults to the default branch."
  955. }
  956. ],
  957. "description": "Get the contents of a file, directory, symlink, or submodule in a repository."
  958. },
  959. "put": {
  960. "operationId": "putContents",
  961. "summary": "Create or update a file",
  962. "description": "Creates or updates a file in the repository. The content must be base64 encoded.",
  963. "tags": [
  964. "Repositories"
  965. ],
  966. "parameters": [
  967. {
  968. "name": "owner",
  969. "in": "path",
  970. "required": true,
  971. "schema": {
  972. "type": "string"
  973. },
  974. "description": "Owner of the repository"
  975. },
  976. {
  977. "name": "repo",
  978. "in": "path",
  979. "required": true,
  980. "schema": {
  981. "type": "string"
  982. },
  983. "description": "Name of the repository"
  984. },
  985. {
  986. "name": "path",
  987. "in": "path",
  988. "required": true,
  989. "schema": {
  990. "type": "string"
  991. },
  992. "description": "Path of the file to create or update"
  993. }
  994. ],
  995. "requestBody": {
  996. "required": true,
  997. "content": {
  998. "application/json": {
  999. "schema": {
  1000. "type": "object",
  1001. "properties": {
  1002. "message": {
  1003. "type": "string",
  1004. "description": "Commit message"
  1005. },
  1006. "content": {
  1007. "type": "string",
  1008. "description": "Base64-encoded file content"
  1009. },
  1010. "branch": {
  1011. "type": "string",
  1012. "description": "Branch to commit to. Defaults to the repository's default branch."
  1013. }
  1014. },
  1015. "required": [
  1016. "message",
  1017. "content"
  1018. ]
  1019. }
  1020. }
  1021. }
  1022. },
  1023. "responses": {
  1024. "201": {
  1025. "description": "File created or updated successfully.",
  1026. "content": {
  1027. "application/json": {
  1028. "schema": {
  1029. "type": "object",
  1030. "properties": {
  1031. "content": {
  1032. "$ref": "#/components/schemas/Content"
  1033. },
  1034. "commit": {
  1035. "$ref": "#/components/schemas/Commit"
  1036. }
  1037. }
  1038. }
  1039. }
  1040. }
  1041. },
  1042. "404": {
  1043. "description": "Repository not found."
  1044. },
  1045. "422": {
  1046. "description": "Validation error."
  1047. }
  1048. }
  1049. }
  1050. },
  1051. "/repos/{owner}/{repo}/collaborators": {
  1052. "get": {
  1053. "operationId": "listCollaborators",
  1054. "summary": "List collaborators",
  1055. "tags": [
  1056. "Collaborators and Deploy Keys"
  1057. ],
  1058. "responses": {
  1059. "200": {
  1060. "description": "Success",
  1061. "content": {
  1062. "application/json": {
  1063. "schema": {
  1064. "type": "array",
  1065. "items": {
  1066. "$ref": "#/components/schemas/Collaborator"
  1067. }
  1068. }
  1069. }
  1070. }
  1071. },
  1072. "404": {
  1073. "description": "Resource not found."
  1074. }
  1075. },
  1076. "parameters": [
  1077. {
  1078. "name": "owner",
  1079. "in": "path",
  1080. "required": true,
  1081. "schema": {
  1082. "type": "string"
  1083. },
  1084. "description": "Repository owner"
  1085. },
  1086. {
  1087. "name": "repo",
  1088. "in": "path",
  1089. "required": true,
  1090. "schema": {
  1091. "type": "string"
  1092. },
  1093. "description": "Repository name"
  1094. }
  1095. ]
  1096. }
  1097. },
  1098. "/repos/{owner}/{repo}/collaborators/{collaborator}": {
  1099. "put": {
  1100. "operationId": "addCollaborator",
  1101. "summary": "Add a collaborator",
  1102. "tags": [
  1103. "Collaborators and Deploy Keys"
  1104. ],
  1105. "responses": {
  1106. "204": {
  1107. "description": "Collaborator has been added."
  1108. },
  1109. "404": {
  1110. "description": "Resource not found."
  1111. },
  1112. "422": {
  1113. "description": "Validation error."
  1114. }
  1115. },
  1116. "parameters": [
  1117. {
  1118. "name": "owner",
  1119. "in": "path",
  1120. "required": true,
  1121. "schema": {
  1122. "type": "string"
  1123. },
  1124. "description": "Repository owner"
  1125. },
  1126. {
  1127. "name": "repo",
  1128. "in": "path",
  1129. "required": true,
  1130. "schema": {
  1131. "type": "string"
  1132. },
  1133. "description": "Repository name"
  1134. },
  1135. {
  1136. "name": "collaborator",
  1137. "in": "path",
  1138. "required": true,
  1139. "schema": {
  1140. "type": "string"
  1141. },
  1142. "description": "Collaborator username"
  1143. }
  1144. ],
  1145. "requestBody": {
  1146. "required": true,
  1147. "content": {
  1148. "application/json": {
  1149. "schema": {
  1150. "type": "object",
  1151. "properties": {
  1152. "permission": {
  1153. "type": "string",
  1154. "enum": [
  1155. "read",
  1156. "write",
  1157. "admin"
  1158. ],
  1159. "default": "write"
  1160. }
  1161. }
  1162. }
  1163. }
  1164. }
  1165. }
  1166. },
  1167. "delete": {
  1168. "operationId": "removeCollaborator",
  1169. "summary": "Remove a collaborator",
  1170. "tags": [
  1171. "Collaborators and Deploy Keys"
  1172. ],
  1173. "responses": {
  1174. "204": {
  1175. "description": "The resource has been successfully deleted."
  1176. },
  1177. "404": {
  1178. "description": "Resource not found."
  1179. }
  1180. },
  1181. "parameters": [
  1182. {
  1183. "name": "owner",
  1184. "in": "path",
  1185. "required": true,
  1186. "schema": {
  1187. "type": "string"
  1188. },
  1189. "description": "Repository owner"
  1190. },
  1191. {
  1192. "name": "repo",
  1193. "in": "path",
  1194. "required": true,
  1195. "schema": {
  1196. "type": "string"
  1197. },
  1198. "description": "Repository name"
  1199. },
  1200. {
  1201. "name": "collaborator",
  1202. "in": "path",
  1203. "required": true,
  1204. "schema": {
  1205. "type": "string"
  1206. },
  1207. "description": "Collaborator username"
  1208. }
  1209. ]
  1210. },
  1211. "get": {
  1212. "operationId": "isCollaborator",
  1213. "summary": "Check if a user is a collaborator",
  1214. "description": "Returns 204 if the user is a collaborator, 404 if not.",
  1215. "tags": [
  1216. "Collaborators and Deploy Keys"
  1217. ],
  1218. "parameters": [
  1219. {
  1220. "name": "owner",
  1221. "in": "path",
  1222. "required": true,
  1223. "schema": {
  1224. "type": "string"
  1225. },
  1226. "description": "Owner of the repository"
  1227. },
  1228. {
  1229. "name": "repo",
  1230. "in": "path",
  1231. "required": true,
  1232. "schema": {
  1233. "type": "string"
  1234. },
  1235. "description": "Name of the repository"
  1236. },
  1237. {
  1238. "name": "collaborator",
  1239. "in": "path",
  1240. "required": true,
  1241. "schema": {
  1242. "type": "string"
  1243. },
  1244. "description": "Username to check"
  1245. }
  1246. ],
  1247. "responses": {
  1248. "204": {
  1249. "description": "User is a collaborator."
  1250. },
  1251. "404": {
  1252. "description": "User is not a collaborator."
  1253. },
  1254. "422": {
  1255. "description": "The specified user does not exist."
  1256. }
  1257. }
  1258. }
  1259. },
  1260. "/repos/{owner}/{repo}/keys": {
  1261. "get": {
  1262. "operationId": "listDeployKeys",
  1263. "summary": "List deploy keys",
  1264. "tags": [
  1265. "Collaborators and Deploy Keys"
  1266. ],
  1267. "responses": {
  1268. "200": {
  1269. "description": "Success",
  1270. "content": {
  1271. "application/json": {
  1272. "schema": {
  1273. "type": "array",
  1274. "items": {
  1275. "$ref": "#/components/schemas/DeployKey"
  1276. }
  1277. }
  1278. }
  1279. }
  1280. },
  1281. "404": {
  1282. "description": "Resource not found."
  1283. }
  1284. },
  1285. "parameters": [
  1286. {
  1287. "name": "owner",
  1288. "in": "path",
  1289. "required": true,
  1290. "schema": {
  1291. "type": "string"
  1292. },
  1293. "description": "Repository owner"
  1294. },
  1295. {
  1296. "name": "repo",
  1297. "in": "path",
  1298. "required": true,
  1299. "schema": {
  1300. "type": "string"
  1301. },
  1302. "description": "Repository name"
  1303. }
  1304. ]
  1305. },
  1306. "post": {
  1307. "operationId": "createDeployKey",
  1308. "summary": "Add a deploy key",
  1309. "tags": [
  1310. "Collaborators and Deploy Keys"
  1311. ],
  1312. "responses": {
  1313. "201": {
  1314. "description": "Created",
  1315. "content": {
  1316. "application/json": {
  1317. "schema": {
  1318. "$ref": "#/components/schemas/DeployKey"
  1319. }
  1320. }
  1321. }
  1322. },
  1323. "404": {
  1324. "description": "Resource not found."
  1325. },
  1326. "422": {
  1327. "description": "Validation error."
  1328. }
  1329. },
  1330. "parameters": [
  1331. {
  1332. "name": "owner",
  1333. "in": "path",
  1334. "required": true,
  1335. "schema": {
  1336. "type": "string"
  1337. },
  1338. "description": "Repository owner"
  1339. },
  1340. {
  1341. "name": "repo",
  1342. "in": "path",
  1343. "required": true,
  1344. "schema": {
  1345. "type": "string"
  1346. },
  1347. "description": "Repository name"
  1348. }
  1349. ],
  1350. "requestBody": {
  1351. "required": true,
  1352. "content": {
  1353. "application/json": {
  1354. "schema": {
  1355. "type": "object",
  1356. "properties": {
  1357. "title": {
  1358. "type": "string"
  1359. },
  1360. "key": {
  1361. "type": "string"
  1362. }
  1363. },
  1364. "required": [
  1365. "title",
  1366. "key"
  1367. ]
  1368. }
  1369. }
  1370. }
  1371. }
  1372. }
  1373. },
  1374. "/repos/{owner}/{repo}/keys/{id}": {
  1375. "get": {
  1376. "operationId": "getDeployKey",
  1377. "summary": "Get a deploy key",
  1378. "tags": [
  1379. "Collaborators and Deploy Keys"
  1380. ],
  1381. "responses": {
  1382. "200": {
  1383. "description": "Success",
  1384. "content": {
  1385. "application/json": {
  1386. "schema": {
  1387. "$ref": "#/components/schemas/DeployKey"
  1388. }
  1389. }
  1390. }
  1391. },
  1392. "404": {
  1393. "description": "Resource not found."
  1394. }
  1395. },
  1396. "parameters": [
  1397. {
  1398. "name": "owner",
  1399. "in": "path",
  1400. "required": true,
  1401. "schema": {
  1402. "type": "string"
  1403. },
  1404. "description": "Repository owner"
  1405. },
  1406. {
  1407. "name": "repo",
  1408. "in": "path",
  1409. "required": true,
  1410. "schema": {
  1411. "type": "string"
  1412. },
  1413. "description": "Repository name"
  1414. },
  1415. {
  1416. "name": "id",
  1417. "in": "path",
  1418. "required": true,
  1419. "schema": {
  1420. "type": "string"
  1421. },
  1422. "description": "Key ID"
  1423. }
  1424. ]
  1425. },
  1426. "delete": {
  1427. "operationId": "removeDeployKey",
  1428. "summary": "Remove a deploy key",
  1429. "tags": [
  1430. "Collaborators and Deploy Keys"
  1431. ],
  1432. "responses": {
  1433. "204": {
  1434. "description": "The resource has been successfully deleted."
  1435. },
  1436. "404": {
  1437. "description": "Resource not found."
  1438. }
  1439. },
  1440. "parameters": [
  1441. {
  1442. "name": "owner",
  1443. "in": "path",
  1444. "required": true,
  1445. "schema": {
  1446. "type": "string"
  1447. },
  1448. "description": "Repository owner"
  1449. },
  1450. {
  1451. "name": "repo",
  1452. "in": "path",
  1453. "required": true,
  1454. "schema": {
  1455. "type": "string"
  1456. },
  1457. "description": "Repository name"
  1458. },
  1459. {
  1460. "name": "id",
  1461. "in": "path",
  1462. "required": true,
  1463. "schema": {
  1464. "type": "string"
  1465. },
  1466. "description": "Key ID"
  1467. }
  1468. ]
  1469. }
  1470. },
  1471. "/repos/{owner}/{repo}/releases": {
  1472. "get": {
  1473. "operationId": "listReleases",
  1474. "summary": "List releases",
  1475. "tags": [
  1476. "Releases"
  1477. ],
  1478. "responses": {
  1479. "200": {
  1480. "description": "Success",
  1481. "content": {
  1482. "application/json": {
  1483. "schema": {
  1484. "type": "array",
  1485. "items": {
  1486. "$ref": "#/components/schemas/Release"
  1487. }
  1488. }
  1489. }
  1490. }
  1491. },
  1492. "404": {
  1493. "description": "Resource not found."
  1494. }
  1495. },
  1496. "parameters": [
  1497. {
  1498. "name": "owner",
  1499. "in": "path",
  1500. "required": true,
  1501. "schema": {
  1502. "type": "string"
  1503. },
  1504. "description": "Repository owner"
  1505. },
  1506. {
  1507. "name": "repo",
  1508. "in": "path",
  1509. "required": true,
  1510. "schema": {
  1511. "type": "string"
  1512. },
  1513. "description": "Repository name"
  1514. }
  1515. ]
  1516. }
  1517. },
  1518. "/repos/{owner}/{repo}/hooks": {
  1519. "get": {
  1520. "operationId": "listHooks",
  1521. "summary": "List hooks",
  1522. "tags": [
  1523. "Webhooks"
  1524. ],
  1525. "responses": {
  1526. "200": {
  1527. "description": "Success",
  1528. "content": {
  1529. "application/json": {
  1530. "schema": {
  1531. "type": "array",
  1532. "items": {
  1533. "$ref": "#/components/schemas/Hook"
  1534. }
  1535. }
  1536. }
  1537. }
  1538. },
  1539. "404": {
  1540. "description": "Resource not found."
  1541. }
  1542. },
  1543. "parameters": [
  1544. {
  1545. "name": "owner",
  1546. "in": "path",
  1547. "required": true,
  1548. "schema": {
  1549. "type": "string"
  1550. },
  1551. "description": "Repository owner"
  1552. },
  1553. {
  1554. "name": "repo",
  1555. "in": "path",
  1556. "required": true,
  1557. "schema": {
  1558. "type": "string"
  1559. },
  1560. "description": "Repository name"
  1561. }
  1562. ]
  1563. },
  1564. "post": {
  1565. "operationId": "createHook",
  1566. "summary": "Create a hook",
  1567. "tags": [
  1568. "Webhooks"
  1569. ],
  1570. "responses": {
  1571. "201": {
  1572. "description": "Created",
  1573. "content": {
  1574. "application/json": {
  1575. "schema": {
  1576. "$ref": "#/components/schemas/Hook"
  1577. }
  1578. }
  1579. }
  1580. },
  1581. "404": {
  1582. "description": "Resource not found."
  1583. },
  1584. "422": {
  1585. "description": "Validation error."
  1586. }
  1587. },
  1588. "parameters": [
  1589. {
  1590. "name": "owner",
  1591. "in": "path",
  1592. "required": true,
  1593. "schema": {
  1594. "type": "string"
  1595. },
  1596. "description": "Repository owner"
  1597. },
  1598. {
  1599. "name": "repo",
  1600. "in": "path",
  1601. "required": true,
  1602. "schema": {
  1603. "type": "string"
  1604. },
  1605. "description": "Repository name"
  1606. }
  1607. ],
  1608. "requestBody": {
  1609. "required": true,
  1610. "content": {
  1611. "application/json": {
  1612. "schema": {
  1613. "type": "object",
  1614. "properties": {
  1615. "type": {
  1616. "type": "string",
  1617. "enum": [
  1618. "gogs",
  1619. "slack",
  1620. "discord",
  1621. "dingtalk"
  1622. ]
  1623. },
  1624. "config": {
  1625. "type": "object",
  1626. "properties": {
  1627. "url": {
  1628. "type": "string"
  1629. },
  1630. "content_type": {
  1631. "type": "string",
  1632. "enum": [
  1633. "json",
  1634. "form"
  1635. ]
  1636. },
  1637. "secret": {
  1638. "type": "string"
  1639. }
  1640. },
  1641. "required": [
  1642. "url",
  1643. "content_type"
  1644. ]
  1645. },
  1646. "events": {
  1647. "type": "array",
  1648. "items": {
  1649. "type": "string"
  1650. },
  1651. "default": [
  1652. "push"
  1653. ]
  1654. },
  1655. "active": {
  1656. "type": "boolean",
  1657. "default": false
  1658. }
  1659. },
  1660. "required": [
  1661. "type",
  1662. "config"
  1663. ]
  1664. }
  1665. }
  1666. }
  1667. }
  1668. }
  1669. },
  1670. "/repos/{owner}/{repo}/hooks/{id}": {
  1671. "patch": {
  1672. "operationId": "editHook",
  1673. "summary": "Edit a hook",
  1674. "tags": [
  1675. "Webhooks"
  1676. ],
  1677. "responses": {
  1678. "200": {
  1679. "description": "Success",
  1680. "content": {
  1681. "application/json": {
  1682. "schema": {
  1683. "$ref": "#/components/schemas/Hook"
  1684. }
  1685. }
  1686. }
  1687. },
  1688. "404": {
  1689. "description": "Resource not found."
  1690. },
  1691. "422": {
  1692. "description": "Validation error."
  1693. }
  1694. },
  1695. "parameters": [
  1696. {
  1697. "name": "owner",
  1698. "in": "path",
  1699. "required": true,
  1700. "schema": {
  1701. "type": "string"
  1702. },
  1703. "description": "Repository owner"
  1704. },
  1705. {
  1706. "name": "repo",
  1707. "in": "path",
  1708. "required": true,
  1709. "schema": {
  1710. "type": "string"
  1711. },
  1712. "description": "Repository name"
  1713. },
  1714. {
  1715. "name": "id",
  1716. "in": "path",
  1717. "required": true,
  1718. "schema": {
  1719. "type": "string"
  1720. },
  1721. "description": "Hook ID"
  1722. }
  1723. ],
  1724. "requestBody": {
  1725. "required": true,
  1726. "content": {
  1727. "application/json": {
  1728. "schema": {
  1729. "type": "object",
  1730. "properties": {
  1731. "config": {
  1732. "type": "object",
  1733. "properties": {
  1734. "url": {
  1735. "type": "string"
  1736. },
  1737. "content_type": {
  1738. "type": "string"
  1739. },
  1740. "secret": {
  1741. "type": "string"
  1742. }
  1743. }
  1744. },
  1745. "events": {
  1746. "type": "array",
  1747. "items": {
  1748. "type": "string"
  1749. }
  1750. },
  1751. "active": {
  1752. "type": "boolean"
  1753. }
  1754. },
  1755. "required": [
  1756. "config"
  1757. ]
  1758. }
  1759. }
  1760. }
  1761. }
  1762. },
  1763. "delete": {
  1764. "operationId": "deleteHook",
  1765. "summary": "Delete a hook",
  1766. "tags": [
  1767. "Webhooks"
  1768. ],
  1769. "responses": {
  1770. "204": {
  1771. "description": "The resource has been successfully deleted."
  1772. },
  1773. "404": {
  1774. "description": "Resource not found."
  1775. }
  1776. },
  1777. "parameters": [
  1778. {
  1779. "name": "owner",
  1780. "in": "path",
  1781. "required": true,
  1782. "schema": {
  1783. "type": "string"
  1784. },
  1785. "description": "Repository owner"
  1786. },
  1787. {
  1788. "name": "repo",
  1789. "in": "path",
  1790. "required": true,
  1791. "schema": {
  1792. "type": "string"
  1793. },
  1794. "description": "Repository name"
  1795. },
  1796. {
  1797. "name": "id",
  1798. "in": "path",
  1799. "required": true,
  1800. "schema": {
  1801. "type": "string"
  1802. },
  1803. "description": "Hook ID"
  1804. }
  1805. ]
  1806. }
  1807. },
  1808. "/repos/{owner}/{repo}/issues": {
  1809. "get": {
  1810. "operationId": "listIssues",
  1811. "summary": "List issues for a repository",
  1812. "tags": [
  1813. "Issues"
  1814. ],
  1815. "responses": {
  1816. "200": {
  1817. "description": "Success",
  1818. "content": {
  1819. "application/json": {
  1820. "schema": {
  1821. "type": "array",
  1822. "items": {
  1823. "$ref": "#/components/schemas/Issue"
  1824. }
  1825. }
  1826. }
  1827. }
  1828. },
  1829. "404": {
  1830. "description": "Resource not found."
  1831. }
  1832. },
  1833. "parameters": [
  1834. {
  1835. "name": "owner",
  1836. "in": "path",
  1837. "required": true,
  1838. "schema": {
  1839. "type": "string"
  1840. },
  1841. "description": "Repository owner"
  1842. },
  1843. {
  1844. "name": "repo",
  1845. "in": "path",
  1846. "required": true,
  1847. "schema": {
  1848. "type": "string"
  1849. },
  1850. "description": "Repository name"
  1851. }
  1852. ],
  1853. "description": "This endpoint may also return pull requests. If an issue is a pull request, the object will include a pull_request key."
  1854. },
  1855. "post": {
  1856. "operationId": "createIssue",
  1857. "summary": "Create an issue",
  1858. "tags": [
  1859. "Issues"
  1860. ],
  1861. "responses": {
  1862. "201": {
  1863. "description": "Created",
  1864. "content": {
  1865. "application/json": {
  1866. "schema": {
  1867. "$ref": "#/components/schemas/Issue"
  1868. }
  1869. }
  1870. }
  1871. },
  1872. "404": {
  1873. "description": "Resource not found."
  1874. },
  1875. "422": {
  1876. "description": "Validation error."
  1877. }
  1878. },
  1879. "parameters": [
  1880. {
  1881. "name": "owner",
  1882. "in": "path",
  1883. "required": true,
  1884. "schema": {
  1885. "type": "string"
  1886. },
  1887. "description": "Repository owner"
  1888. },
  1889. {
  1890. "name": "repo",
  1891. "in": "path",
  1892. "required": true,
  1893. "schema": {
  1894. "type": "string"
  1895. },
  1896. "description": "Repository name"
  1897. }
  1898. ],
  1899. "requestBody": {
  1900. "required": true,
  1901. "content": {
  1902. "application/json": {
  1903. "schema": {
  1904. "type": "object",
  1905. "properties": {
  1906. "title": {
  1907. "type": "string"
  1908. },
  1909. "body": {
  1910. "type": "string"
  1911. },
  1912. "assignee": {
  1913. "type": "string"
  1914. },
  1915. "milestone": {
  1916. "type": "integer"
  1917. },
  1918. "labels": {
  1919. "type": "array",
  1920. "items": {
  1921. "type": "integer"
  1922. }
  1923. },
  1924. "closed": {
  1925. "type": "boolean",
  1926. "default": false
  1927. }
  1928. },
  1929. "required": [
  1930. "title"
  1931. ]
  1932. }
  1933. }
  1934. }
  1935. }
  1936. }
  1937. },
  1938. "/repos/{owner}/{repo}/issues/{index}": {
  1939. "get": {
  1940. "operationId": "getIssue",
  1941. "summary": "Get a single issue",
  1942. "tags": [
  1943. "Issues"
  1944. ],
  1945. "responses": {
  1946. "200": {
  1947. "description": "Success",
  1948. "content": {
  1949. "application/json": {
  1950. "schema": {
  1951. "$ref": "#/components/schemas/Issue"
  1952. }
  1953. }
  1954. }
  1955. },
  1956. "404": {
  1957. "description": "Resource not found."
  1958. }
  1959. },
  1960. "parameters": [
  1961. {
  1962. "name": "owner",
  1963. "in": "path",
  1964. "required": true,
  1965. "schema": {
  1966. "type": "string"
  1967. },
  1968. "description": "Repository owner"
  1969. },
  1970. {
  1971. "name": "repo",
  1972. "in": "path",
  1973. "required": true,
  1974. "schema": {
  1975. "type": "string"
  1976. },
  1977. "description": "Repository name"
  1978. },
  1979. {
  1980. "name": "index",
  1981. "in": "path",
  1982. "required": true,
  1983. "schema": {
  1984. "type": "string"
  1985. },
  1986. "description": "Issue index"
  1987. }
  1988. ]
  1989. },
  1990. "patch": {
  1991. "operationId": "editIssue",
  1992. "summary": "Edit an issue",
  1993. "tags": [
  1994. "Issues"
  1995. ],
  1996. "responses": {
  1997. "200": {
  1998. "description": "Success",
  1999. "content": {
  2000. "application/json": {
  2001. "schema": {
  2002. "$ref": "#/components/schemas/Issue"
  2003. }
  2004. }
  2005. }
  2006. },
  2007. "404": {
  2008. "description": "Resource not found."
  2009. },
  2010. "422": {
  2011. "description": "Validation error."
  2012. }
  2013. },
  2014. "parameters": [
  2015. {
  2016. "name": "owner",
  2017. "in": "path",
  2018. "required": true,
  2019. "schema": {
  2020. "type": "string"
  2021. },
  2022. "description": "Repository owner"
  2023. },
  2024. {
  2025. "name": "repo",
  2026. "in": "path",
  2027. "required": true,
  2028. "schema": {
  2029. "type": "string"
  2030. },
  2031. "description": "Repository name"
  2032. },
  2033. {
  2034. "name": "index",
  2035. "in": "path",
  2036. "required": true,
  2037. "schema": {
  2038. "type": "string"
  2039. },
  2040. "description": "Issue index"
  2041. }
  2042. ],
  2043. "requestBody": {
  2044. "required": true,
  2045. "content": {
  2046. "application/json": {
  2047. "schema": {
  2048. "type": "object",
  2049. "properties": {
  2050. "title": {
  2051. "type": "string"
  2052. },
  2053. "body": {
  2054. "type": "string"
  2055. },
  2056. "assignee": {
  2057. "type": "string"
  2058. },
  2059. "milestone": {
  2060. "type": "integer"
  2061. },
  2062. "state": {
  2063. "type": "string",
  2064. "enum": [
  2065. "open",
  2066. "closed"
  2067. ]
  2068. }
  2069. }
  2070. }
  2071. }
  2072. }
  2073. }
  2074. }
  2075. },
  2076. "/repos/{owner}/{repo}/issues/{index}/comments": {
  2077. "get": {
  2078. "operationId": "listIssueComments",
  2079. "summary": "List comments on an issue",
  2080. "tags": [
  2081. "Issues"
  2082. ],
  2083. "responses": {
  2084. "200": {
  2085. "description": "Success",
  2086. "content": {
  2087. "application/json": {
  2088. "schema": {
  2089. "type": "array",
  2090. "items": {
  2091. "$ref": "#/components/schemas/Comment"
  2092. }
  2093. }
  2094. }
  2095. }
  2096. },
  2097. "404": {
  2098. "description": "Resource not found."
  2099. }
  2100. },
  2101. "parameters": [
  2102. {
  2103. "name": "owner",
  2104. "in": "path",
  2105. "required": true,
  2106. "schema": {
  2107. "type": "string"
  2108. },
  2109. "description": "Repository owner"
  2110. },
  2111. {
  2112. "name": "repo",
  2113. "in": "path",
  2114. "required": true,
  2115. "schema": {
  2116. "type": "string"
  2117. },
  2118. "description": "Repository name"
  2119. },
  2120. {
  2121. "name": "index",
  2122. "in": "path",
  2123. "required": true,
  2124. "schema": {
  2125. "type": "string"
  2126. },
  2127. "description": "Issue index"
  2128. },
  2129. {
  2130. "name": "since",
  2131. "in": "query",
  2132. "required": false,
  2133. "schema": {
  2134. "type": "string"
  2135. },
  2136. "description": "Only comments updated at or after this time (RFC 3339)"
  2137. }
  2138. ]
  2139. },
  2140. "post": {
  2141. "operationId": "createComment",
  2142. "summary": "Create a comment",
  2143. "tags": [
  2144. "Issues"
  2145. ],
  2146. "responses": {
  2147. "201": {
  2148. "description": "Created",
  2149. "content": {
  2150. "application/json": {
  2151. "schema": {
  2152. "$ref": "#/components/schemas/Comment"
  2153. }
  2154. }
  2155. }
  2156. },
  2157. "404": {
  2158. "description": "Resource not found."
  2159. },
  2160. "422": {
  2161. "description": "Validation error."
  2162. }
  2163. },
  2164. "parameters": [
  2165. {
  2166. "name": "owner",
  2167. "in": "path",
  2168. "required": true,
  2169. "schema": {
  2170. "type": "string"
  2171. },
  2172. "description": "Repository owner"
  2173. },
  2174. {
  2175. "name": "repo",
  2176. "in": "path",
  2177. "required": true,
  2178. "schema": {
  2179. "type": "string"
  2180. },
  2181. "description": "Repository name"
  2182. },
  2183. {
  2184. "name": "index",
  2185. "in": "path",
  2186. "required": true,
  2187. "schema": {
  2188. "type": "string"
  2189. },
  2190. "description": "Issue index"
  2191. }
  2192. ],
  2193. "requestBody": {
  2194. "required": true,
  2195. "content": {
  2196. "application/json": {
  2197. "schema": {
  2198. "type": "object",
  2199. "properties": {
  2200. "body": {
  2201. "type": "string"
  2202. }
  2203. },
  2204. "required": [
  2205. "body"
  2206. ]
  2207. }
  2208. }
  2209. }
  2210. }
  2211. }
  2212. },
  2213. "/repos/{owner}/{repo}/issues/comments": {
  2214. "get": {
  2215. "operationId": "listRepoComments",
  2216. "summary": "List comments in a repository",
  2217. "tags": [
  2218. "Issues"
  2219. ],
  2220. "responses": {
  2221. "200": {
  2222. "description": "Success",
  2223. "content": {
  2224. "application/json": {
  2225. "schema": {
  2226. "type": "array",
  2227. "items": {
  2228. "$ref": "#/components/schemas/Comment"
  2229. }
  2230. }
  2231. }
  2232. }
  2233. },
  2234. "404": {
  2235. "description": "Resource not found."
  2236. }
  2237. },
  2238. "parameters": [
  2239. {
  2240. "name": "owner",
  2241. "in": "path",
  2242. "required": true,
  2243. "schema": {
  2244. "type": "string"
  2245. },
  2246. "description": "Repository owner"
  2247. },
  2248. {
  2249. "name": "repo",
  2250. "in": "path",
  2251. "required": true,
  2252. "schema": {
  2253. "type": "string"
  2254. },
  2255. "description": "Repository name"
  2256. },
  2257. {
  2258. "name": "since",
  2259. "in": "query",
  2260. "required": false,
  2261. "schema": {
  2262. "type": "string"
  2263. },
  2264. "description": "Only comments updated at or after this time (RFC 3339)"
  2265. }
  2266. ]
  2267. }
  2268. },
  2269. "/repos/{owner}/{repo}/issues/{index}/comments/{id}": {
  2270. "patch": {
  2271. "operationId": "editComment",
  2272. "summary": "Edit a comment",
  2273. "tags": [
  2274. "Issues"
  2275. ],
  2276. "responses": {
  2277. "200": {
  2278. "description": "Success",
  2279. "content": {
  2280. "application/json": {
  2281. "schema": {
  2282. "$ref": "#/components/schemas/Comment"
  2283. }
  2284. }
  2285. }
  2286. },
  2287. "404": {
  2288. "description": "Resource not found."
  2289. },
  2290. "422": {
  2291. "description": "Validation error."
  2292. }
  2293. },
  2294. "parameters": [
  2295. {
  2296. "name": "owner",
  2297. "in": "path",
  2298. "required": true,
  2299. "schema": {
  2300. "type": "string"
  2301. },
  2302. "description": "Repository owner"
  2303. },
  2304. {
  2305. "name": "repo",
  2306. "in": "path",
  2307. "required": true,
  2308. "schema": {
  2309. "type": "string"
  2310. },
  2311. "description": "Repository name"
  2312. },
  2313. {
  2314. "name": "index",
  2315. "in": "path",
  2316. "required": true,
  2317. "schema": {
  2318. "type": "string"
  2319. },
  2320. "description": "Issue index"
  2321. },
  2322. {
  2323. "name": "id",
  2324. "in": "path",
  2325. "required": true,
  2326. "schema": {
  2327. "type": "string"
  2328. },
  2329. "description": "Comment ID"
  2330. }
  2331. ],
  2332. "requestBody": {
  2333. "required": true,
  2334. "content": {
  2335. "application/json": {
  2336. "schema": {
  2337. "type": "object",
  2338. "properties": {
  2339. "body": {
  2340. "type": "string"
  2341. }
  2342. },
  2343. "required": [
  2344. "body"
  2345. ]
  2346. }
  2347. }
  2348. }
  2349. }
  2350. },
  2351. "delete": {
  2352. "operationId": "deleteComment",
  2353. "summary": "Delete a comment",
  2354. "tags": [
  2355. "Issues"
  2356. ],
  2357. "responses": {
  2358. "204": {
  2359. "description": "The resource has been successfully deleted."
  2360. },
  2361. "404": {
  2362. "description": "Resource not found."
  2363. }
  2364. },
  2365. "parameters": [
  2366. {
  2367. "name": "owner",
  2368. "in": "path",
  2369. "required": true,
  2370. "schema": {
  2371. "type": "string"
  2372. },
  2373. "description": "Repository owner"
  2374. },
  2375. {
  2376. "name": "repo",
  2377. "in": "path",
  2378. "required": true,
  2379. "schema": {
  2380. "type": "string"
  2381. },
  2382. "description": "Repository name"
  2383. },
  2384. {
  2385. "name": "index",
  2386. "in": "path",
  2387. "required": true,
  2388. "schema": {
  2389. "type": "string"
  2390. },
  2391. "description": "Issue index"
  2392. },
  2393. {
  2394. "name": "id",
  2395. "in": "path",
  2396. "required": true,
  2397. "schema": {
  2398. "type": "string"
  2399. },
  2400. "description": "Comment ID"
  2401. }
  2402. ]
  2403. }
  2404. },
  2405. "/repos/{owner}/{repo}/labels": {
  2406. "get": {
  2407. "operationId": "listLabels",
  2408. "summary": "List all labels for a repository",
  2409. "tags": [
  2410. "Issues"
  2411. ],
  2412. "responses": {
  2413. "200": {
  2414. "description": "Success",
  2415. "content": {
  2416. "application/json": {
  2417. "schema": {
  2418. "type": "array",
  2419. "items": {
  2420. "$ref": "#/components/schemas/Label"
  2421. }
  2422. }
  2423. }
  2424. }
  2425. },
  2426. "404": {
  2427. "description": "Resource not found."
  2428. }
  2429. },
  2430. "parameters": [
  2431. {
  2432. "name": "owner",
  2433. "in": "path",
  2434. "required": true,
  2435. "schema": {
  2436. "type": "string"
  2437. },
  2438. "description": "Repository owner"
  2439. },
  2440. {
  2441. "name": "repo",
  2442. "in": "path",
  2443. "required": true,
  2444. "schema": {
  2445. "type": "string"
  2446. },
  2447. "description": "Repository name"
  2448. }
  2449. ]
  2450. },
  2451. "post": {
  2452. "operationId": "createLabel",
  2453. "summary": "Create a label",
  2454. "tags": [
  2455. "Issues"
  2456. ],
  2457. "responses": {
  2458. "201": {
  2459. "description": "Created",
  2460. "content": {
  2461. "application/json": {
  2462. "schema": {
  2463. "$ref": "#/components/schemas/Label"
  2464. }
  2465. }
  2466. }
  2467. },
  2468. "404": {
  2469. "description": "Resource not found."
  2470. },
  2471. "422": {
  2472. "description": "Validation error."
  2473. }
  2474. },
  2475. "parameters": [
  2476. {
  2477. "name": "owner",
  2478. "in": "path",
  2479. "required": true,
  2480. "schema": {
  2481. "type": "string"
  2482. },
  2483. "description": "Repository owner"
  2484. },
  2485. {
  2486. "name": "repo",
  2487. "in": "path",
  2488. "required": true,
  2489. "schema": {
  2490. "type": "string"
  2491. },
  2492. "description": "Repository name"
  2493. }
  2494. ],
  2495. "requestBody": {
  2496. "required": true,
  2497. "content": {
  2498. "application/json": {
  2499. "schema": {
  2500. "type": "object",
  2501. "properties": {
  2502. "name": {
  2503. "type": "string"
  2504. },
  2505. "color": {
  2506. "type": "string",
  2507. "description": "Hex color code with leading #"
  2508. }
  2509. },
  2510. "required": [
  2511. "name",
  2512. "color"
  2513. ]
  2514. }
  2515. }
  2516. }
  2517. }
  2518. }
  2519. },
  2520. "/repos/{owner}/{repo}/labels/{id}": {
  2521. "get": {
  2522. "operationId": "getLabel",
  2523. "summary": "Get a single label",
  2524. "tags": [
  2525. "Issues"
  2526. ],
  2527. "responses": {
  2528. "200": {
  2529. "description": "Success",
  2530. "content": {
  2531. "application/json": {
  2532. "schema": {
  2533. "$ref": "#/components/schemas/Label"
  2534. }
  2535. }
  2536. }
  2537. },
  2538. "404": {
  2539. "description": "Resource not found."
  2540. }
  2541. },
  2542. "parameters": [
  2543. {
  2544. "name": "owner",
  2545. "in": "path",
  2546. "required": true,
  2547. "schema": {
  2548. "type": "string"
  2549. },
  2550. "description": "Repository owner"
  2551. },
  2552. {
  2553. "name": "repo",
  2554. "in": "path",
  2555. "required": true,
  2556. "schema": {
  2557. "type": "string"
  2558. },
  2559. "description": "Repository name"
  2560. },
  2561. {
  2562. "name": "id",
  2563. "in": "path",
  2564. "required": true,
  2565. "schema": {
  2566. "type": "string"
  2567. },
  2568. "description": "Label ID"
  2569. }
  2570. ]
  2571. },
  2572. "patch": {
  2573. "operationId": "updateLabel",
  2574. "summary": "Update a label",
  2575. "tags": [
  2576. "Issues"
  2577. ],
  2578. "responses": {
  2579. "200": {
  2580. "description": "Success",
  2581. "content": {
  2582. "application/json": {
  2583. "schema": {
  2584. "$ref": "#/components/schemas/Label"
  2585. }
  2586. }
  2587. }
  2588. },
  2589. "404": {
  2590. "description": "Resource not found."
  2591. },
  2592. "422": {
  2593. "description": "Validation error."
  2594. }
  2595. },
  2596. "parameters": [
  2597. {
  2598. "name": "owner",
  2599. "in": "path",
  2600. "required": true,
  2601. "schema": {
  2602. "type": "string"
  2603. },
  2604. "description": "Repository owner"
  2605. },
  2606. {
  2607. "name": "repo",
  2608. "in": "path",
  2609. "required": true,
  2610. "schema": {
  2611. "type": "string"
  2612. },
  2613. "description": "Repository name"
  2614. },
  2615. {
  2616. "name": "id",
  2617. "in": "path",
  2618. "required": true,
  2619. "schema": {
  2620. "type": "string"
  2621. },
  2622. "description": "Label ID"
  2623. }
  2624. ],
  2625. "requestBody": {
  2626. "required": true,
  2627. "content": {
  2628. "application/json": {
  2629. "schema": {
  2630. "type": "object",
  2631. "properties": {
  2632. "name": {
  2633. "type": "string"
  2634. },
  2635. "color": {
  2636. "type": "string"
  2637. }
  2638. }
  2639. }
  2640. }
  2641. }
  2642. }
  2643. },
  2644. "delete": {
  2645. "operationId": "deleteLabel",
  2646. "summary": "Delete a label",
  2647. "tags": [
  2648. "Issues"
  2649. ],
  2650. "responses": {
  2651. "204": {
  2652. "description": "The resource has been successfully deleted."
  2653. },
  2654. "404": {
  2655. "description": "Resource not found."
  2656. }
  2657. },
  2658. "parameters": [
  2659. {
  2660. "name": "owner",
  2661. "in": "path",
  2662. "required": true,
  2663. "schema": {
  2664. "type": "string"
  2665. },
  2666. "description": "Repository owner"
  2667. },
  2668. {
  2669. "name": "repo",
  2670. "in": "path",
  2671. "required": true,
  2672. "schema": {
  2673. "type": "string"
  2674. },
  2675. "description": "Repository name"
  2676. },
  2677. {
  2678. "name": "id",
  2679. "in": "path",
  2680. "required": true,
  2681. "schema": {
  2682. "type": "string"
  2683. },
  2684. "description": "Label ID"
  2685. }
  2686. ]
  2687. }
  2688. },
  2689. "/repos/{owner}/{repo}/issues/{index}/labels": {
  2690. "get": {
  2691. "operationId": "listIssueLabels",
  2692. "summary": "List labels on an issue",
  2693. "tags": [
  2694. "Issues"
  2695. ],
  2696. "responses": {
  2697. "200": {
  2698. "description": "Success",
  2699. "content": {
  2700. "application/json": {
  2701. "schema": {
  2702. "type": "array",
  2703. "items": {
  2704. "$ref": "#/components/schemas/Label"
  2705. }
  2706. }
  2707. }
  2708. }
  2709. },
  2710. "404": {
  2711. "description": "Resource not found."
  2712. }
  2713. },
  2714. "parameters": [
  2715. {
  2716. "name": "owner",
  2717. "in": "path",
  2718. "required": true,
  2719. "schema": {
  2720. "type": "string"
  2721. },
  2722. "description": "Repository owner"
  2723. },
  2724. {
  2725. "name": "repo",
  2726. "in": "path",
  2727. "required": true,
  2728. "schema": {
  2729. "type": "string"
  2730. },
  2731. "description": "Repository name"
  2732. },
  2733. {
  2734. "name": "index",
  2735. "in": "path",
  2736. "required": true,
  2737. "schema": {
  2738. "type": "string"
  2739. },
  2740. "description": "Issue index"
  2741. }
  2742. ]
  2743. },
  2744. "post": {
  2745. "operationId": "addIssueLabels",
  2746. "summary": "Add labels to an issue",
  2747. "tags": [
  2748. "Issues"
  2749. ],
  2750. "responses": {
  2751. "200": {
  2752. "description": "Success",
  2753. "content": {
  2754. "application/json": {
  2755. "schema": {
  2756. "type": "array",
  2757. "items": {
  2758. "$ref": "#/components/schemas/Label"
  2759. }
  2760. }
  2761. }
  2762. }
  2763. },
  2764. "404": {
  2765. "description": "Resource not found."
  2766. },
  2767. "422": {
  2768. "description": "Validation error."
  2769. }
  2770. },
  2771. "parameters": [
  2772. {
  2773. "name": "owner",
  2774. "in": "path",
  2775. "required": true,
  2776. "schema": {
  2777. "type": "string"
  2778. },
  2779. "description": "Repository owner"
  2780. },
  2781. {
  2782. "name": "repo",
  2783. "in": "path",
  2784. "required": true,
  2785. "schema": {
  2786. "type": "string"
  2787. },
  2788. "description": "Repository name"
  2789. },
  2790. {
  2791. "name": "index",
  2792. "in": "path",
  2793. "required": true,
  2794. "schema": {
  2795. "type": "string"
  2796. },
  2797. "description": "Issue index"
  2798. }
  2799. ],
  2800. "requestBody": {
  2801. "required": true,
  2802. "content": {
  2803. "application/json": {
  2804. "schema": {
  2805. "type": "object",
  2806. "properties": {
  2807. "labels": {
  2808. "type": "array",
  2809. "items": {
  2810. "type": "integer"
  2811. }
  2812. }
  2813. },
  2814. "required": [
  2815. "labels"
  2816. ]
  2817. }
  2818. }
  2819. }
  2820. }
  2821. },
  2822. "put": {
  2823. "operationId": "replaceIssueLabels",
  2824. "summary": "Replace all labels for an issue",
  2825. "tags": [
  2826. "Issues"
  2827. ],
  2828. "responses": {
  2829. "200": {
  2830. "description": "Success",
  2831. "content": {
  2832. "application/json": {
  2833. "schema": {
  2834. "type": "array",
  2835. "items": {
  2836. "$ref": "#/components/schemas/Label"
  2837. }
  2838. }
  2839. }
  2840. }
  2841. },
  2842. "404": {
  2843. "description": "Resource not found."
  2844. },
  2845. "422": {
  2846. "description": "Validation error."
  2847. }
  2848. },
  2849. "parameters": [
  2850. {
  2851. "name": "owner",
  2852. "in": "path",
  2853. "required": true,
  2854. "schema": {
  2855. "type": "string"
  2856. },
  2857. "description": "Repository owner"
  2858. },
  2859. {
  2860. "name": "repo",
  2861. "in": "path",
  2862. "required": true,
  2863. "schema": {
  2864. "type": "string"
  2865. },
  2866. "description": "Repository name"
  2867. },
  2868. {
  2869. "name": "index",
  2870. "in": "path",
  2871. "required": true,
  2872. "schema": {
  2873. "type": "string"
  2874. },
  2875. "description": "Issue index"
  2876. }
  2877. ],
  2878. "requestBody": {
  2879. "required": true,
  2880. "content": {
  2881. "application/json": {
  2882. "schema": {
  2883. "type": "object",
  2884. "properties": {
  2885. "labels": {
  2886. "type": "array",
  2887. "items": {
  2888. "type": "integer"
  2889. }
  2890. }
  2891. },
  2892. "required": [
  2893. "labels"
  2894. ]
  2895. }
  2896. }
  2897. }
  2898. }
  2899. },
  2900. "delete": {
  2901. "operationId": "removeAllIssueLabels",
  2902. "summary": "Remove all labels from an issue",
  2903. "tags": [
  2904. "Issues"
  2905. ],
  2906. "responses": {
  2907. "204": {
  2908. "description": "The resource has been successfully deleted."
  2909. },
  2910. "404": {
  2911. "description": "Resource not found."
  2912. }
  2913. },
  2914. "parameters": [
  2915. {
  2916. "name": "owner",
  2917. "in": "path",
  2918. "required": true,
  2919. "schema": {
  2920. "type": "string"
  2921. },
  2922. "description": "Repository owner"
  2923. },
  2924. {
  2925. "name": "repo",
  2926. "in": "path",
  2927. "required": true,
  2928. "schema": {
  2929. "type": "string"
  2930. },
  2931. "description": "Repository name"
  2932. },
  2933. {
  2934. "name": "index",
  2935. "in": "path",
  2936. "required": true,
  2937. "schema": {
  2938. "type": "string"
  2939. },
  2940. "description": "Issue index"
  2941. }
  2942. ]
  2943. }
  2944. },
  2945. "/repos/{owner}/{repo}/issues/{index}/labels/{id}": {
  2946. "delete": {
  2947. "operationId": "removeIssueLabel",
  2948. "summary": "Remove a label from an issue",
  2949. "tags": [
  2950. "Issues"
  2951. ],
  2952. "responses": {
  2953. "204": {
  2954. "description": "The resource has been successfully deleted."
  2955. },
  2956. "404": {
  2957. "description": "Resource not found."
  2958. }
  2959. },
  2960. "parameters": [
  2961. {
  2962. "name": "owner",
  2963. "in": "path",
  2964. "required": true,
  2965. "schema": {
  2966. "type": "string"
  2967. },
  2968. "description": "Repository owner"
  2969. },
  2970. {
  2971. "name": "repo",
  2972. "in": "path",
  2973. "required": true,
  2974. "schema": {
  2975. "type": "string"
  2976. },
  2977. "description": "Repository name"
  2978. },
  2979. {
  2980. "name": "index",
  2981. "in": "path",
  2982. "required": true,
  2983. "schema": {
  2984. "type": "string"
  2985. },
  2986. "description": "Issue index"
  2987. },
  2988. {
  2989. "name": "id",
  2990. "in": "path",
  2991. "required": true,
  2992. "schema": {
  2993. "type": "string"
  2994. },
  2995. "description": "Label ID"
  2996. }
  2997. ]
  2998. }
  2999. },
  3000. "/repos/{owner}/{repo}/milestones": {
  3001. "get": {
  3002. "operationId": "listMilestones",
  3003. "summary": "List milestones for a repository",
  3004. "tags": [
  3005. "Issues"
  3006. ],
  3007. "responses": {
  3008. "200": {
  3009. "description": "Success",
  3010. "content": {
  3011. "application/json": {
  3012. "schema": {
  3013. "type": "array",
  3014. "items": {
  3015. "$ref": "#/components/schemas/Milestone"
  3016. }
  3017. }
  3018. }
  3019. }
  3020. },
  3021. "404": {
  3022. "description": "Resource not found."
  3023. }
  3024. },
  3025. "parameters": [
  3026. {
  3027. "name": "owner",
  3028. "in": "path",
  3029. "required": true,
  3030. "schema": {
  3031. "type": "string"
  3032. },
  3033. "description": "Repository owner"
  3034. },
  3035. {
  3036. "name": "repo",
  3037. "in": "path",
  3038. "required": true,
  3039. "schema": {
  3040. "type": "string"
  3041. },
  3042. "description": "Repository name"
  3043. }
  3044. ]
  3045. },
  3046. "post": {
  3047. "operationId": "createMilestone",
  3048. "summary": "Create a milestone",
  3049. "tags": [
  3050. "Issues"
  3051. ],
  3052. "responses": {
  3053. "201": {
  3054. "description": "Created",
  3055. "content": {
  3056. "application/json": {
  3057. "schema": {
  3058. "$ref": "#/components/schemas/Milestone"
  3059. }
  3060. }
  3061. }
  3062. },
  3063. "404": {
  3064. "description": "Resource not found."
  3065. },
  3066. "422": {
  3067. "description": "Validation error."
  3068. }
  3069. },
  3070. "parameters": [
  3071. {
  3072. "name": "owner",
  3073. "in": "path",
  3074. "required": true,
  3075. "schema": {
  3076. "type": "string"
  3077. },
  3078. "description": "Repository owner"
  3079. },
  3080. {
  3081. "name": "repo",
  3082. "in": "path",
  3083. "required": true,
  3084. "schema": {
  3085. "type": "string"
  3086. },
  3087. "description": "Repository name"
  3088. }
  3089. ],
  3090. "requestBody": {
  3091. "required": true,
  3092. "content": {
  3093. "application/json": {
  3094. "schema": {
  3095. "type": "object",
  3096. "properties": {
  3097. "title": {
  3098. "type": "string"
  3099. },
  3100. "description": {
  3101. "type": "string"
  3102. },
  3103. "due_on": {
  3104. "type": "string",
  3105. "format": "date-time"
  3106. }
  3107. },
  3108. "required": [
  3109. "title"
  3110. ]
  3111. }
  3112. }
  3113. }
  3114. }
  3115. }
  3116. },
  3117. "/repos/{owner}/{repo}/milestones/{id}": {
  3118. "get": {
  3119. "operationId": "getMilestone",
  3120. "summary": "Get a single milestone",
  3121. "tags": [
  3122. "Issues"
  3123. ],
  3124. "responses": {
  3125. "200": {
  3126. "description": "Success",
  3127. "content": {
  3128. "application/json": {
  3129. "schema": {
  3130. "$ref": "#/components/schemas/Milestone"
  3131. }
  3132. }
  3133. }
  3134. },
  3135. "404": {
  3136. "description": "Resource not found."
  3137. }
  3138. },
  3139. "parameters": [
  3140. {
  3141. "name": "owner",
  3142. "in": "path",
  3143. "required": true,
  3144. "schema": {
  3145. "type": "string"
  3146. },
  3147. "description": "Repository owner"
  3148. },
  3149. {
  3150. "name": "repo",
  3151. "in": "path",
  3152. "required": true,
  3153. "schema": {
  3154. "type": "string"
  3155. },
  3156. "description": "Repository name"
  3157. },
  3158. {
  3159. "name": "id",
  3160. "in": "path",
  3161. "required": true,
  3162. "schema": {
  3163. "type": "string"
  3164. },
  3165. "description": "Milestone ID"
  3166. }
  3167. ]
  3168. },
  3169. "patch": {
  3170. "operationId": "editMilestone",
  3171. "summary": "Edit a milestone",
  3172. "tags": [
  3173. "Issues"
  3174. ],
  3175. "responses": {
  3176. "200": {
  3177. "description": "Success",
  3178. "content": {
  3179. "application/json": {
  3180. "schema": {
  3181. "$ref": "#/components/schemas/Milestone"
  3182. }
  3183. }
  3184. }
  3185. },
  3186. "404": {
  3187. "description": "Resource not found."
  3188. },
  3189. "422": {
  3190. "description": "Validation error."
  3191. }
  3192. },
  3193. "parameters": [
  3194. {
  3195. "name": "owner",
  3196. "in": "path",
  3197. "required": true,
  3198. "schema": {
  3199. "type": "string"
  3200. },
  3201. "description": "Repository owner"
  3202. },
  3203. {
  3204. "name": "repo",
  3205. "in": "path",
  3206. "required": true,
  3207. "schema": {
  3208. "type": "string"
  3209. },
  3210. "description": "Repository name"
  3211. },
  3212. {
  3213. "name": "id",
  3214. "in": "path",
  3215. "required": true,
  3216. "schema": {
  3217. "type": "string"
  3218. },
  3219. "description": "Milestone ID"
  3220. }
  3221. ],
  3222. "requestBody": {
  3223. "required": true,
  3224. "content": {
  3225. "application/json": {
  3226. "schema": {
  3227. "type": "object",
  3228. "properties": {
  3229. "title": {
  3230. "type": "string"
  3231. },
  3232. "description": {
  3233. "type": "string"
  3234. },
  3235. "due_on": {
  3236. "type": "string",
  3237. "format": "date-time"
  3238. },
  3239. "state": {
  3240. "type": "string",
  3241. "enum": [
  3242. "open",
  3243. "closed"
  3244. ]
  3245. }
  3246. }
  3247. }
  3248. }
  3249. }
  3250. }
  3251. },
  3252. "delete": {
  3253. "operationId": "deleteMilestone",
  3254. "summary": "Delete a milestone",
  3255. "tags": [
  3256. "Issues"
  3257. ],
  3258. "responses": {
  3259. "204": {
  3260. "description": "The resource has been successfully deleted."
  3261. },
  3262. "404": {
  3263. "description": "Resource not found."
  3264. }
  3265. },
  3266. "parameters": [
  3267. {
  3268. "name": "owner",
  3269. "in": "path",
  3270. "required": true,
  3271. "schema": {
  3272. "type": "string"
  3273. },
  3274. "description": "Repository owner"
  3275. },
  3276. {
  3277. "name": "repo",
  3278. "in": "path",
  3279. "required": true,
  3280. "schema": {
  3281. "type": "string"
  3282. },
  3283. "description": "Repository name"
  3284. },
  3285. {
  3286. "name": "id",
  3287. "in": "path",
  3288. "required": true,
  3289. "schema": {
  3290. "type": "string"
  3291. },
  3292. "description": "Milestone ID"
  3293. }
  3294. ],
  3295. "description": "Only users with write access to a repository can delete a milestone."
  3296. }
  3297. },
  3298. "/users/search": {
  3299. "get": {
  3300. "operationId": "searchUsers",
  3301. "summary": "Search for users",
  3302. "tags": [
  3303. "Users"
  3304. ],
  3305. "responses": {
  3306. "200": {
  3307. "description": "Success",
  3308. "content": {
  3309. "application/json": {
  3310. "schema": {
  3311. "type": "object",
  3312. "properties": {
  3313. "data": {
  3314. "type": "array",
  3315. "items": {
  3316. "$ref": "#/components/schemas/User"
  3317. }
  3318. },
  3319. "ok": {
  3320. "type": "boolean"
  3321. }
  3322. }
  3323. }
  3324. }
  3325. }
  3326. }
  3327. },
  3328. "parameters": [
  3329. {
  3330. "name": "q",
  3331. "in": "query",
  3332. "required": true,
  3333. "schema": {
  3334. "type": "string"
  3335. },
  3336. "description": "Keyword of username"
  3337. },
  3338. {
  3339. "name": "limit",
  3340. "in": "query",
  3341. "required": false,
  3342. "schema": {
  3343. "type": "integer",
  3344. "default": 10
  3345. },
  3346. "description": "Max results"
  3347. }
  3348. ],
  3349. "description": "Requests without authentication will return an empty email field for anti-spam purposes."
  3350. }
  3351. },
  3352. "/users/{username}": {
  3353. "get": {
  3354. "operationId": "getUser",
  3355. "summary": "Get a single user",
  3356. "tags": [
  3357. "Users"
  3358. ],
  3359. "responses": {
  3360. "200": {
  3361. "description": "Success",
  3362. "content": {
  3363. "application/json": {
  3364. "schema": {
  3365. "$ref": "#/components/schemas/User"
  3366. }
  3367. }
  3368. }
  3369. },
  3370. "404": {
  3371. "description": "Resource not found."
  3372. }
  3373. },
  3374. "parameters": [
  3375. {
  3376. "name": "username",
  3377. "in": "path",
  3378. "required": true,
  3379. "schema": {
  3380. "type": "string"
  3381. },
  3382. "description": "Username"
  3383. }
  3384. ]
  3385. }
  3386. },
  3387. "/user": {
  3388. "get": {
  3389. "operationId": "getAuthenticatedUser",
  3390. "summary": "Get the authenticated user",
  3391. "tags": [
  3392. "Users"
  3393. ],
  3394. "responses": {
  3395. "200": {
  3396. "description": "Success",
  3397. "content": {
  3398. "application/json": {
  3399. "schema": {
  3400. "$ref": "#/components/schemas/User"
  3401. }
  3402. }
  3403. }
  3404. }
  3405. }
  3406. }
  3407. },
  3408. "/users/{username}/tokens": {
  3409. "get": {
  3410. "operationId": "listAccessTokens",
  3411. "summary": "List access tokens",
  3412. "tags": [
  3413. "Users"
  3414. ],
  3415. "responses": {
  3416. "200": {
  3417. "description": "Success",
  3418. "content": {
  3419. "application/json": {
  3420. "schema": {
  3421. "type": "array",
  3422. "items": {
  3423. "$ref": "#/components/schemas/AccessToken"
  3424. }
  3425. }
  3426. }
  3427. }
  3428. },
  3429. "404": {
  3430. "description": "Resource not found."
  3431. }
  3432. },
  3433. "parameters": [
  3434. {
  3435. "name": "username",
  3436. "in": "path",
  3437. "required": true,
  3438. "schema": {
  3439. "type": "string"
  3440. },
  3441. "description": "Username"
  3442. }
  3443. ],
  3444. "security": [
  3445. {
  3446. "BasicAuth": []
  3447. }
  3448. ],
  3449. "description": "Requires basic authentication."
  3450. },
  3451. "post": {
  3452. "operationId": "createAccessToken",
  3453. "summary": "Create an access token",
  3454. "tags": [
  3455. "Users"
  3456. ],
  3457. "responses": {
  3458. "201": {
  3459. "description": "Created",
  3460. "content": {
  3461. "application/json": {
  3462. "schema": {
  3463. "$ref": "#/components/schemas/AccessToken"
  3464. }
  3465. }
  3466. }
  3467. },
  3468. "404": {
  3469. "description": "Resource not found."
  3470. },
  3471. "422": {
  3472. "description": "Validation error."
  3473. }
  3474. },
  3475. "parameters": [
  3476. {
  3477. "name": "username",
  3478. "in": "path",
  3479. "required": true,
  3480. "schema": {
  3481. "type": "string"
  3482. },
  3483. "description": "Username"
  3484. }
  3485. ],
  3486. "requestBody": {
  3487. "required": true,
  3488. "content": {
  3489. "application/json": {
  3490. "schema": {
  3491. "type": "object",
  3492. "properties": {
  3493. "name": {
  3494. "type": "string"
  3495. }
  3496. },
  3497. "required": [
  3498. "name"
  3499. ]
  3500. }
  3501. }
  3502. }
  3503. },
  3504. "security": [
  3505. {
  3506. "BasicAuth": []
  3507. }
  3508. ],
  3509. "description": "Requires basic authentication."
  3510. }
  3511. },
  3512. "/user/emails": {
  3513. "get": {
  3514. "operationId": "listEmails",
  3515. "summary": "List email addresses",
  3516. "tags": [
  3517. "Users"
  3518. ],
  3519. "responses": {
  3520. "200": {
  3521. "description": "Success",
  3522. "content": {
  3523. "application/json": {
  3524. "schema": {
  3525. "type": "array",
  3526. "items": {
  3527. "$ref": "#/components/schemas/Email"
  3528. }
  3529. }
  3530. }
  3531. }
  3532. }
  3533. }
  3534. },
  3535. "post": {
  3536. "operationId": "addEmails",
  3537. "summary": "Add email addresses",
  3538. "tags": [
  3539. "Users"
  3540. ],
  3541. "responses": {
  3542. "200": {
  3543. "description": "Success",
  3544. "content": {
  3545. "application/json": {
  3546. "schema": {
  3547. "type": "array",
  3548. "items": {
  3549. "$ref": "#/components/schemas/Email"
  3550. }
  3551. }
  3552. }
  3553. }
  3554. },
  3555. "422": {
  3556. "description": "Validation error."
  3557. }
  3558. },
  3559. "requestBody": {
  3560. "required": true,
  3561. "content": {
  3562. "application/json": {
  3563. "schema": {
  3564. "type": "object",
  3565. "properties": {
  3566. "emails": {
  3567. "type": "array",
  3568. "items": {
  3569. "type": "string",
  3570. "format": "email"
  3571. }
  3572. }
  3573. },
  3574. "required": [
  3575. "emails"
  3576. ]
  3577. }
  3578. }
  3579. }
  3580. }
  3581. },
  3582. "delete": {
  3583. "operationId": "deleteEmails",
  3584. "summary": "Delete email addresses",
  3585. "tags": [
  3586. "Users"
  3587. ],
  3588. "responses": {
  3589. "204": {
  3590. "description": "The resource has been successfully deleted."
  3591. }
  3592. },
  3593. "requestBody": {
  3594. "required": true,
  3595. "content": {
  3596. "application/json": {
  3597. "schema": {
  3598. "type": "object",
  3599. "properties": {
  3600. "emails": {
  3601. "type": "array",
  3602. "items": {
  3603. "type": "string",
  3604. "format": "email"
  3605. }
  3606. }
  3607. },
  3608. "required": [
  3609. "emails"
  3610. ]
  3611. }
  3612. }
  3613. }
  3614. }
  3615. }
  3616. },
  3617. "/users/{username}/followers": {
  3618. "get": {
  3619. "operationId": "listUserFollowers",
  3620. "summary": "List followers of a user",
  3621. "tags": [
  3622. "Users"
  3623. ],
  3624. "responses": {
  3625. "200": {
  3626. "description": "Success",
  3627. "content": {
  3628. "application/json": {
  3629. "schema": {
  3630. "type": "array",
  3631. "items": {
  3632. "$ref": "#/components/schemas/User"
  3633. }
  3634. }
  3635. }
  3636. }
  3637. },
  3638. "404": {
  3639. "description": "Resource not found."
  3640. }
  3641. },
  3642. "parameters": [
  3643. {
  3644. "name": "username",
  3645. "in": "path",
  3646. "required": true,
  3647. "schema": {
  3648. "type": "string"
  3649. },
  3650. "description": "Username"
  3651. }
  3652. ]
  3653. }
  3654. },
  3655. "/user/followers": {
  3656. "get": {
  3657. "operationId": "listMyFollowers",
  3658. "summary": "List your followers",
  3659. "tags": [
  3660. "Users"
  3661. ],
  3662. "responses": {
  3663. "200": {
  3664. "description": "Success",
  3665. "content": {
  3666. "application/json": {
  3667. "schema": {
  3668. "type": "array",
  3669. "items": {
  3670. "$ref": "#/components/schemas/User"
  3671. }
  3672. }
  3673. }
  3674. }
  3675. }
  3676. }
  3677. }
  3678. },
  3679. "/users/{username}/following": {
  3680. "get": {
  3681. "operationId": "listUserFollowing",
  3682. "summary": "List users followed by a user",
  3683. "tags": [
  3684. "Users"
  3685. ],
  3686. "responses": {
  3687. "200": {
  3688. "description": "Success",
  3689. "content": {
  3690. "application/json": {
  3691. "schema": {
  3692. "type": "array",
  3693. "items": {
  3694. "$ref": "#/components/schemas/User"
  3695. }
  3696. }
  3697. }
  3698. }
  3699. },
  3700. "404": {
  3701. "description": "Resource not found."
  3702. }
  3703. },
  3704. "parameters": [
  3705. {
  3706. "name": "username",
  3707. "in": "path",
  3708. "required": true,
  3709. "schema": {
  3710. "type": "string"
  3711. },
  3712. "description": "Username"
  3713. }
  3714. ]
  3715. }
  3716. },
  3717. "/user/following": {
  3718. "get": {
  3719. "operationId": "listMyFollowing",
  3720. "summary": "List who you are following",
  3721. "tags": [
  3722. "Users"
  3723. ],
  3724. "responses": {
  3725. "200": {
  3726. "description": "Success",
  3727. "content": {
  3728. "application/json": {
  3729. "schema": {
  3730. "type": "array",
  3731. "items": {
  3732. "$ref": "#/components/schemas/User"
  3733. }
  3734. }
  3735. }
  3736. }
  3737. }
  3738. }
  3739. }
  3740. },
  3741. "/user/following/{target}": {
  3742. "get": {
  3743. "operationId": "checkFollowing",
  3744. "summary": "Check if you follow a user",
  3745. "tags": [
  3746. "Users"
  3747. ],
  3748. "responses": {
  3749. "204": {
  3750. "description": "The user is being followed."
  3751. },
  3752. "404": {
  3753. "description": "Not following"
  3754. }
  3755. },
  3756. "parameters": [
  3757. {
  3758. "name": "target",
  3759. "in": "path",
  3760. "required": true,
  3761. "schema": {
  3762. "type": "string"
  3763. },
  3764. "description": "Target username"
  3765. }
  3766. ]
  3767. },
  3768. "put": {
  3769. "operationId": "followUser",
  3770. "summary": "Follow a user",
  3771. "tags": [
  3772. "Users"
  3773. ],
  3774. "responses": {
  3775. "204": {
  3776. "description": "Successfully followed the user."
  3777. },
  3778. "404": {
  3779. "description": "Resource not found."
  3780. },
  3781. "422": {
  3782. "description": "Validation error."
  3783. }
  3784. },
  3785. "parameters": [
  3786. {
  3787. "name": "target",
  3788. "in": "path",
  3789. "required": true,
  3790. "schema": {
  3791. "type": "string"
  3792. },
  3793. "description": "Target username"
  3794. }
  3795. ]
  3796. },
  3797. "delete": {
  3798. "operationId": "unfollowUser",
  3799. "summary": "Unfollow a user",
  3800. "tags": [
  3801. "Users"
  3802. ],
  3803. "responses": {
  3804. "204": {
  3805. "description": "The resource has been successfully deleted."
  3806. },
  3807. "404": {
  3808. "description": "Resource not found."
  3809. }
  3810. },
  3811. "parameters": [
  3812. {
  3813. "name": "target",
  3814. "in": "path",
  3815. "required": true,
  3816. "schema": {
  3817. "type": "string"
  3818. },
  3819. "description": "Target username"
  3820. }
  3821. ]
  3822. }
  3823. },
  3824. "/users/{username}/following/{target}": {
  3825. "get": {
  3826. "operationId": "checkUserFollowing",
  3827. "summary": "Check if a user follows another",
  3828. "tags": [
  3829. "Users"
  3830. ],
  3831. "responses": {
  3832. "204": {
  3833. "description": "The user is being followed."
  3834. },
  3835. "404": {
  3836. "description": "Not following"
  3837. }
  3838. },
  3839. "parameters": [
  3840. {
  3841. "name": "username",
  3842. "in": "path",
  3843. "required": true,
  3844. "schema": {
  3845. "type": "string"
  3846. },
  3847. "description": "Username"
  3848. },
  3849. {
  3850. "name": "target",
  3851. "in": "path",
  3852. "required": true,
  3853. "schema": {
  3854. "type": "string"
  3855. },
  3856. "description": "Target username"
  3857. }
  3858. ]
  3859. }
  3860. },
  3861. "/users/{username}/keys": {
  3862. "get": {
  3863. "operationId": "listUserKeys",
  3864. "summary": "List public keys for a user",
  3865. "tags": [
  3866. "Users"
  3867. ],
  3868. "responses": {
  3869. "200": {
  3870. "description": "Success",
  3871. "content": {
  3872. "application/json": {
  3873. "schema": {
  3874. "type": "array",
  3875. "items": {
  3876. "$ref": "#/components/schemas/PublicKey"
  3877. }
  3878. }
  3879. }
  3880. }
  3881. },
  3882. "404": {
  3883. "description": "Resource not found."
  3884. }
  3885. },
  3886. "parameters": [
  3887. {
  3888. "name": "username",
  3889. "in": "path",
  3890. "required": true,
  3891. "schema": {
  3892. "type": "string"
  3893. },
  3894. "description": "Username"
  3895. }
  3896. ]
  3897. }
  3898. },
  3899. "/user/keys/{id}": {
  3900. "get": {
  3901. "operationId": "getPublicKey",
  3902. "summary": "Get a single public key",
  3903. "tags": [
  3904. "Users"
  3905. ],
  3906. "responses": {
  3907. "200": {
  3908. "description": "Success",
  3909. "content": {
  3910. "application/json": {
  3911. "schema": {
  3912. "$ref": "#/components/schemas/PublicKey"
  3913. }
  3914. }
  3915. }
  3916. },
  3917. "404": {
  3918. "description": "Resource not found."
  3919. }
  3920. },
  3921. "parameters": [
  3922. {
  3923. "name": "id",
  3924. "in": "path",
  3925. "required": true,
  3926. "schema": {
  3927. "type": "string"
  3928. },
  3929. "description": "Key ID"
  3930. }
  3931. ]
  3932. },
  3933. "delete": {
  3934. "operationId": "deletePublicKey",
  3935. "summary": "Delete a public key",
  3936. "tags": [
  3937. "Users"
  3938. ],
  3939. "responses": {
  3940. "204": {
  3941. "description": "The resource has been successfully deleted."
  3942. },
  3943. "404": {
  3944. "description": "Resource not found."
  3945. }
  3946. },
  3947. "parameters": [
  3948. {
  3949. "name": "id",
  3950. "in": "path",
  3951. "required": true,
  3952. "schema": {
  3953. "type": "string"
  3954. },
  3955. "description": "Key ID"
  3956. }
  3957. ]
  3958. }
  3959. },
  3960. "/user/keys": {
  3961. "get": {
  3962. "operationId": "listMyKeys",
  3963. "summary": "List your public keys",
  3964. "tags": [
  3965. "Users"
  3966. ],
  3967. "responses": {
  3968. "200": {
  3969. "description": "Success",
  3970. "content": {
  3971. "application/json": {
  3972. "schema": {
  3973. "type": "array",
  3974. "items": {
  3975. "$ref": "#/components/schemas/PublicKey"
  3976. }
  3977. }
  3978. }
  3979. }
  3980. }
  3981. }
  3982. },
  3983. "post": {
  3984. "operationId": "createPublicKey",
  3985. "summary": "Create a public key",
  3986. "tags": [
  3987. "Users"
  3988. ],
  3989. "responses": {
  3990. "201": {
  3991. "description": "Created",
  3992. "content": {
  3993. "application/json": {
  3994. "schema": {
  3995. "$ref": "#/components/schemas/PublicKey"
  3996. }
  3997. }
  3998. }
  3999. },
  4000. "422": {
  4001. "description": "Validation error."
  4002. }
  4003. },
  4004. "requestBody": {
  4005. "required": true,
  4006. "content": {
  4007. "application/json": {
  4008. "schema": {
  4009. "type": "object",
  4010. "properties": {
  4011. "title": {
  4012. "type": "string"
  4013. },
  4014. "key": {
  4015. "type": "string"
  4016. }
  4017. },
  4018. "required": [
  4019. "title",
  4020. "key"
  4021. ]
  4022. }
  4023. }
  4024. }
  4025. }
  4026. }
  4027. },
  4028. "/user/orgs": {
  4029. "get": {
  4030. "operationId": "listMyOrgs",
  4031. "summary": "List your organizations",
  4032. "tags": [
  4033. "Organizations"
  4034. ],
  4035. "responses": {
  4036. "200": {
  4037. "description": "Success",
  4038. "content": {
  4039. "application/json": {
  4040. "schema": {
  4041. "type": "array",
  4042. "items": {
  4043. "$ref": "#/components/schemas/Organization"
  4044. }
  4045. }
  4046. }
  4047. }
  4048. }
  4049. }
  4050. },
  4051. "post": {
  4052. "operationId": "createMyOrg",
  4053. "summary": "Create an organization",
  4054. "description": "Creates an organization for the authenticated user.",
  4055. "tags": [
  4056. "Organizations"
  4057. ],
  4058. "requestBody": {
  4059. "required": true,
  4060. "content": {
  4061. "application/json": {
  4062. "schema": {
  4063. "type": "object",
  4064. "properties": {
  4065. "username": {
  4066. "type": "string"
  4067. },
  4068. "full_name": {
  4069. "type": "string"
  4070. },
  4071. "description": {
  4072. "type": "string"
  4073. },
  4074. "website": {
  4075. "type": "string"
  4076. },
  4077. "location": {
  4078. "type": "string"
  4079. }
  4080. },
  4081. "required": [
  4082. "username"
  4083. ]
  4084. }
  4085. }
  4086. }
  4087. },
  4088. "responses": {
  4089. "201": {
  4090. "description": "Organization created successfully.",
  4091. "content": {
  4092. "application/json": {
  4093. "schema": {
  4094. "$ref": "#/components/schemas/Organization"
  4095. }
  4096. }
  4097. }
  4098. },
  4099. "422": {
  4100. "description": "Organization name already exists or is not allowed."
  4101. }
  4102. }
  4103. }
  4104. },
  4105. "/users/{username}/orgs": {
  4106. "get": {
  4107. "operationId": "listUserOrgs",
  4108. "summary": "List user organizations",
  4109. "tags": [
  4110. "Organizations"
  4111. ],
  4112. "responses": {
  4113. "200": {
  4114. "description": "Success",
  4115. "content": {
  4116. "application/json": {
  4117. "schema": {
  4118. "type": "array",
  4119. "items": {
  4120. "$ref": "#/components/schemas/Organization"
  4121. }
  4122. }
  4123. }
  4124. }
  4125. },
  4126. "404": {
  4127. "description": "Resource not found."
  4128. }
  4129. },
  4130. "parameters": [
  4131. {
  4132. "name": "username",
  4133. "in": "path",
  4134. "required": true,
  4135. "schema": {
  4136. "type": "string"
  4137. },
  4138. "description": "Username"
  4139. }
  4140. ]
  4141. }
  4142. },
  4143. "/orgs/{orgname}": {
  4144. "get": {
  4145. "operationId": "getOrg",
  4146. "summary": "Get an organization",
  4147. "tags": [
  4148. "Organizations"
  4149. ],
  4150. "responses": {
  4151. "200": {
  4152. "description": "Success",
  4153. "content": {
  4154. "application/json": {
  4155. "schema": {
  4156. "$ref": "#/components/schemas/Organization"
  4157. }
  4158. }
  4159. }
  4160. },
  4161. "404": {
  4162. "description": "Resource not found."
  4163. }
  4164. },
  4165. "parameters": [
  4166. {
  4167. "name": "orgname",
  4168. "in": "path",
  4169. "required": true,
  4170. "schema": {
  4171. "type": "string"
  4172. },
  4173. "description": "Organization name"
  4174. }
  4175. ]
  4176. },
  4177. "patch": {
  4178. "operationId": "editOrg",
  4179. "summary": "Edit an organization",
  4180. "tags": [
  4181. "Organizations"
  4182. ],
  4183. "responses": {
  4184. "200": {
  4185. "description": "Success",
  4186. "content": {
  4187. "application/json": {
  4188. "schema": {
  4189. "$ref": "#/components/schemas/Organization"
  4190. }
  4191. }
  4192. }
  4193. },
  4194. "404": {
  4195. "description": "Resource not found."
  4196. },
  4197. "422": {
  4198. "description": "Validation error."
  4199. }
  4200. },
  4201. "parameters": [
  4202. {
  4203. "name": "orgname",
  4204. "in": "path",
  4205. "required": true,
  4206. "schema": {
  4207. "type": "string"
  4208. },
  4209. "description": "Organization name"
  4210. }
  4211. ],
  4212. "requestBody": {
  4213. "required": true,
  4214. "content": {
  4215. "application/json": {
  4216. "schema": {
  4217. "type": "object",
  4218. "properties": {
  4219. "full_name": {
  4220. "type": "string"
  4221. },
  4222. "description": {
  4223. "type": "string"
  4224. },
  4225. "website": {
  4226. "type": "string"
  4227. },
  4228. "location": {
  4229. "type": "string"
  4230. }
  4231. }
  4232. }
  4233. }
  4234. }
  4235. }
  4236. }
  4237. },
  4238. "/orgs/{orgname}/teams": {
  4239. "get": {
  4240. "operationId": "listOrgTeams",
  4241. "summary": "List teams of an organization",
  4242. "tags": [
  4243. "Organizations"
  4244. ],
  4245. "responses": {
  4246. "200": {
  4247. "description": "Success",
  4248. "content": {
  4249. "application/json": {
  4250. "schema": {
  4251. "type": "array",
  4252. "items": {
  4253. "$ref": "#/components/schemas/Team"
  4254. }
  4255. }
  4256. }
  4257. }
  4258. },
  4259. "404": {
  4260. "description": "Resource not found."
  4261. }
  4262. },
  4263. "parameters": [
  4264. {
  4265. "name": "orgname",
  4266. "in": "path",
  4267. "required": true,
  4268. "schema": {
  4269. "type": "string"
  4270. },
  4271. "description": "Organization name"
  4272. }
  4273. ]
  4274. }
  4275. },
  4276. "/admin/users": {
  4277. "post": {
  4278. "operationId": "adminCreateUser",
  4279. "summary": "Create a new user",
  4280. "tags": [
  4281. "Administration"
  4282. ],
  4283. "responses": {
  4284. "201": {
  4285. "description": "Created",
  4286. "content": {
  4287. "application/json": {
  4288. "schema": {
  4289. "$ref": "#/components/schemas/User"
  4290. }
  4291. }
  4292. }
  4293. },
  4294. "422": {
  4295. "description": "Validation error."
  4296. }
  4297. },
  4298. "requestBody": {
  4299. "required": true,
  4300. "content": {
  4301. "application/json": {
  4302. "schema": {
  4303. "type": "object",
  4304. "properties": {
  4305. "source_id": {
  4306. "type": "integer"
  4307. },
  4308. "login_name": {
  4309. "type": "string"
  4310. },
  4311. "username": {
  4312. "type": "string"
  4313. },
  4314. "full_name": {
  4315. "type": "string"
  4316. },
  4317. "email": {
  4318. "type": "string",
  4319. "format": "email"
  4320. },
  4321. "password": {
  4322. "type": "string"
  4323. },
  4324. "send_notify": {
  4325. "type": "boolean"
  4326. }
  4327. },
  4328. "required": [
  4329. "username",
  4330. "email"
  4331. ]
  4332. }
  4333. }
  4334. }
  4335. },
  4336. "description": "Requires the authenticated user to be a site administrator."
  4337. }
  4338. },
  4339. "/admin/users/{username}": {
  4340. "patch": {
  4341. "operationId": "adminEditUser",
  4342. "summary": "Edit an existing user",
  4343. "tags": [
  4344. "Administration"
  4345. ],
  4346. "responses": {
  4347. "200": {
  4348. "description": "Success",
  4349. "content": {
  4350. "application/json": {
  4351. "schema": {
  4352. "$ref": "#/components/schemas/User"
  4353. }
  4354. }
  4355. }
  4356. },
  4357. "404": {
  4358. "description": "Resource not found."
  4359. },
  4360. "422": {
  4361. "description": "Validation error."
  4362. }
  4363. },
  4364. "parameters": [
  4365. {
  4366. "name": "username",
  4367. "in": "path",
  4368. "required": true,
  4369. "schema": {
  4370. "type": "string"
  4371. },
  4372. "description": "Username"
  4373. }
  4374. ],
  4375. "requestBody": {
  4376. "required": true,
  4377. "content": {
  4378. "application/json": {
  4379. "schema": {
  4380. "type": "object",
  4381. "properties": {
  4382. "source_id": {
  4383. "type": "integer"
  4384. },
  4385. "login_name": {
  4386. "type": "string"
  4387. },
  4388. "full_name": {
  4389. "type": "string"
  4390. },
  4391. "email": {
  4392. "type": "string",
  4393. "format": "email"
  4394. },
  4395. "password": {
  4396. "type": "string"
  4397. },
  4398. "website": {
  4399. "type": "string"
  4400. },
  4401. "location": {
  4402. "type": "string"
  4403. },
  4404. "active": {
  4405. "type": "boolean"
  4406. },
  4407. "admin": {
  4408. "type": "boolean"
  4409. },
  4410. "allow_git_hook": {
  4411. "type": "boolean"
  4412. },
  4413. "allow_import_local": {
  4414. "type": "boolean"
  4415. },
  4416. "max_repo_creation": {
  4417. "type": "integer",
  4418. "description": "Maximum number of repositories the user can create. -1 means no limit."
  4419. }
  4420. },
  4421. "required": [
  4422. "email"
  4423. ]
  4424. }
  4425. }
  4426. }
  4427. },
  4428. "description": "Requires the authenticated user to be a site administrator."
  4429. },
  4430. "delete": {
  4431. "operationId": "adminDeleteUser",
  4432. "summary": "Delete a user",
  4433. "tags": [
  4434. "Administration"
  4435. ],
  4436. "responses": {
  4437. "204": {
  4438. "description": "The resource has been successfully deleted."
  4439. },
  4440. "404": {
  4441. "description": "Resource not found."
  4442. }
  4443. },
  4444. "parameters": [
  4445. {
  4446. "name": "username",
  4447. "in": "path",
  4448. "required": true,
  4449. "schema": {
  4450. "type": "string"
  4451. },
  4452. "description": "Username"
  4453. }
  4454. ],
  4455. "description": "Requires the authenticated user to be a site administrator."
  4456. }
  4457. },
  4458. "/admin/users/{username}/keys": {
  4459. "post": {
  4460. "operationId": "adminCreateUserKey",
  4461. "summary": "Create a public key for a user",
  4462. "tags": [
  4463. "Administration"
  4464. ],
  4465. "responses": {
  4466. "201": {
  4467. "description": "Created",
  4468. "content": {
  4469. "application/json": {
  4470. "schema": {
  4471. "$ref": "#/components/schemas/PublicKey"
  4472. }
  4473. }
  4474. }
  4475. },
  4476. "404": {
  4477. "description": "Resource not found."
  4478. },
  4479. "422": {
  4480. "description": "Validation error."
  4481. }
  4482. },
  4483. "parameters": [
  4484. {
  4485. "name": "username",
  4486. "in": "path",
  4487. "required": true,
  4488. "schema": {
  4489. "type": "string"
  4490. },
  4491. "description": "Username"
  4492. }
  4493. ],
  4494. "requestBody": {
  4495. "required": true,
  4496. "content": {
  4497. "application/json": {
  4498. "schema": {
  4499. "type": "object",
  4500. "properties": {
  4501. "title": {
  4502. "type": "string"
  4503. },
  4504. "key": {
  4505. "type": "string"
  4506. }
  4507. },
  4508. "required": [
  4509. "title",
  4510. "key"
  4511. ]
  4512. }
  4513. }
  4514. }
  4515. },
  4516. "description": "Requires the authenticated user to be a site administrator."
  4517. }
  4518. },
  4519. "/admin/users/{username}/repos": {
  4520. "post": {
  4521. "operationId": "adminCreateRepo",
  4522. "summary": "Create a repository for a user",
  4523. "tags": [
  4524. "Administration"
  4525. ],
  4526. "responses": {
  4527. "201": {
  4528. "description": "Created",
  4529. "content": {
  4530. "application/json": {
  4531. "schema": {
  4532. "$ref": "#/components/schemas/Repository"
  4533. }
  4534. }
  4535. }
  4536. },
  4537. "404": {
  4538. "description": "Resource not found."
  4539. },
  4540. "422": {
  4541. "description": "Validation error."
  4542. }
  4543. },
  4544. "parameters": [
  4545. {
  4546. "name": "username",
  4547. "in": "path",
  4548. "required": true,
  4549. "schema": {
  4550. "type": "string"
  4551. },
  4552. "description": "Username"
  4553. }
  4554. ],
  4555. "requestBody": {
  4556. "required": true,
  4557. "content": {
  4558. "application/json": {
  4559. "schema": {
  4560. "type": "object",
  4561. "properties": {
  4562. "name": {
  4563. "type": "string"
  4564. },
  4565. "description": {
  4566. "type": "string"
  4567. },
  4568. "private": {
  4569. "type": "boolean",
  4570. "default": false
  4571. },
  4572. "auto_init": {
  4573. "type": "boolean",
  4574. "default": false
  4575. },
  4576. "gitignores": {
  4577. "type": "string"
  4578. },
  4579. "license": {
  4580. "type": "string"
  4581. },
  4582. "readme": {
  4583. "type": "string",
  4584. "default": "Default"
  4585. }
  4586. },
  4587. "required": [
  4588. "name"
  4589. ]
  4590. }
  4591. }
  4592. }
  4593. },
  4594. "description": "Requires the authenticated user to be a site administrator."
  4595. }
  4596. },
  4597. "/admin/users/{username}/orgs": {
  4598. "post": {
  4599. "operationId": "adminCreateOrg",
  4600. "summary": "Create an organization",
  4601. "tags": [
  4602. "Administration"
  4603. ],
  4604. "responses": {
  4605. "201": {
  4606. "description": "Created",
  4607. "content": {
  4608. "application/json": {
  4609. "schema": {
  4610. "$ref": "#/components/schemas/Organization"
  4611. }
  4612. }
  4613. }
  4614. },
  4615. "404": {
  4616. "description": "Resource not found."
  4617. },
  4618. "422": {
  4619. "description": "Validation error."
  4620. }
  4621. },
  4622. "parameters": [
  4623. {
  4624. "name": "username",
  4625. "in": "path",
  4626. "required": true,
  4627. "schema": {
  4628. "type": "string"
  4629. },
  4630. "description": "Username"
  4631. }
  4632. ],
  4633. "requestBody": {
  4634. "required": true,
  4635. "content": {
  4636. "application/json": {
  4637. "schema": {
  4638. "type": "object",
  4639. "properties": {
  4640. "username": {
  4641. "type": "string"
  4642. },
  4643. "full_name": {
  4644. "type": "string"
  4645. },
  4646. "description": {
  4647. "type": "string"
  4648. },
  4649. "website": {
  4650. "type": "string"
  4651. },
  4652. "location": {
  4653. "type": "string"
  4654. }
  4655. },
  4656. "required": [
  4657. "username"
  4658. ]
  4659. }
  4660. }
  4661. }
  4662. },
  4663. "description": "Requires the authenticated user to be a site administrator."
  4664. }
  4665. },
  4666. "/admin/orgs/{orgname}/teams": {
  4667. "post": {
  4668. "operationId": "adminCreateTeam",
  4669. "summary": "Create a team",
  4670. "tags": [
  4671. "Administration"
  4672. ],
  4673. "responses": {
  4674. "201": {
  4675. "description": "Created",
  4676. "content": {
  4677. "application/json": {
  4678. "schema": {
  4679. "$ref": "#/components/schemas/Team"
  4680. }
  4681. }
  4682. }
  4683. },
  4684. "404": {
  4685. "description": "Resource not found."
  4686. },
  4687. "422": {
  4688. "description": "Validation error."
  4689. }
  4690. },
  4691. "parameters": [
  4692. {
  4693. "name": "orgname",
  4694. "in": "path",
  4695. "required": true,
  4696. "schema": {
  4697. "type": "string"
  4698. },
  4699. "description": "Organization name"
  4700. }
  4701. ],
  4702. "requestBody": {
  4703. "required": true,
  4704. "content": {
  4705. "application/json": {
  4706. "schema": {
  4707. "type": "object",
  4708. "properties": {
  4709. "name": {
  4710. "type": "string"
  4711. },
  4712. "description": {
  4713. "type": "string"
  4714. },
  4715. "permission": {
  4716. "type": "string",
  4717. "enum": [
  4718. "read",
  4719. "write",
  4720. "admin"
  4721. ],
  4722. "default": "read"
  4723. }
  4724. },
  4725. "required": [
  4726. "name"
  4727. ]
  4728. }
  4729. }
  4730. }
  4731. },
  4732. "description": "Requires the authenticated user to be a site administrator."
  4733. }
  4734. },
  4735. "/admin/teams/{teamid}/members": {
  4736. "get": {
  4737. "operationId": "adminListTeamMembers",
  4738. "summary": "List all members of a team",
  4739. "tags": [
  4740. "Administration"
  4741. ],
  4742. "responses": {
  4743. "200": {
  4744. "description": "Success",
  4745. "content": {
  4746. "application/json": {
  4747. "schema": {
  4748. "type": "array",
  4749. "items": {
  4750. "$ref": "#/components/schemas/User"
  4751. }
  4752. }
  4753. }
  4754. }
  4755. },
  4756. "404": {
  4757. "description": "Resource not found."
  4758. }
  4759. },
  4760. "parameters": [
  4761. {
  4762. "name": "teamid",
  4763. "in": "path",
  4764. "required": true,
  4765. "schema": {
  4766. "type": "string"
  4767. },
  4768. "description": "Team ID"
  4769. }
  4770. ],
  4771. "description": "Requires the authenticated user to be a site administrator."
  4772. }
  4773. },
  4774. "/admin/teams/{teamid}/members/{username}": {
  4775. "put": {
  4776. "operationId": "adminAddTeamMember",
  4777. "summary": "Add team membership",
  4778. "tags": [
  4779. "Administration"
  4780. ],
  4781. "responses": {
  4782. "204": {
  4783. "description": "Team membership has been updated."
  4784. },
  4785. "404": {
  4786. "description": "Resource not found."
  4787. },
  4788. "422": {
  4789. "description": "Validation error."
  4790. }
  4791. },
  4792. "parameters": [
  4793. {
  4794. "name": "teamid",
  4795. "in": "path",
  4796. "required": true,
  4797. "schema": {
  4798. "type": "string"
  4799. },
  4800. "description": "Team ID"
  4801. },
  4802. {
  4803. "name": "username",
  4804. "in": "path",
  4805. "required": true,
  4806. "schema": {
  4807. "type": "string"
  4808. },
  4809. "description": "Username"
  4810. }
  4811. ],
  4812. "description": "Requires the authenticated user to be a site administrator."
  4813. },
  4814. "delete": {
  4815. "operationId": "adminRemoveTeamMember",
  4816. "summary": "Remove team membership",
  4817. "tags": [
  4818. "Administration"
  4819. ],
  4820. "responses": {
  4821. "204": {
  4822. "description": "The resource has been successfully deleted."
  4823. },
  4824. "404": {
  4825. "description": "Resource not found."
  4826. }
  4827. },
  4828. "parameters": [
  4829. {
  4830. "name": "teamid",
  4831. "in": "path",
  4832. "required": true,
  4833. "schema": {
  4834. "type": "string"
  4835. },
  4836. "description": "Team ID"
  4837. },
  4838. {
  4839. "name": "username",
  4840. "in": "path",
  4841. "required": true,
  4842. "schema": {
  4843. "type": "string"
  4844. },
  4845. "description": "Username"
  4846. }
  4847. ],
  4848. "description": "Requires the authenticated user to be a site administrator."
  4849. }
  4850. },
  4851. "/admin/teams/{teamid}/repos/{reponame}": {
  4852. "put": {
  4853. "operationId": "adminAddTeamRepo",
  4854. "summary": "Add or update team repository",
  4855. "tags": [
  4856. "Administration"
  4857. ],
  4858. "responses": {
  4859. "204": {
  4860. "description": "Team repository has been updated."
  4861. },
  4862. "404": {
  4863. "description": "Resource not found."
  4864. },
  4865. "422": {
  4866. "description": "Validation error."
  4867. }
  4868. },
  4869. "parameters": [
  4870. {
  4871. "name": "teamid",
  4872. "in": "path",
  4873. "required": true,
  4874. "schema": {
  4875. "type": "string"
  4876. },
  4877. "description": "Team ID"
  4878. },
  4879. {
  4880. "name": "reponame",
  4881. "in": "path",
  4882. "required": true,
  4883. "schema": {
  4884. "type": "string"
  4885. },
  4886. "description": "Repository name"
  4887. }
  4888. ],
  4889. "description": "Requires the authenticated user to be a site administrator."
  4890. },
  4891. "delete": {
  4892. "operationId": "adminRemoveTeamRepo",
  4893. "summary": "Remove team repository",
  4894. "tags": [
  4895. "Administration"
  4896. ],
  4897. "responses": {
  4898. "204": {
  4899. "description": "The resource has been successfully deleted."
  4900. },
  4901. "404": {
  4902. "description": "Resource not found."
  4903. }
  4904. },
  4905. "parameters": [
  4906. {
  4907. "name": "teamid",
  4908. "in": "path",
  4909. "required": true,
  4910. "schema": {
  4911. "type": "string"
  4912. },
  4913. "description": "Team ID"
  4914. },
  4915. {
  4916. "name": "reponame",
  4917. "in": "path",
  4918. "required": true,
  4919. "schema": {
  4920. "type": "string"
  4921. },
  4922. "description": "Repository name"
  4923. }
  4924. ],
  4925. "description": "Requires the authenticated user to be a site administrator."
  4926. }
  4927. },
  4928. "/markdown": {
  4929. "post": {
  4930. "operationId": "renderMarkdown",
  4931. "summary": "Render a Markdown document",
  4932. "tags": [
  4933. "Miscellaneous"
  4934. ],
  4935. "responses": {
  4936. "200": {
  4937. "description": "Rendered HTML",
  4938. "content": {
  4939. "text/html": {
  4940. "schema": {
  4941. "type": "string"
  4942. }
  4943. }
  4944. }
  4945. },
  4946. "422": {
  4947. "description": "Validation error."
  4948. }
  4949. },
  4950. "requestBody": {
  4951. "required": true,
  4952. "content": {
  4953. "application/json": {
  4954. "schema": {
  4955. "type": "object",
  4956. "properties": {
  4957. "text": {
  4958. "type": "string"
  4959. },
  4960. "context": {
  4961. "type": "string",
  4962. "description": "Repository context URL"
  4963. }
  4964. },
  4965. "required": [
  4966. "text"
  4967. ]
  4968. }
  4969. }
  4970. }
  4971. }
  4972. }
  4973. },
  4974. "/markdown/raw": {
  4975. "post": {
  4976. "operationId": "renderMarkdownRaw",
  4977. "summary": "Render a Markdown document in raw mode",
  4978. "tags": [
  4979. "Miscellaneous"
  4980. ],
  4981. "responses": {
  4982. "200": {
  4983. "description": "Rendered HTML",
  4984. "content": {
  4985. "text/html": {
  4986. "schema": {
  4987. "type": "string"
  4988. }
  4989. }
  4990. }
  4991. },
  4992. "422": {
  4993. "description": "Validation error."
  4994. }
  4995. },
  4996. "requestBody": {
  4997. "required": true,
  4998. "content": {
  4999. "text/plain": {
  5000. "schema": {
  5001. "type": "string"
  5002. }
  5003. }
  5004. }
  5005. },
  5006. "description": "Takes a Markdown document as plaintext and renders it without a repository context."
  5007. }
  5008. },
  5009. "/repos/{owner}/{repo}/git/trees/{sha}": {
  5010. "get": {
  5011. "operationId": "getTree",
  5012. "summary": "Get a tree",
  5013. "tags": [
  5014. "Miscellaneous"
  5015. ],
  5016. "responses": {
  5017. "200": {
  5018. "description": "Success",
  5019. "content": {
  5020. "application/json": {
  5021. "schema": {
  5022. "$ref": "#/components/schemas/GitTree"
  5023. }
  5024. }
  5025. }
  5026. },
  5027. "404": {
  5028. "description": "Resource not found."
  5029. }
  5030. },
  5031. "parameters": [
  5032. {
  5033. "name": "owner",
  5034. "in": "path",
  5035. "required": true,
  5036. "schema": {
  5037. "type": "string"
  5038. },
  5039. "description": "Repository owner"
  5040. },
  5041. {
  5042. "name": "repo",
  5043. "in": "path",
  5044. "required": true,
  5045. "schema": {
  5046. "type": "string"
  5047. },
  5048. "description": "Repository name"
  5049. },
  5050. {
  5051. "name": "sha",
  5052. "in": "path",
  5053. "required": true,
  5054. "schema": {
  5055. "type": "string"
  5056. },
  5057. "description": "Tree SHA"
  5058. }
  5059. ]
  5060. }
  5061. },
  5062. "/repos/{owner}/{repo}/forks": {
  5063. "get": {
  5064. "operationId": "listForks",
  5065. "summary": "List forks",
  5066. "tags": [
  5067. "Repositories"
  5068. ],
  5069. "parameters": [
  5070. {
  5071. "name": "owner",
  5072. "in": "path",
  5073. "required": true,
  5074. "schema": {
  5075. "type": "string"
  5076. },
  5077. "description": "Owner of the repository"
  5078. },
  5079. {
  5080. "name": "repo",
  5081. "in": "path",
  5082. "required": true,
  5083. "schema": {
  5084. "type": "string"
  5085. },
  5086. "description": "Name of the repository"
  5087. }
  5088. ],
  5089. "responses": {
  5090. "200": {
  5091. "description": "Success",
  5092. "content": {
  5093. "application/json": {
  5094. "schema": {
  5095. "type": "array",
  5096. "items": {
  5097. "$ref": "#/components/schemas/Repository"
  5098. }
  5099. }
  5100. }
  5101. }
  5102. },
  5103. "404": {
  5104. "description": "Repository not found."
  5105. }
  5106. }
  5107. }
  5108. },
  5109. "/repos/{owner}/{repo}/tags": {
  5110. "get": {
  5111. "operationId": "listTags",
  5112. "summary": "List tags",
  5113. "tags": [
  5114. "Repositories"
  5115. ],
  5116. "parameters": [
  5117. {
  5118. "name": "owner",
  5119. "in": "path",
  5120. "required": true,
  5121. "schema": {
  5122. "type": "string"
  5123. },
  5124. "description": "Owner of the repository"
  5125. },
  5126. {
  5127. "name": "repo",
  5128. "in": "path",
  5129. "required": true,
  5130. "schema": {
  5131. "type": "string"
  5132. },
  5133. "description": "Name of the repository"
  5134. }
  5135. ],
  5136. "responses": {
  5137. "200": {
  5138. "description": "Success",
  5139. "content": {
  5140. "application/json": {
  5141. "schema": {
  5142. "type": "array",
  5143. "items": {
  5144. "$ref": "#/components/schemas/Tag"
  5145. }
  5146. }
  5147. }
  5148. }
  5149. },
  5150. "404": {
  5151. "description": "Repository not found."
  5152. }
  5153. }
  5154. }
  5155. },
  5156. "/repos/{owner}/{repo}/commits": {
  5157. "get": {
  5158. "operationId": "getAllCommits",
  5159. "summary": "List all commits",
  5160. "description": "Returns commits from the HEAD of the default branch.",
  5161. "tags": [
  5162. "Repositories"
  5163. ],
  5164. "parameters": [
  5165. {
  5166. "name": "owner",
  5167. "in": "path",
  5168. "required": true,
  5169. "schema": {
  5170. "type": "string"
  5171. },
  5172. "description": "Owner of the repository"
  5173. },
  5174. {
  5175. "name": "repo",
  5176. "in": "path",
  5177. "required": true,
  5178. "schema": {
  5179. "type": "string"
  5180. },
  5181. "description": "Name of the repository"
  5182. },
  5183. {
  5184. "name": "pageSize",
  5185. "in": "query",
  5186. "required": false,
  5187. "schema": {
  5188. "type": "integer",
  5189. "default": 30
  5190. },
  5191. "description": "Number of commits to return"
  5192. }
  5193. ],
  5194. "responses": {
  5195. "200": {
  5196. "description": "Success",
  5197. "content": {
  5198. "application/json": {
  5199. "schema": {
  5200. "type": "array",
  5201. "items": {
  5202. "$ref": "#/components/schemas/Commit"
  5203. }
  5204. }
  5205. }
  5206. }
  5207. },
  5208. "404": {
  5209. "description": "Repository not found."
  5210. }
  5211. }
  5212. }
  5213. },
  5214. "/repos/{owner}/{repo}/wiki": {
  5215. "patch": {
  5216. "operationId": "editWiki",
  5217. "summary": "Edit wiki settings",
  5218. "tags": [
  5219. "Repositories"
  5220. ],
  5221. "parameters": [
  5222. {
  5223. "name": "owner",
  5224. "in": "path",
  5225. "required": true,
  5226. "schema": {
  5227. "type": "string"
  5228. },
  5229. "description": "Owner of the repository"
  5230. },
  5231. {
  5232. "name": "repo",
  5233. "in": "path",
  5234. "required": true,
  5235. "schema": {
  5236. "type": "string"
  5237. },
  5238. "description": "Name of the repository"
  5239. }
  5240. ],
  5241. "requestBody": {
  5242. "required": true,
  5243. "content": {
  5244. "application/json": {
  5245. "schema": {
  5246. "type": "object",
  5247. "properties": {
  5248. "enable_wiki": {
  5249. "type": "boolean",
  5250. "description": "Whether to enable the wiki"
  5251. },
  5252. "allow_public_wiki": {
  5253. "type": "boolean",
  5254. "description": "Whether the wiki is publicly accessible"
  5255. },
  5256. "enable_external_wiki": {
  5257. "type": "boolean",
  5258. "description": "Whether to use an external wiki"
  5259. },
  5260. "external_wiki_url": {
  5261. "type": "string",
  5262. "description": "URL of the external wiki"
  5263. }
  5264. }
  5265. }
  5266. }
  5267. }
  5268. },
  5269. "responses": {
  5270. "204": {
  5271. "description": "Wiki settings updated successfully."
  5272. },
  5273. "404": {
  5274. "description": "Repository not found."
  5275. },
  5276. "422": {
  5277. "description": "Validation error."
  5278. }
  5279. }
  5280. }
  5281. },
  5282. "/repos/{owner}/{repo}/editorconfig/{filename}": {
  5283. "get": {
  5284. "operationId": "getEditorconfig",
  5285. "summary": "Get editorconfig definition",
  5286. "description": "Returns the editorconfig definition for the given filename in the repository.",
  5287. "tags": [
  5288. "Repositories"
  5289. ],
  5290. "parameters": [
  5291. {
  5292. "name": "owner",
  5293. "in": "path",
  5294. "required": true,
  5295. "schema": {
  5296. "type": "string"
  5297. },
  5298. "description": "Owner of the repository"
  5299. },
  5300. {
  5301. "name": "repo",
  5302. "in": "path",
  5303. "required": true,
  5304. "schema": {
  5305. "type": "string"
  5306. },
  5307. "description": "Name of the repository"
  5308. },
  5309. {
  5310. "name": "filename",
  5311. "in": "path",
  5312. "required": true,
  5313. "schema": {
  5314. "type": "string"
  5315. },
  5316. "description": "Filename to get the editorconfig definition for"
  5317. }
  5318. ],
  5319. "responses": {
  5320. "200": {
  5321. "description": "Success",
  5322. "content": {
  5323. "application/json": {
  5324. "schema": {
  5325. "$ref": "#/components/schemas/EditorConfigDefinition"
  5326. }
  5327. }
  5328. }
  5329. },
  5330. "404": {
  5331. "description": "No editorconfig file exists or no matching definition for the filename."
  5332. }
  5333. }
  5334. }
  5335. },
  5336. "/repos/{owner}/{repo}/git/blobs/{sha}": {
  5337. "get": {
  5338. "operationId": "getGitBlob",
  5339. "summary": "Get a git blob",
  5340. "description": "Returns the content of a git blob object, base64 encoded.",
  5341. "tags": [
  5342. "Miscellaneous"
  5343. ],
  5344. "parameters": [
  5345. {
  5346. "name": "owner",
  5347. "in": "path",
  5348. "required": true,
  5349. "schema": {
  5350. "type": "string"
  5351. },
  5352. "description": "Owner of the repository"
  5353. },
  5354. {
  5355. "name": "repo",
  5356. "in": "path",
  5357. "required": true,
  5358. "schema": {
  5359. "type": "string"
  5360. },
  5361. "description": "Name of the repository"
  5362. },
  5363. {
  5364. "name": "sha",
  5365. "in": "path",
  5366. "required": true,
  5367. "schema": {
  5368. "type": "string"
  5369. },
  5370. "description": "SHA of the git blob"
  5371. }
  5372. ],
  5373. "responses": {
  5374. "200": {
  5375. "description": "Success",
  5376. "content": {
  5377. "application/json": {
  5378. "schema": {
  5379. "$ref": "#/components/schemas/GitBlob"
  5380. }
  5381. }
  5382. }
  5383. },
  5384. "404": {
  5385. "description": "Blob not found."
  5386. }
  5387. }
  5388. }
  5389. },
  5390. "/user/issues": {
  5391. "get": {
  5392. "operationId": "listUserIssues",
  5393. "summary": "List issues assigned to the authenticated user",
  5394. "description": "Lists issues across all repositories assigned to the authenticated user. Also available at `GET /issues`.",
  5395. "tags": [
  5396. "Issues"
  5397. ],
  5398. "parameters": [
  5399. {
  5400. "name": "page",
  5401. "in": "query",
  5402. "required": false,
  5403. "schema": {
  5404. "type": "integer"
  5405. },
  5406. "description": "Page number"
  5407. },
  5408. {
  5409. "name": "state",
  5410. "in": "query",
  5411. "required": false,
  5412. "schema": {
  5413. "type": "string",
  5414. "enum": [
  5415. "open",
  5416. "closed"
  5417. ],
  5418. "default": "open"
  5419. },
  5420. "description": "Filter by state"
  5421. }
  5422. ],
  5423. "responses": {
  5424. "200": {
  5425. "description": "Success",
  5426. "content": {
  5427. "application/json": {
  5428. "schema": {
  5429. "type": "array",
  5430. "items": {
  5431. "$ref": "#/components/schemas/Issue"
  5432. }
  5433. }
  5434. }
  5435. }
  5436. }
  5437. }
  5438. }
  5439. }
  5440. },
  5441. "components": {
  5442. "securitySchemes": {
  5443. "BasicAuth": {
  5444. "type": "http",
  5445. "scheme": "basic"
  5446. },
  5447. "AccessToken": {
  5448. "type": "apiKey",
  5449. "in": "header",
  5450. "name": "Authorization",
  5451. "description": "Personal access token. Use format: token {YOUR_ACCESS_TOKEN}"
  5452. },
  5453. "TokenQuery": {
  5454. "type": "apiKey",
  5455. "in": "query",
  5456. "name": "token",
  5457. "description": "Access token as query parameter"
  5458. }
  5459. },
  5460. "schemas": {
  5461. "User": {
  5462. "type": "object",
  5463. "properties": {
  5464. "id": {
  5465. "type": "integer"
  5466. },
  5467. "username": {
  5468. "type": "string"
  5469. },
  5470. "login": {
  5471. "type": "string",
  5472. "description": "Alias of username for GitHub API compatibility"
  5473. },
  5474. "full_name": {
  5475. "type": "string"
  5476. },
  5477. "email": {
  5478. "type": "string",
  5479. "format": "email"
  5480. },
  5481. "avatar_url": {
  5482. "type": "string"
  5483. }
  5484. }
  5485. },
  5486. "Collaborator": {
  5487. "description": "A repository collaborator with permission information",
  5488. "allOf": [
  5489. {
  5490. "$ref": "#/components/schemas/User"
  5491. },
  5492. {
  5493. "type": "object",
  5494. "properties": {
  5495. "permissions": {
  5496. "type": "object",
  5497. "properties": {
  5498. "admin": {
  5499. "type": "boolean"
  5500. },
  5501. "push": {
  5502. "type": "boolean"
  5503. },
  5504. "pull": {
  5505. "type": "boolean"
  5506. }
  5507. }
  5508. }
  5509. }
  5510. }
  5511. ]
  5512. },
  5513. "Repository": {
  5514. "type": "object",
  5515. "properties": {
  5516. "id": {
  5517. "type": "integer"
  5518. },
  5519. "owner": {
  5520. "$ref": "#/components/schemas/User"
  5521. },
  5522. "name": {
  5523. "type": "string"
  5524. },
  5525. "full_name": {
  5526. "type": "string"
  5527. },
  5528. "description": {
  5529. "type": "string"
  5530. },
  5531. "private": {
  5532. "type": "boolean"
  5533. },
  5534. "fork": {
  5535. "type": "boolean"
  5536. },
  5537. "parent": {
  5538. "$ref": "#/components/schemas/Repository",
  5539. "nullable": true,
  5540. "description": "Present when fork is true"
  5541. },
  5542. "empty": {
  5543. "type": "boolean"
  5544. },
  5545. "mirror": {
  5546. "type": "boolean"
  5547. },
  5548. "size": {
  5549. "type": "integer"
  5550. },
  5551. "html_url": {
  5552. "type": "string"
  5553. },
  5554. "ssh_url": {
  5555. "type": "string"
  5556. },
  5557. "clone_url": {
  5558. "type": "string"
  5559. },
  5560. "website": {
  5561. "type": "string"
  5562. },
  5563. "stars_count": {
  5564. "type": "integer"
  5565. },
  5566. "forks_count": {
  5567. "type": "integer"
  5568. },
  5569. "watchers_count": {
  5570. "type": "integer"
  5571. },
  5572. "open_issues_count": {
  5573. "type": "integer"
  5574. },
  5575. "default_branch": {
  5576. "type": "string"
  5577. },
  5578. "created_at": {
  5579. "type": "string",
  5580. "format": "date-time"
  5581. },
  5582. "updated_at": {
  5583. "type": "string",
  5584. "format": "date-time"
  5585. },
  5586. "permissions": {
  5587. "type": "object",
  5588. "properties": {
  5589. "admin": {
  5590. "type": "boolean"
  5591. },
  5592. "push": {
  5593. "type": "boolean"
  5594. },
  5595. "pull": {
  5596. "type": "boolean"
  5597. }
  5598. }
  5599. }
  5600. }
  5601. },
  5602. "Branch": {
  5603. "type": "object",
  5604. "properties": {
  5605. "name": {
  5606. "type": "string"
  5607. },
  5608. "commit": {
  5609. "type": "object",
  5610. "properties": {
  5611. "id": {
  5612. "type": "string"
  5613. },
  5614. "message": {
  5615. "type": "string"
  5616. },
  5617. "url": {
  5618. "type": "string"
  5619. },
  5620. "author": {
  5621. "type": "object",
  5622. "properties": {
  5623. "name": {
  5624. "type": "string"
  5625. },
  5626. "email": {
  5627. "type": "string"
  5628. },
  5629. "username": {
  5630. "type": "string"
  5631. }
  5632. }
  5633. },
  5634. "committer": {
  5635. "type": "object",
  5636. "properties": {
  5637. "name": {
  5638. "type": "string"
  5639. },
  5640. "email": {
  5641. "type": "string"
  5642. },
  5643. "username": {
  5644. "type": "string"
  5645. }
  5646. }
  5647. },
  5648. "timestamp": {
  5649. "type": "string",
  5650. "format": "date-time"
  5651. }
  5652. }
  5653. }
  5654. }
  5655. },
  5656. "Commit": {
  5657. "type": "object",
  5658. "properties": {
  5659. "url": {
  5660. "type": "string"
  5661. },
  5662. "sha": {
  5663. "type": "string"
  5664. },
  5665. "html_url": {
  5666. "type": "string"
  5667. },
  5668. "commit": {
  5669. "type": "object",
  5670. "properties": {
  5671. "url": {
  5672. "type": "string"
  5673. },
  5674. "message": {
  5675. "type": "string"
  5676. },
  5677. "author": {
  5678. "type": "object",
  5679. "properties": {
  5680. "name": {
  5681. "type": "string"
  5682. },
  5683. "email": {
  5684. "type": "string"
  5685. },
  5686. "date": {
  5687. "type": "string"
  5688. }
  5689. }
  5690. },
  5691. "committer": {
  5692. "type": "object",
  5693. "properties": {
  5694. "name": {
  5695. "type": "string"
  5696. },
  5697. "email": {
  5698. "type": "string"
  5699. },
  5700. "date": {
  5701. "type": "string"
  5702. }
  5703. }
  5704. },
  5705. "tree": {
  5706. "type": "object",
  5707. "properties": {
  5708. "url": {
  5709. "type": "string"
  5710. },
  5711. "sha": {
  5712. "type": "string"
  5713. }
  5714. }
  5715. }
  5716. }
  5717. },
  5718. "author": {
  5719. "$ref": "#/components/schemas/User"
  5720. },
  5721. "committer": {
  5722. "$ref": "#/components/schemas/User"
  5723. },
  5724. "parents": {
  5725. "type": "array",
  5726. "items": {
  5727. "type": "object",
  5728. "properties": {
  5729. "url": {
  5730. "type": "string"
  5731. },
  5732. "sha": {
  5733. "type": "string"
  5734. }
  5735. }
  5736. }
  5737. }
  5738. }
  5739. },
  5740. "Issue": {
  5741. "type": "object",
  5742. "properties": {
  5743. "id": {
  5744. "type": "integer"
  5745. },
  5746. "number": {
  5747. "type": "integer"
  5748. },
  5749. "state": {
  5750. "type": "string",
  5751. "enum": [
  5752. "open",
  5753. "closed"
  5754. ]
  5755. },
  5756. "title": {
  5757. "type": "string"
  5758. },
  5759. "body": {
  5760. "type": "string"
  5761. },
  5762. "user": {
  5763. "$ref": "#/components/schemas/User"
  5764. },
  5765. "labels": {
  5766. "type": "array",
  5767. "items": {
  5768. "$ref": "#/components/schemas/Label"
  5769. }
  5770. },
  5771. "assignee": {
  5772. "$ref": "#/components/schemas/User",
  5773. "nullable": true
  5774. },
  5775. "milestone": {
  5776. "$ref": "#/components/schemas/Milestone",
  5777. "nullable": true
  5778. },
  5779. "comments": {
  5780. "type": "integer"
  5781. },
  5782. "pull_request": {
  5783. "type": "object",
  5784. "nullable": true
  5785. },
  5786. "created_at": {
  5787. "type": "string",
  5788. "format": "date-time"
  5789. },
  5790. "updated_at": {
  5791. "type": "string",
  5792. "format": "date-time"
  5793. }
  5794. }
  5795. },
  5796. "Comment": {
  5797. "type": "object",
  5798. "properties": {
  5799. "id": {
  5800. "type": "integer"
  5801. },
  5802. "html_url": {
  5803. "type": "string"
  5804. },
  5805. "user": {
  5806. "$ref": "#/components/schemas/User"
  5807. },
  5808. "body": {
  5809. "type": "string"
  5810. },
  5811. "created_at": {
  5812. "type": "string",
  5813. "format": "date-time"
  5814. },
  5815. "updated_at": {
  5816. "type": "string",
  5817. "format": "date-time"
  5818. }
  5819. }
  5820. },
  5821. "Label": {
  5822. "type": "object",
  5823. "properties": {
  5824. "id": {
  5825. "type": "integer"
  5826. },
  5827. "name": {
  5828. "type": "string"
  5829. },
  5830. "color": {
  5831. "type": "string"
  5832. },
  5833. "url": {
  5834. "type": "string"
  5835. }
  5836. }
  5837. },
  5838. "Milestone": {
  5839. "type": "object",
  5840. "properties": {
  5841. "id": {
  5842. "type": "integer"
  5843. },
  5844. "state": {
  5845. "type": "string",
  5846. "enum": [
  5847. "open",
  5848. "closed"
  5849. ]
  5850. },
  5851. "title": {
  5852. "type": "string"
  5853. },
  5854. "description": {
  5855. "type": "string"
  5856. },
  5857. "open_issues": {
  5858. "type": "integer"
  5859. },
  5860. "closed_issues": {
  5861. "type": "integer"
  5862. },
  5863. "closed_at": {
  5864. "type": "string",
  5865. "format": "date-time",
  5866. "nullable": true
  5867. },
  5868. "due_on": {
  5869. "type": "string",
  5870. "format": "date-time",
  5871. "nullable": true
  5872. }
  5873. }
  5874. },
  5875. "Hook": {
  5876. "type": "object",
  5877. "properties": {
  5878. "id": {
  5879. "type": "integer"
  5880. },
  5881. "type": {
  5882. "type": "string",
  5883. "enum": [
  5884. "gogs",
  5885. "slack",
  5886. "discord",
  5887. "dingtalk"
  5888. ]
  5889. },
  5890. "events": {
  5891. "type": "array",
  5892. "items": {
  5893. "type": "string"
  5894. }
  5895. },
  5896. "active": {
  5897. "type": "boolean"
  5898. },
  5899. "config": {
  5900. "type": "object"
  5901. },
  5902. "created_at": {
  5903. "type": "string",
  5904. "format": "date-time"
  5905. },
  5906. "updated_at": {
  5907. "type": "string",
  5908. "format": "date-time"
  5909. }
  5910. }
  5911. },
  5912. "Release": {
  5913. "type": "object",
  5914. "properties": {
  5915. "id": {
  5916. "type": "integer"
  5917. },
  5918. "tag_name": {
  5919. "type": "string"
  5920. },
  5921. "target_commitish": {
  5922. "type": "string"
  5923. },
  5924. "name": {
  5925. "type": "string"
  5926. },
  5927. "body": {
  5928. "type": "string"
  5929. },
  5930. "draft": {
  5931. "type": "boolean"
  5932. },
  5933. "prerelease": {
  5934. "type": "boolean"
  5935. },
  5936. "author": {
  5937. "$ref": "#/components/schemas/User"
  5938. },
  5939. "created_at": {
  5940. "type": "string",
  5941. "format": "date-time"
  5942. }
  5943. }
  5944. },
  5945. "DeployKey": {
  5946. "type": "object",
  5947. "properties": {
  5948. "id": {
  5949. "type": "integer"
  5950. },
  5951. "key": {
  5952. "type": "string"
  5953. },
  5954. "url": {
  5955. "type": "string"
  5956. },
  5957. "title": {
  5958. "type": "string"
  5959. },
  5960. "created_at": {
  5961. "type": "string",
  5962. "format": "date-time"
  5963. },
  5964. "read_only": {
  5965. "type": "boolean"
  5966. }
  5967. }
  5968. },
  5969. "PublicKey": {
  5970. "type": "object",
  5971. "properties": {
  5972. "id": {
  5973. "type": "integer"
  5974. },
  5975. "key": {
  5976. "type": "string"
  5977. },
  5978. "url": {
  5979. "type": "string"
  5980. },
  5981. "title": {
  5982. "type": "string"
  5983. },
  5984. "created_at": {
  5985. "type": "string",
  5986. "format": "date-time"
  5987. }
  5988. }
  5989. },
  5990. "AccessToken": {
  5991. "type": "object",
  5992. "properties": {
  5993. "name": {
  5994. "type": "string"
  5995. },
  5996. "sha1": {
  5997. "type": "string"
  5998. }
  5999. }
  6000. },
  6001. "Email": {
  6002. "type": "object",
  6003. "properties": {
  6004. "email": {
  6005. "type": "string",
  6006. "format": "email"
  6007. },
  6008. "verified": {
  6009. "type": "boolean"
  6010. },
  6011. "primary": {
  6012. "type": "boolean"
  6013. }
  6014. }
  6015. },
  6016. "Organization": {
  6017. "type": "object",
  6018. "properties": {
  6019. "id": {
  6020. "type": "integer"
  6021. },
  6022. "username": {
  6023. "type": "string"
  6024. },
  6025. "full_name": {
  6026. "type": "string"
  6027. },
  6028. "avatar_url": {
  6029. "type": "string"
  6030. },
  6031. "description": {
  6032. "type": "string"
  6033. },
  6034. "website": {
  6035. "type": "string"
  6036. },
  6037. "location": {
  6038. "type": "string"
  6039. }
  6040. }
  6041. },
  6042. "Team": {
  6043. "type": "object",
  6044. "properties": {
  6045. "id": {
  6046. "type": "integer"
  6047. },
  6048. "name": {
  6049. "type": "string"
  6050. },
  6051. "description": {
  6052. "type": "string"
  6053. },
  6054. "permission": {
  6055. "type": "string",
  6056. "enum": [
  6057. "read",
  6058. "write",
  6059. "admin",
  6060. "owner"
  6061. ]
  6062. }
  6063. }
  6064. },
  6065. "Content": {
  6066. "type": "object",
  6067. "properties": {
  6068. "type": {
  6069. "type": "string",
  6070. "enum": [
  6071. "file",
  6072. "dir",
  6073. "symlink",
  6074. "submodule"
  6075. ]
  6076. },
  6077. "encoding": {
  6078. "type": "string"
  6079. },
  6080. "size": {
  6081. "type": "integer"
  6082. },
  6083. "name": {
  6084. "type": "string"
  6085. },
  6086. "path": {
  6087. "type": "string"
  6088. },
  6089. "content": {
  6090. "type": "string"
  6091. },
  6092. "sha": {
  6093. "type": "string"
  6094. },
  6095. "url": {
  6096. "type": "string"
  6097. },
  6098. "git_url": {
  6099. "type": "string"
  6100. },
  6101. "html_url": {
  6102. "type": "string"
  6103. },
  6104. "download_url": {
  6105. "type": "string"
  6106. },
  6107. "_links": {
  6108. "type": "object",
  6109. "properties": {
  6110. "git": {
  6111. "type": "string"
  6112. },
  6113. "self": {
  6114. "type": "string"
  6115. },
  6116. "html": {
  6117. "type": "string"
  6118. }
  6119. }
  6120. }
  6121. }
  6122. },
  6123. "GitTree": {
  6124. "type": "object",
  6125. "properties": {
  6126. "sha": {
  6127. "type": "string"
  6128. },
  6129. "url": {
  6130. "type": "string"
  6131. },
  6132. "tree": {
  6133. "type": "array",
  6134. "items": {
  6135. "type": "object",
  6136. "properties": {
  6137. "path": {
  6138. "type": "string"
  6139. },
  6140. "mode": {
  6141. "type": "string"
  6142. },
  6143. "type": {
  6144. "type": "string"
  6145. },
  6146. "size": {
  6147. "type": "integer"
  6148. },
  6149. "sha": {
  6150. "type": "string"
  6151. },
  6152. "url": {
  6153. "type": "string"
  6154. }
  6155. }
  6156. }
  6157. }
  6158. }
  6159. },
  6160. "Error": {
  6161. "type": "object",
  6162. "properties": {
  6163. "message": {
  6164. "type": "string"
  6165. },
  6166. "url": {
  6167. "type": "string"
  6168. }
  6169. }
  6170. },
  6171. "GitBlob": {
  6172. "type": "object",
  6173. "properties": {
  6174. "content": {
  6175. "type": "string",
  6176. "description": "Base64-encoded blob content"
  6177. },
  6178. "encoding": {
  6179. "type": "string",
  6180. "example": "base64"
  6181. },
  6182. "url": {
  6183. "type": "string"
  6184. },
  6185. "sha": {
  6186. "type": "string"
  6187. },
  6188. "size": {
  6189. "type": "integer"
  6190. }
  6191. }
  6192. },
  6193. "Tag": {
  6194. "type": "object",
  6195. "properties": {
  6196. "name": {
  6197. "type": "string"
  6198. },
  6199. "commit": {
  6200. "type": "object",
  6201. "properties": {
  6202. "id": {
  6203. "type": "string"
  6204. },
  6205. "message": {
  6206. "type": "string"
  6207. },
  6208. "url": {
  6209. "type": "string"
  6210. },
  6211. "author": {
  6212. "type": "object",
  6213. "properties": {
  6214. "name": {
  6215. "type": "string"
  6216. },
  6217. "email": {
  6218. "type": "string",
  6219. "format": "email"
  6220. },
  6221. "username": {
  6222. "type": "string"
  6223. }
  6224. }
  6225. },
  6226. "committer": {
  6227. "type": "object",
  6228. "properties": {
  6229. "name": {
  6230. "type": "string"
  6231. },
  6232. "email": {
  6233. "type": "string",
  6234. "format": "email"
  6235. },
  6236. "username": {
  6237. "type": "string"
  6238. }
  6239. }
  6240. },
  6241. "timestamp": {
  6242. "type": "string",
  6243. "format": "date-time"
  6244. }
  6245. }
  6246. }
  6247. }
  6248. },
  6249. "EditorConfigDefinition": {
  6250. "type": "object",
  6251. "properties": {
  6252. "charset": {
  6253. "type": "string"
  6254. },
  6255. "indent_style": {
  6256. "type": "string"
  6257. },
  6258. "indent_size": {
  6259. "type": "string"
  6260. },
  6261. "end_of_line": {
  6262. "type": "string"
  6263. }
  6264. }
  6265. }
  6266. }
  6267. }
  6268. }