1+ /*
2+ Copyright 2023 API Testing Authors.
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+ */
16+
117package apispec
218
319import (
@@ -9,14 +25,30 @@ import (
925)
1026
1127type Swagger struct {
12- Swagger string `json:"swagger"`
13- Paths map [string ]map [string ]SwaggerAPI `json:"paths"`
14- Info SwaggerInfo `json:"info"`
28+ Swagger string `json:"swagger"`
29+ // Paths includes all the API requests.
30+ // The keys is the HTTP request method which as lower-case, for example: get, post.
31+ Paths map [string ]map [string ]SwaggerAPI `json:"paths"`
32+ Info SwaggerInfo `json:"info"`
1533}
1634
1735type SwaggerAPI struct {
18- OperationId string `json:"operationId"`
19- Summary string `json:"summary"`
36+ OperationId string `json:"operationId"`
37+ Parameters []Parameter `json:"parameters"`
38+ Summary string `json:"summary"`
39+ }
40+
41+ type Parameter struct {
42+ Name string `json:"name"`
43+ // In represents the parameter type, supported values: query, path
44+ In string `json:"in"`
45+ Required bool `json:"required"`
46+ Schema Schema `json:"schema"`
47+ }
48+
49+ type Schema struct {
50+ Type string `json:"type"`
51+ Format string `json:"format"`
2052}
2153
2254type SwaggerInfo struct {
0 commit comments