forked from plimble/arlong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparser_test.go
81 lines (75 loc) · 2.14 KB
/
parser_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package arlong
import (
"github.com/kr/pretty"
"testing"
)
// @DefinitionModel
type Hello6 map[string]Hello8
// @DefinitionModel
type Hello7 Hello8
// @DefinitionModel
type Hello8 struct {
// @Description comment e
// @Required
Name string
}
// @DefinitionModel
type Hello9 struct {
c Hello8
}
// @Swagger
// @Title Api
// @Description Super api
// @Term Dont use
// @Contact name="witoo harianto" url=http://www.plimble.com [email protected]
// @License name="Apache 2.0" url=http://google.com
// @Version 1.1.1
// @Schemes http https ws
// @Consumes json xml
// @Produces json xml
// @Security petstore_auth=write:pets,read:pets
//
// @SecurityDefinition petstore_auth
// @Type oauth2
// @Flow password
// @TokenUrl http://swagger.io/api/oauth/token
// @Scopes write:pets="modify pets in your account" read:pets="read your pets"
//
// @GlobalParam userParam name=user required description="sadsadsad" in=body schema.$ref=arlong.Hello9
// @GlobalParam userParam2 name=user required description="sadsadsad" in=body schema.$ref=arlong.Hello9
//
// @GlobalResponse notFound desc="Entity not found." schema.$ref=arlong.Hello9
// @GlobalResponse notFound2 desc="Entity not found." schema.$ref=arlong.Hello9
//
// @Path /attempts
// @Method GET
// @Description Get Array of attempts
// @OperationId GetAttempts
// @Param $ref=limitQuery
// @Param $ref=skipQuery
// @Param $ref=spokenQuery
// @Param $ref=practiseQuery
// @Param $ref=userLangQuery
// @Tags attempts
// @Response 200 schema.type=array schema.items.$ref=arlong.Hello9
//
// @Path /user/jack/{id}
// @Method GET
// @Param name=id required description="sadsadsad" in=path type=string
// @Param name=user required description="sadsadsad" in=body schema.$ref=arlong.Hello9
// @Produces json
// @Consumes json
// @Summary this is summary
// @Description this is description
// @Deprecated
// @Schemes http https
// @OperationId GetStart
// @Tags a b c
// @Security petstore_auth=write:pets,read:pets
// @Response 200 desc=123123 schema.$ref=arlong.Hello9
func TestAnnotation(t *testing.T) {
parser := NewParser(".")
b, _ := parser.JSON()
pretty.Println(string(b))
pretty.Println(swagger.Definitions)
}