11openapi : 3.1.0
22info :
33 title : GPT Gateway
4+ description : FastAPI middleware to list, read, write, and scan GitHub repositories for use in GPT Actions.
45 version : 1.0.0
56servers :
67 - url : https://gpt-gateway-cigu.onrender.com
7- tags :
8- - name : GitHub Files
9-
108paths :
119 /list-files/ :
1210 get :
13- tags : [GitHub Files]
14- summary : List all files in a given GitHub repo path
1511 operationId : listFiles
16- x-gpt :
17- isAction : true
18- description : " List all files and directories at a given path in a GitHub repository"
12+ summary : List files in a GitHub repository path
1913 parameters :
2014 - name : owner
2115 in : query
@@ -29,45 +23,41 @@ paths:
2923 type : string
3024 - name : path
3125 in : query
32- required : true
26+ required : false
3327 schema :
3428 type : string
3529 - name : branch
3630 in : query
3731 required : false
3832 schema :
3933 type : string
40- default : main
4134 responses :
4235 ' 200 ' :
43- description : List of files returned
36+ description : Success listing files
4437 content :
4538 application/json :
4639 schema :
4740 type : object
4841 properties :
42+ status :
43+ type : string
44+ path :
45+ type : string
4946 files :
5047 type : array
5148 items :
5249 type : object
5350 properties :
51+ name :
52+ type : string
5453 path :
5554 type : string
5655 type :
5756 type : string
58- ' 400 ' :
59- description : Bad request
60- ' 500 ' :
61- description : Internal error
62-
6357 /read-file/ :
6458 get :
65- tags : [GitHub Files]
66- summary : Read the raw content of a file
6759 operationId : readFile
68- x-gpt :
69- isAction : true
70- description : " Read and return the raw contents of a file in a GitHub repository"
60+ summary : Read content of a file in a GitHub repository
7161 parameters :
7262 - name : owner
7363 in : query
@@ -89,152 +79,112 @@ paths:
8979 required : false
9080 schema :
9181 type : string
92- default : main
9382 responses :
9483 ' 200 ' :
95- description : File content returned
84+ description : Success reading file
9685 content :
9786 application/json :
9887 schema :
9988 type : object
10089 properties :
90+ status :
91+ type : string
92+ path :
93+ type : string
10194 content :
10295 type : string
103- ' 400 ' :
104- description : Bad request
105- ' 500 ' :
106- description : Internal error
107-
108- /scan-repo/ :
109- post :
110- tags : [GitHub Files]
111- summary : Recursively scan a folder
112- operationId : scanRepo
113- x-gpt :
114- isAction : true
115- description : " Recursively scan a GitHub repository path and return its structure"
96+ /write-file/ :
97+ put :
98+ operationId : writeFile
99+ summary : Write or update a file in a GitHub repository
116100 requestBody :
117101 required : true
118102 content :
119103 application/json :
120104 schema :
121105 type : object
122- required : [owner, repo, path]
106+ required :
107+ - owner
108+ - repo
109+ - branch
110+ - path
111+ - content
112+ - message
123113 properties :
124114 owner :
125115 type : string
126116 repo :
127117 type : string
118+ branch :
119+ type : string
128120 path :
129121 type : string
130- branch :
122+ content :
123+ type : string
124+ message :
125+ type : string
126+ author_name :
127+ type : string
128+ author_email :
131129 type : string
132- default : main
133- depth :
134- type : integer
135- default : 5
136130 responses :
137131 ' 200 ' :
138- description : Recursive structure returned
132+ description : File written or updated
139133 content :
140134 application/json :
141135 schema :
142136 type : object
143137 properties :
144138 status :
145139 type : string
146- tree :
147- type : array
148- items :
149- type : object
150- properties :
151- name :
152- type : string
153- path :
154- type : string
155- type :
156- type : string
157- children :
158- type : array
159- items :
160- type : object
161- properties :
162- name :
163- type : string
164- path :
165- type : string
166- type :
167- type : string
168- children :
169- type : array
170- items :
171- type : object
172- properties :
173- name :
174- type : string
175- path :
176- type : string
177- type :
178- type : string
179- ' 400 ' :
180- description : Bad request
181- ' 500 ' :
182- description : Internal error
183-
184- /write-file/ :
185- put :
186- tags : [GitHub Files]
187- summary : Create or update a file in the repo
188- operationId : writeFile
189- x-gpt :
190- isAction : true
191- description : " Write or update a file in a GitHub repository with commit message"
140+ result :
141+ type : object
142+ /scan-repo/ :
143+ post :
144+ operationId : scanRepo
145+ summary : Recursively scan a GitHub repository path
192146 requestBody :
193147 required : true
194148 content :
195149 application/json :
196150 schema :
197151 type : object
198- required : [owner, repo, branch, path, content, message]
152+ required :
153+ - owner
154+ - repo
199155 properties :
200156 owner :
201157 type : string
202158 repo :
203159 type : string
204- branch :
205- type : string
206160 path :
207161 type : string
208- content :
209- type : string
210- message :
162+ branch :
211163 type : string
212- author :
213- type : object
214- properties :
215- name :
216- type : string
217- default : GPT Agent
218- email :
219- type : string
220- default : gpt-agent@nomena.dev
164+ depth :
165+ type : integer
221166 responses :
222167 ' 200 ' :
223- description : File written or updated
168+ description : Recursive tree structure
224169 content :
225170 application/json :
226171 schema :
227172 type : object
228173 properties :
229174 status :
230175 type : string
231- message :
232- type : string
233- commit_sha :
234- type : string
235- commit_url :
236- type : string
237- ' 400 ' :
238- description : Bad request
239- ' 500 ' :
240- description : Internal error
176+ tree :
177+ type : array
178+ items :
179+ type : object
180+ properties :
181+ name :
182+ type : string
183+ path :
184+ type : string
185+ type :
186+ type : string
187+ children :
188+ type : array
189+ items :
190+ type : object
0 commit comments