-
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.
fix parse nested structs and aliases (#1866)
Co-authored-by: ma.mikhaylov <[email protected]>
- Loading branch information
Showing
9 changed files
with
154 additions
and
24 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,9 @@ | ||
package main | ||
|
||
import "github.com/swaggo/swag/testdata/alias_nested/pkg/good" | ||
|
||
// @Success 200 {object} good.Gen | ||
// @Router /api [get]. | ||
func main() { | ||
var _ good.Gen | ||
} |
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,38 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"contact": {} | ||
}, | ||
"paths": { | ||
"/api": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/definitions/Gen" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"Gen": { | ||
"type": "object", | ||
"properties": { | ||
"emb": { | ||
"$ref": "#/definitions/github_com_swaggo_swag_testdata_alias_nested_pkg_good.Emb" | ||
} | ||
} | ||
}, | ||
"github_com_swaggo_swag_testdata_alias_nested_pkg_good.Emb": { | ||
"type": "object", | ||
"properties": { | ||
"good": { | ||
"type": "boolean" | ||
} | ||
} | ||
} | ||
} | ||
} |
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,5 @@ | ||
package bad | ||
|
||
type Emb struct { | ||
Bad bool `json:"bad"` | ||
} // @name Emb |
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 good | ||
|
||
type Gen struct { | ||
Emb Emb `json:"emb"` | ||
} // @name Gen | ||
|
||
type Emb struct { | ||
Good bool `json:"good"` | ||
} |
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