Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update endpoint for SQL check (#2161)

ecmadao9afd7d5fde2d
diff --git a/docs/openapi/docs.go b/docs/openapi/docs.go
index 5fd5fa353b..505df71bdd 100644
--- a/docs/openapi/docs.go
+++ b/docs/openapi/docs.go
@@ -26,7 +26,7 @@ const docTemplate = `{
"basePath": "{{.BasePath}}",
"paths": {
"/sql/advise": {
- "get": {
+ "post": {
"description": "Parse and check the SQL statement according to the SQL review policy.",
"consumes": [
"*/*"
diff --git a/docs/openapi/swagger.yaml b/docs/openapi/swagger.yaml
index 15a8238a4a..4c50794c86 100644
--- a/docs/openapi/swagger.yaml
+++ b/docs/openapi/swagger.yaml
@@ -32,7 +32,7 @@ info:
version: "1.0"
paths:
/sql/advise:
- get:
+ post:
consumes:
- '*/*'
description: Parse and check the SQL statement according to the SQL review policy.
diff --git a/docs/sqlservice/docs.go b/docs/sqlservice/docs.go
index ab60608b00..d0c34f935d 100644
--- a/docs/sqlservice/docs.go
+++ b/docs/sqlservice/docs.go
@@ -25,8 +25,8 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
- "/sql/advise": {
- "get": {
+ "/advise": {
+ "post": {
"description": "Parse and check the SQL statement according to the SQL review rules.",
"consumes": [
"application/json"
diff --git a/docs/sqlservice/swagger.yaml b/docs/sqlservice/swagger.yaml
index df3859d941..bd0824a839 100644
--- a/docs/sqlservice/swagger.yaml
+++ b/docs/sqlservice/swagger.yaml
@@ -31,8 +31,8 @@ info:
title: Bytebase SQL Service
version: "1.0"
paths:
- /sql/advise:
- get:
+ /advise:
+ post:
consumes:
- application/json
description: Parse and check the SQL statement according to the SQL review rules.
diff --git a/server/openapi.go b/server/openapi.go
index 8ddc3bd9ce..838827da26 100644
--- a/server/openapi.go
+++ b/server/openapi.go
@@ -57,7 +57,7 @@ func (s *Server) registerOpenAPIRoutes(g *echo.Group) {
// @Success 200 {array} advisor.Advice
// @Failure 400 {object} echo.HTTPError
// @Failure 500 {object} echo.HTTPError
-// @Router /sql/advise [get].
+// @Router /sql/advise [post].
func (s *Server) sqlCheckController(c echo.Context) error {
request := &sqlCheckRequestBody{}
body, err := io.ReadAll(c.Request().Body)
diff --git a/sql-server/advise.go b/sql-server/advise.go
index 7f71c2109d..cfce31d2e9 100644
--- a/sql-server/advise.go
+++ b/sql-server/advise.go
@@ -38,7 +38,7 @@ type sqlCheckRequestBody struct {
}
func (s *Server) registerAdvisorRoutes(g *echo.Group) {
- g.POST("/sql/advise", s.sqlCheckController)
+ g.POST("/advise", s.sqlCheckController)
}
// sqlCheckController godoc
@@ -54,7 +54,7 @@ func (s *Server) registerAdvisorRoutes(g *echo.Group) {
// @Success 200 {array} advisor.Advice
// @Failure 400 {object} echo.HTTPError
// @Failure 500 {object} echo.HTTPError
-// @Router /sql/advise [get].
+// @Router /advise [post].
func (s *Server) sqlCheckController(c echo.Context) error {
request := &sqlCheckRequestBody{}
body, err := io.ReadAll(c.Request().Body)