summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorDenys Konovalov <kontakt@denyskon.de>2023-06-07 17:49:58 +0200
committerGitHub <noreply@github.com>2023-06-07 23:49:58 +0800
commiteac1bddb8da2e26a3f6d6678b9888c65418cf318 (patch)
tree7e004c97853bc03c780cdf511ff58ec58498d690 /modules
parent027014d7de19a566cde306c868a31895903d00d5 (diff)
downloadgitea-eac1bddb8da2e26a3f6d6678b9888c65418cf318.tar.gz
gitea-eac1bddb8da2e26a3f6d6678b9888c65418cf318.zip
fix swagger documentation for multiple files API endpoint (#25110)v1.20.0-rc0
Fixes some issues with the swagger documentation for the new multiple files API endpoint (#24887) which were overlooked when submitting the original PR: 1. add some missing parameter descriptions 2. set correct `required` option for required parameters 3. change endpoint description to match it full functionality (every kind of file modification is supported, not just creating and updating)
Diffstat (limited to 'modules')
-rw-r--r--modules/structs/repo_file.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/structs/repo_file.go b/modules/structs/repo_file.go
index 6ca0e1c101..48fcebe6f8 100644
--- a/modules/structs/repo_file.go
+++ b/modules/structs/repo_file.go
@@ -71,11 +71,11 @@ type ChangeFileOperation struct {
// enum: create,update,delete
Operation string `json:"operation" binding:"Required"`
// path to the existing or new file
- Path string `json:"path" binding:"MaxSize(500)"`
- // content must be base64 encoded
// required: true
+ Path string `json:"path" binding:"Required;MaxSize(500)"`
+ // new or updated file content, must be base64 encoded
Content string `json:"content"`
- // sha is the SHA for the file that already exists, required for update, delete
+ // sha is the SHA for the file that already exists, required for update or delete
SHA string `json:"sha"`
// old path of the file to move
FromPath string `json:"from_path"`
@@ -85,7 +85,9 @@ type ChangeFileOperation struct {
// Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
type ChangeFilesOptions struct {
FileOptions
- Files []*ChangeFileOperation `json:"files"`
+ // list of file operations
+ // required: true
+ Files []*ChangeFileOperation `json:"files" binding:"Required"`
}
// Branch returns branch name
ighlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
Adam Coulombe <me@adam.co> <adamcoulombe187@hotmail.com>
Adam J. Sontag <ajpiano@ajpiano.com>
Alexander Farkas <info@corrupt-system.de>
Alexander Farkas <info@corrupt-system.de> <a.farkas.pm@googlemail.com>
Alexis Abril <me@alexisabril.com> <alexis.abril@gmail.com>
Andrew E Monat <amonat@gmail.com>
Andrey Meshkov <ay.meshkov@gmail.com>
Andrey Meshkov <ay.meshkov@gmail.com> <am@adguard.com>
Anton Matzneller <obhvsbypqghgc@gmail.com>
Anton Matzneller <obhvsbypqghgc@gmail.com> <haskell_noob-github@yahoo.de>
Batiste Bieler <batiste.bieler@gmail.com>
Benjamin Truyman <bentruyman@gmail.com>
Brandon Aaron <brandon.aaron@gmail.com>
Carl Danley <carldanley@gmail.com>
Carl Fürstenberg <azatoth@gmail.com>
Carl Fürstenberg <azatoth@gmail.com> <carl@excito.com>
Charles McNulty <cmcnulty@kznf.com>
Chris Rebert <github@rebertia.com>
Chris Rebert <github@rebertia.com> <code@rebertia.com>
Christian Oliff <christianoliff@pm.me>
Christian Oliff <christianoliff@pm.me> <christianoliff@yahoo.com>
Christopher Jones <chris@cjqed.com> cjqed <christopherjonesqed@gmail.com>
Colin Snover <github.com@zetafleet.com> <colin@alpha.zetafleet.com>
Corey Frang <gnarf37@gmail.com> <gnarf@gnarf.net>
Dan Heberden <danheberden@gmail.com>
Daniel Chatfield <chatfielddaniel@gmail.com> <chatfielddaniel@googlemail.com>
Daniel Gálvez <dgalvez@editablething.com>
Danil Somsikov <danilasomsikov@gmail.com>
Dave Methvin <dave.methvin@gmail.com>
Dave Reed <dareed@microsoft.com>
David Fox <dfoxinator@gmail.com> <dfox@snap-interactive.com>
David Hong <d.hong@me.com>
David Murdoch <david@davidmurdoch.com> <musicisair@yahoo.com>
Devin Cooper <cooper.semantics@gmail.com> <dcooper@snap-interactive.com>
Douglas Neiner <doug@dougneiner.com> <doug@pixelgraphics.us>
Dmitry Gusev <dmitry.gusev@gmail.com>
Earle Castledine <mrspeaker@gmail.com>
Erick Ruiz de Chávez <erickrdch@gmail.com>
Gianni Alessandro Chiappetta <gianni@runlevel6.org>
Heungsub Lee <h@subl.ee> <lee@heungsub.net>
Iraê Carvalho <irae@irae.pro.br>
Isaac Z. Schlueter <i@izs.me>
Ismail Khair <ismail.khair@gmail.com>
James Burke <jrburke@gmail.com>
James Padolsey <cla@padolsey.net> <jamespadolsey@gmail.com>
Jason Bedard <jason+jquery@jbedard.ca> <github@jbedard.ca>
Jay Merrifield <fracmak@gmail.com>
Jay Merrifield <fracmak@gmail.com> <jmerrifiel@gannett.com>
Jean Boussier <jean.boussier@gmail.com>
Jephte Clain <Jephte.Clain@univ-reunion.fr>
Jess Thrysoee <jess@thrysoee.dk>
Joao Henrique de Andrade Bruni <joaohbruni@yahoo.com.br>
Joe Presbrey <presbrey@gmail.com> <presbrey+jwp@gmail.com>
John Resig <jeresig@gmail.com>
John Resig <jeresig@gmail.com> <jeresig@Archimedes.local>
Jordan Boesch <jboesch26@gmail.com> <jordan@boedesign.com>
Josh Varner <josh.varner@gmail.com> <josh.varner@gmail.com>
Julian Aubourg <aubourg.julian@gmail.com>
Julian Aubourg <aubourg.julian@gmail.com> <j@ubourg.net>
Julian Aubourg <aubourg.julian@gmail.com> <Julian@.(none)>
John Firebaugh <john_firebaugh@bigfix.com>
John Firebaugh <john_firebaugh@bigfix.com> <john_firebaugh@us.ibm.com>
Jörn Zaefferer <joern.zaefferer@gmail.com>
Jörn Zaefferer <joern.zaefferer@gmail.com> <joern.zaefferer@googlemail.com>
Jörn Zaefferer <joern.zaefferer@gmail.com> <JZA@.(none)>
Karl Swedberg <kswedberg@gmail.com> <karl@englishrules.com>
Klaus Hartl <klaus.hartl@gmail.com> <klaus.hartl@googlemail.com>
Kris Borchers <kris.borchers@gmail.com>
Lee Carpenter <elcarpie@gmail.com>
Li Xudong <istonelee@gmail.com>
Louis-Rémi Babé <lrbabe@gmail.com>
Louis-Rémi Babé <lrbabe@gmail.com> <louisremi@louisremi-laptop.(none)>
Louis-Rémi Babé <lrbabe@gmail.com> <lrbabe@lrbabe-laptop.(none)>
Louis-Rémi Babé <lrbabe@gmail.com> <lrbabe@lrbabe-laptop>
Marcel Greter <marcel.greter@ocbnet.ch> <mgr@rtp.ch>
Matthias Jäggli <matthias.jaeggli@gmail.com> <matthias.jaeggli@scout24.ch>
Michael Murray <m@murz.net> <mmurray.wa@gmail.com>
Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
Michał Gołębiowski-Owczarek <m.goleb@gmail.com> <michal.golebiowski@laboratorium.ee>
Mike Alsup <malsup@gmail.com>
Nguyen Phuc Lam <ruado1987@gmail.com>
Oleg Gaidarenko <markelog@gmail.com>
Paul Bakaus <paul.bakaus@gmail.com> <paul.bakaus@googlemail.com>
Rafaël Blais Masson <rafbmasson@gmail.com>
Richard D. Worth <rdworth@gmail.com>
Rick Waldron <waldron.rick@gmail.com>
Rick Waldron <waldron.rick@gmail.com> <rick@bocoup.com>
Robert Katić <robert.katic@gmail.com>
Roman Reiß <me@silverwind.io>
Ron Otten <r.j.g.otten@gmail.com>
Sai Lung Wong <sai.wong@huffingtonpost.com>
Scott González <scott.gonzalez@gmail.com> <sgonzale@sgonzale-laptop.local>
Scott Jehl <scottjehl@gmail.com> <scott@scottjehl.com>
Sebastian Burkhard <sebi.burkhard@gmail.com>
Senya Pugach <upisfree@outlook.com>
Shashanka Nataraj <shashankan.10@gmail.com>
Shashanka Nataraj <shashankan.10@gmail.com> <ShashankaNataraj@users.noreply.github.com>
Thomas Tortorini <thomastortorini@gmail.com> Mr21
Timmy Willison <4timmywil@gmail.com>
Timmy Willison <4timmywil@gmail.com> <timmywillisn@gmail.com>
Timmy Willison <4timmywil@gmail.com> <tim.willison@thisismedium.com>
Timmy Willison <4timmywil@gmail.com> <timmywil@users.noreply.github.com>
Timo Tijhof <krinklemail@gmail.com>
TJ Holowaychuk <tj@vision-media.ca>
Tom H Fuertes <tomfuertes@gmail.com>
Tom H Fuertes <tomfuertes@gmail.com> Tom H Fuertes <TomFuertes@gmail.com>
Tom Viner <github@viner.tv>
Wesley Walser <waw325@gmail.com> <wwalser@atlassian.com>
Xavi Ramirez <xavi.rmz@gmail.com>
Xavier Montillet <xavierm02.net@gmail.com>
Yehuda Katz <wycats@gmail.com>
Yehuda Katz <wycats@gmail.com> <wycats@12-189-125-93.att-inc.com>
Yehuda Katz <wycats@gmail.com> <wycats@mobile005.mycingular.net>
Yehuda Katz <wycats@gmail.com> <wycats@Yehuda-Katz.local>
Yiming He <yiminghe@gmail.com>
Terry Jones <terry@jon.es> <terry@fluidinfo.com>