@@ -185,7 +185,12 @@ public static void returnBuild(Method method, JSONObject json) {
185185 private static void get (String name , String path , JSONObject api , Method method , String outPath , String tag ) {
186186 // 方法对象
187187 JSONObject apiMethod = Factory .get ();
188- api .put (outPath + path , apiMethod );
188+ if (api .containsKey (outPath + path )){
189+ //路径已经存在
190+ apiMethod = (JSONObject )api .get (outPath + path );
191+ }else {
192+ api .put (outPath + path , apiMethod );
193+ }
189194 // body
190195 JSONObject content = Factory .get ();
191196 apiMethod .put ("get" , content );
@@ -273,7 +278,12 @@ private static void get(String name, String path, JSONObject api, Method method,
273278 private static void post (String name , String path , JSONObject api , Method method , String outPath , String tag ) {
274279 // 方法对象
275280 JSONObject apiMethod = Factory .get ();
276- api .put (outPath + path , apiMethod );
281+ if (api .containsKey (outPath + path )){
282+ //路径已经存在
283+ apiMethod = (JSONObject )api .get (outPath + path );
284+ }else {
285+ api .put (outPath + path , apiMethod );
286+ }
277287 // body
278288 JSONObject content = Factory .get ();
279289 apiMethod .put ("post" , content );
@@ -293,7 +303,12 @@ private static void post(String name, String path, JSONObject api, Method method
293303 private static void delete (String name , String path , JSONObject api , Method method , String outPath , String tag ) {
294304 // 方法对象
295305 JSONObject apiMethod = Factory .get ();
296- api .put (outPath + path , apiMethod );
306+ if (api .containsKey (outPath + path )){
307+ //路径已经存在
308+ apiMethod = (JSONObject )api .get (outPath + path );
309+ }else {
310+ api .put (outPath + path , apiMethod );
311+ }
297312 // body
298313 JSONObject content = Factory .get ();
299314 apiMethod .put ("delete" , content );
@@ -313,7 +328,12 @@ private static void delete(String name, String path, JSONObject api, Method meth
313328 private static void put (String name , String path , JSONObject api , Method method , String outPath , String tag ) {
314329 // 方法对象
315330 JSONObject apiMethod = Factory .get ();
316- api .put (outPath + path , apiMethod );
331+ if (api .containsKey (outPath + path )){
332+ //路径已经存在
333+ apiMethod = (JSONObject )api .get (outPath + path );
334+ }else {
335+ api .put (outPath + path , apiMethod );
336+ }
317337 // body
318338 JSONObject content = Factory .get ();
319339 apiMethod .put ("put" , content );
0 commit comments