-
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.
Auto parse external models when flag parseDependency is set (#1027)
* auto parse external models when flag parseDependency is set * remove log in test * fix test * rephrase the description for flag parseDependency
- Loading branch information
Showing
8 changed files
with
206 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package external | ||
|
||
import "github.com/urfave/cli/v2" | ||
|
||
type MyError struct { | ||
cli.Author | ||
} |
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,18 @@ | ||
package api | ||
|
||
import ( | ||
"net/http" | ||
) | ||
|
||
// GetExternalModels example | ||
// @Summary parse external models | ||
// @Description get string by ID | ||
// @ID get_external_models | ||
// @Accept json | ||
// @Produce json | ||
// @Success 200 {string} string "ok" | ||
// @Failure 400 {object} http.Header "from internal pkg" | ||
// @Router /testapi/external_models [get] | ||
func GetExternalModels(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,50 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "Parse external models.", | ||
"title": "Swagger Example API", | ||
"contact": {}, | ||
"version": "1.0" | ||
}, | ||
"basePath": "/v1", | ||
"paths": { | ||
"/testapi/external_models": { | ||
"get": { | ||
"description": "get string by ID", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"summary": "parse external models", | ||
"operationId": "get_external_models", | ||
"responses": { | ||
"200": { | ||
"description": "ok", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"400": { | ||
"description": "from internal pkg", | ||
"schema": { | ||
"$ref": "#/definitions/http.Header" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"http.Header": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "array", | ||
"items": { | ||
"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,8 @@ | ||
package main | ||
|
||
// @title Swagger Example API | ||
// @version 1.0 | ||
// @description Parse external models. | ||
// @BasePath /v1 | ||
func main() { | ||
} |