-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package swagger |
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,22 @@ | ||
package swagger | ||
|
||
// Info swagger info 根节点/** | ||
type Info struct { | ||
Title string `json:"title"` | ||
Description string `json:"description"` | ||
TermsOfService string `json:"termsOfService"` | ||
Contact Contact `json:"contact"` | ||
License License `json:"license"` | ||
Version string `json:"version"` | ||
} | ||
|
||
type Contact struct { | ||
Name string `json:"name"` | ||
Url string `json:"url"` | ||
Email string `json:"email"` | ||
} | ||
|
||
type License struct { | ||
Name string `json:"name"` | ||
Url string `json:"url"` | ||
} |
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,47 @@ | ||
package swagger | ||
|
||
type Path struct { | ||
Tags []string `json:"tags"` | ||
Summary string `json:"summary"` | ||
OperationId string `json:"operationId"` | ||
Parameters []Parameters `json:"parameters"` | ||
RequestBody RequestBody `json:"requestBody"` | ||
Responses map[string]ResponsesItem `json:"responses"` | ||
Security []Security `json:"security"` | ||
} | ||
|
||
type Parameters struct { | ||
Name string `json:"name"` | ||
In string `json:"in"` | ||
Description string `json:"description"` | ||
Required bool `json:"required"` | ||
Schema struct { | ||
Type string `json:"type"` | ||
} `json:"schema"` | ||
} | ||
type RequestBody struct { | ||
Content map[string]ContentType `json:"content"` | ||
} | ||
|
||
type ContentType struct { | ||
Schema Schema `json:"schema"` | ||
} | ||
|
||
type Schema struct { | ||
Type string `json:"type"` | ||
Properties map[string]Property `json:"properties"` | ||
Required []string `json:"required"` | ||
} | ||
type Property struct { | ||
Description string `json:"description"` | ||
Type string `json:"type"` | ||
} | ||
|
||
type ResponsesItem struct { | ||
Description string `json:"description"` | ||
Content map[string]interface{} `json:"content"` | ||
} | ||
|
||
type Security struct { | ||
PetstoreAuth []string `json:"petstore_auth"` | ||
} |