-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-wadl.xml
207 lines (172 loc) · 10.2 KB
/
sample-wadl.xml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:apigee="http://api.apigee.com/wadl/2010/07/"
xmlns="http://wadl.dev.java.net/2009/02"
xsi:schemaLocation="http://wadl.dev.java.net/2009/02 http://apigee.com/schemas/wadl-schema.xsd http://api.apigee.com/wadl/2010/07/ http://apigee.com/schemas/apigee-wadl-extensions.xsd">
<!-- Base defines the domain and base path of the endpoint -->
<resources base="http://api.mydomain.com/1">
<!-- A simple resource with a GET method -->
<resource path="/resource1">
<!-- Resources that are the same but have multiple verbs can have multiple method items in the WADL. -->
<!-- Methods should each have a unique id. -->
<!-- The attribute displayName can be used to control the name that appears in the list in the Console. -->
<method id="method1" name="GET" apigee:displayName="Method 1">
<!-- Tags are used to organize the list of methods. Primary tag will list the default placement. -->
<apigee:tags>
<apigee:tag primary="true">Group 1</apigee:tag>
<apigee:tag>Tag 2</apigee:tag>
</apigee:tags>
<!-- Is authentication required for this method? -->
<apigee:authentication required="false"/>
<!-- Example element is used to specify the sample URL to display in the Console's request URL field. -->
<!-- Note: This is not used by the new Console -->
<apigee:example url="/resource1"/>
<!-- The content of the doc element is shown as a tooltip in the Console's method list. -->
<doc apigee:url="http://api.mydomain.com/doc/resource1/method1">
A simple GET method.
</doc>
</method>
</resource>
<!-- A resource with a GET method that requires a template parameter, a query parameter and a header -->
<resource path="/resource2.{format}">
<!-- If a param is required, specify so. Default values can also be supplied. -->
<!-- A "query" style denotes a query parameter. "header" is a common alternative. -->
<param name="format" required="true" type="xsd:string" style="template" default="json">
<!-- Docs are optional, but recommended. -->
<doc>Response format.</doc>
<option value="json" mediaType="application/json"/>
<option value="xml" mediaType="application/xml"/>
</param>
<param name="param1" required="true" type="xsd:string" style="query" default="12345">
<doc>
Parameter description.
</doc>
</param>
<param name="header1" required="true" type="xsd:string" style="header" default="12345">
<doc>
Parameter description.
</doc>
</param>
<method id="method2" name="GET" apigee:displayName="Method 2">
<apigee:tags>
<apigee:tag primary="true">Group 1</apigee:tag>
</apigee:tags>
<apigee:authentication required="true"/>
<apigee:example url="/resource2.{format}"/>
<doc apigee:url="http://api.mydomain.com/doc/resource2/method1">
A GET method that requires a template parameter, a query parameter and a header.
</doc>
</method>
</resource>
<!-- A resource with a POST method that takes an XML payload. -->
<resource path="/resource3.{format}">
<param default="json" name="format" required="true" style="template" type="xsd:string">
<doc>Response format.</doc>
<option mediaType="application/json" value="json"/>
<option mediaType="application/xml" value="xml"/>
</param>
<method id="method3" name="POST" apigee:displayName="Method 3">
<apigee:tags>
<apigee:tag primary="true">Group 2</apigee:tag>
</apigee:tags>
<apigee:authentication required="false"/>
<apigee:example url="/resource3.{format}"/>
<doc apigee:url="http://api.mydomain.com/doc/resource3/method1">
A POST method that takes an XML payload.
</doc>
<!-- This section captures parameters and body content specific to this method. -->
<request>
<!-- This parameter is applicable only for this method; while those defined at the resource level are applicable for all methods of the resource -->
<param name="param1" required="true" type="xsd:string" style="query" default="12345">
<doc>
Parameter description.
</doc>
</param>
<!-- This section contains the body representation, e.g. form-encoded parameters, an XML/JSON payload, an attachment etc. -->
<representation>
<!-- This section describes the body content, i.e. the payload. -->
<!-- Set required to true to indicate the content as mandatory in the Console -->
<apigee:payload required="true">
<!-- Docs are optional, but recommended. -->
<doc apigee:url="http://api.mydomain.com/doc/resource3/method1">
Content description.
</doc>
<!-- Body content. -->
<apigee:content>
<![CDATA[
- <sample>
- <body>
- content testing
- </body>
- </sample>
- ]]>
</apigee:content>
</apigee:payload>
</representation>
</request>
</method>
</resource>
<!-- A resource with a PUT method that takes form-encoded parameters in the body of the request. -->
<resource path="/resource4.{format}">
<param default="json" name="format" required="true" style="template" type="xsd:string">
<doc>Response format.</doc>
<option mediaType="application/json" value="json"/>
<option mediaType="application/xml" value="xml"/>
</param>
<method id="method4" name="PUT" apigee:displayName="Method 4">
<apigee:tags>
<apigee:tag primary="true">Group 2</apigee:tag>
</apigee:tags>
<apigee:authentication required="false"/>
<apigee:example url="/resource4.{format}"/>
<doc apigee:url="http://api.mydomain.com/doc/resource4/method1">
A PUT method that takes form-encoded parameters in the body of the request.
</doc>
<request>
<!-- This section contains the body representation, e.g. form-encoded parameters, an XML/JSON payload, an attachment etc. -->
<representation>
<!-- Specify parameters that need to go as part of the request body -->
<param name="param2" required="true" type="xsd:string" style="query" default="12345">
<doc>
Parameter description.
</doc>
</param>
</representation>
</request>
</method>
</resource>
<!-- A resource with a PUT method that takes an image attachment. -->
<resource path="/resource5.{format}">
<param default="json" name="format" required="true" style="template" type="xsd:string">
<doc>Response format.</doc>
<option mediaType="application/json" value="json"/>
<option mediaType="application/xml" value="xml"/>
</param>
<method id="method5" name="PUT" apigee:displayName="Method 5">
<apigee:tags>
<apigee:tag primary="true">Group 2</apigee:tag>
</apigee:tags>
<apigee:authentication required="false"/>
<apigee:example url="/resource5.{format}"/>
<doc apigee:url="http://api.mydomain.com/doc/resource5/method1">
A PUT method that takes an image attachment.
</doc>
<request>
<!-- This section contains the body representation, e.g. form-encoded parameters, an XML/JSON payload, an attachment etc. -->
<representation>
<!-- This section describes the attachments for a method. Currently, the Console only supports one attachment. -->
<apigee:attachments>
<!-- The name attribute, which is mandatory, determines the name populated in the Console and also the MIME part name. -->
<!-- The required attribute, which is optional, is set to true to indicate the attachment as mandatory in the Console. -->
<!-- The contentDisposition attribute, which is optional, sets the Content-Disposition header in the generated MIME request.
Some MIME request processors expect the Content-Disposition to be "attachment", while some expect it to be "form-data". -->
<apigee:attachment name="image" required="true" contentDisposition="form-data">
<doc>Attachment description.</doc>
</apigee:attachment>
</apigee:attachments>
</representation>
</request>
</method>
</resource>
</resources>
</application>