-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deprecate some parts of routers in an operation (#1735)
Signed-off-by: sdghchj <[email protected]>
- Loading branch information
Showing
8 changed files
with
164 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package api | ||
|
||
import "net/http" | ||
|
||
// @Description add Foo | ||
// @Deprecated | ||
// @Success 200 {string} string | ||
// @Router /testapi/foo1 [put] | ||
// @Router /testapi/foo1 [post] | ||
// @Router /test/api/foo1 [post] | ||
func AddFoo(w http.ResponseWriter, r *http.Request) {} | ||
|
||
// @Description get Foo | ||
// @Success 200 {string} string | ||
// @Router /testapi/foo1 [get] | ||
// @DeprecatedRouter /test/api/foo1 [get] | ||
func GetFoo(w http.ResponseWriter, r *http.Request) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "test data for deprecated router", | ||
"title": "Swagger Example API", | ||
"termsOfService": "http://swagger.io/terms/", | ||
"contact": {}, | ||
"version": "1.0" | ||
}, | ||
"paths": { | ||
"/test/api/foo1": { | ||
"get": { | ||
"description": "get Foo", | ||
"deprecated": true, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"post": { | ||
"description": "add Foo", | ||
"deprecated": true, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/testapi/foo1": { | ||
"get": { | ||
"description": "get Foo", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"put": { | ||
"description": "add Foo", | ||
"deprecated": true, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"post": { | ||
"description": "add Foo", | ||
"deprecated": true, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package main | ||
|
||
// @title Swagger Example API | ||
// @version 1.0 | ||
// @description test data for deprecated router | ||
// @termsOfService http://swagger.io/terms/ | ||
|
||
func main() { | ||
} |