params-extractor.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. ---
  2. swagger: '2.0'
  3. info:
  4. version: 1.0.0
  5. title: GeoServer Parameter Extractor
  6. description: A parameter extractor rule allows specific request parameters as URL path fragments instead of using the query string. A echo parameter makes sure that certain URL paratemers are added to the capabilities documents backlinks.
  7. contact:
  8. name: GeoServer
  9. email: 'geoserver-users@osgeo.org'
  10. url: 'https://geoserver.org/comm/'
  11. host: localhost:8080
  12. basePath: /geoserver/rest
  13. paths:
  14. /params-extractor/echoes:
  15. get:
  16. operationId: getEchoParameters
  17. tags:
  18. - "ParamsExtractor"
  19. summary: Get a list of echo parameters
  20. description: List all echo parameters currently configured. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/datastores.xml" for XML)
  21. produces:
  22. - application/xml
  23. - application/json
  24. responses:
  25. 200:
  26. description: OK
  27. schema:
  28. $ref: "#/definitions/EchoParameters"
  29. examples:
  30. application/xml: |
  31. <EchoParameters>
  32. <EchoParameter>
  33. <id>0</id>
  34. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/params-extractor/echoes/0.xml" rel="alternate" type="application/atom+xml"/>
  35. </EchoParameter>
  36. </EchoParameters>
  37. application/json: |
  38. {"EchoParameters": {"EchoParameter": [
  39. {
  40. "id": 0,
  41. "href": "http://localhost:8080/geoserver/rest/params-extractor/echoes/0.json"
  42. }
  43. ]}}
  44. post:
  45. operationId: postEchoParameter
  46. tags:
  47. - "ParamsExtractor"
  48. summary: Create a new echo parameter
  49. description: Adds a new echo parameter
  50. parameters:
  51. - $ref: '#/parameters/echoBodyParameter'
  52. consumes:
  53. - application/xml
  54. - application/json
  55. responses:
  56. 201:
  57. description: Created
  58. schema:
  59. type: string
  60. headers:
  61. Location:
  62. description: URL where the newly created echo parameter can be found
  63. type: string
  64. /params-extractor/echoes/{parameterId}:
  65. get:
  66. operationId: getEchoParameter
  67. tags:
  68. - "ParamsExtractor"
  69. summary: Retrieve a particular echo parameter definition
  70. description: Controls a particular echo parameter. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/echos/{parameterId}.xml" for XML).
  71. produces:
  72. - application/xml
  73. - application/json
  74. parameters:
  75. - name: parameterId
  76. in: path
  77. required: true
  78. description: The identifier of the echo parameter to retrieve.
  79. type: string
  80. responses:
  81. 200:
  82. description: OK
  83. schema:
  84. $ref: "#/definitions/EchoParameter"
  85. examples:
  86. application/xml: |
  87. <EchoParameter activated="true" id="0" parameter="CQL_FILTER"/>
  88. application/json: |
  89. {"EchoParameter": {
  90. "id": 0,
  91. "parameter": "CQL_FILTER",
  92. "activated": true
  93. }}
  94. put:
  95. operationId: putEchoParameter
  96. tags:
  97. - "ParamsExtractor"
  98. summary: Modify an echo parametr
  99. description: Modify an echo parameter
  100. parameters:
  101. - name: parameterId
  102. in: path
  103. required: true
  104. description: The identifier of the echo parameter to retrieve.
  105. type: string
  106. - $ref: '#/parameters/echoBodyParameter'
  107. consumes:
  108. - application/xml
  109. - application/json
  110. responses:
  111. 200:
  112. description: The echo parameter was successfully updated.
  113. delete:
  114. operationId: deleteEchoParameter
  115. tags:
  116. - "ParamsExtractor"
  117. summary: Delete an echo parameter
  118. description: Deletes an echo parameter from the configuration
  119. parameters:
  120. - name: parameterId
  121. in: path
  122. required: true
  123. description: The identifier of the echo parameter to retrieve.
  124. type: string
  125. responses:
  126. 200:
  127. description: OK
  128. /params-extractor/rules:
  129. get:
  130. operationId: getRules
  131. tags:
  132. - "ParamsExtractor"
  133. summary: Get a list of rules
  134. description: List all rules currently configured. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/datastores.xml" for XML)
  135. produces:
  136. - application/xml
  137. - application/json
  138. responses:
  139. 200:
  140. description: OK
  141. schema:
  142. $ref: "#/definitions/Rules"
  143. examples:
  144. application/xml: |
  145. <Rules>
  146. <Rule>
  147. <id>0</id>
  148. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/params-extractor/rules/0.xml" rel="alternate" type="application/atom+xml"/>
  149. </Rule>
  150. </Rules>
  151. application/json: |
  152. {"Rules": {"Rule": [
  153. {
  154. "id": 0,
  155. "href": "http://localhost:8080/geoserver/rest/params-extractor/rules/0.json"
  156. }
  157. ]}}
  158. post:
  159. operationId: postRule
  160. tags:
  161. - "ParamsExtractor"
  162. summary: Create a new rule
  163. description: Adds a new rule
  164. parameters:
  165. - $ref: '#/parameters/ruleBodyParameter'
  166. consumes:
  167. - application/xml
  168. - application/json
  169. responses:
  170. 201:
  171. description: Created
  172. schema:
  173. type: string
  174. headers:
  175. Location:
  176. description: URL where the newly created rule can be found
  177. type: string
  178. /params-extractor/rules/{ruleId}:
  179. get:
  180. operationId: getRule
  181. tags:
  182. - "ParamsExtractor"
  183. summary: Retrieve a particular rule definition
  184. description: Controls a particular rule . Use the "Accept:" header to specify format or append an extension to the endpoint (example "/echos/{parameterId}.xml" for XML).
  185. produces:
  186. - application/xml
  187. - application/json
  188. parameters:
  189. - name: ruleId
  190. in: path
  191. required: true
  192. description: The identifier of the rule to retrieve.
  193. type: string
  194. responses:
  195. 200:
  196. description: OK
  197. schema:
  198. $ref: "#/definitions/Rule"
  199. examples:
  200. application/xml: |
  201. <Rule activated="true" id="0" parameter="cql_filter" position="3" remove="1" transform="seq='$2'"/>
  202. application/json: |
  203. {"Rule": {
  204. "id": 0,
  205. "activated": true,
  206. "position": 3,
  207. "parameter": "cql_filter",
  208. "transform": "seq='$2'",
  209. "remove": 1
  210. }}
  211. put:
  212. operationId: putRule
  213. tags:
  214. - "ParamsExtractor"
  215. summary: Modify a rule
  216. description: Modify a rule
  217. parameters:
  218. - name: ruleId
  219. in: path
  220. required: true
  221. description: The identifier of the echo parameter to retrieve.
  222. type: string
  223. - $ref: '#/parameters/ruleBodyParameter'
  224. consumes:
  225. - application/xml
  226. - application/json
  227. responses:
  228. 200:
  229. description: The rule was successfully updated.
  230. delete:
  231. operationId: deleteRule
  232. tags:
  233. - "ParamsExtractor"
  234. summary: Delete a rule
  235. description: Deletes a rule from the configuration
  236. parameters:
  237. - name: ruleId
  238. in: path
  239. required: true
  240. description: The identifier of the rule to retrieve.
  241. type: string
  242. responses:
  243. 200:
  244. description: OK
  245. parameters:
  246. echoBodyParameter:
  247. name: body
  248. in: body
  249. schema:
  250. $ref: '#/definitions/EchoParameter'
  251. ruleBodyParameter:
  252. name: body
  253. in: body
  254. schema:
  255. $ref: '#/definitions/Rule'
  256. definitions:
  257. EchoParameters:
  258. title: Echo parameter links list
  259. type: array
  260. items:
  261. title: echoParameterListItem
  262. type: object
  263. properties:
  264. id:
  265. type: string
  266. description: Identifeir of the echo paameter
  267. link:
  268. type: string
  269. description: URL to the echo parameter definition
  270. EchoParameter:
  271. title: EchoParameter
  272. type: object
  273. properties:
  274. id:
  275. type: string
  276. description: identifier of the echo parameter
  277. parameter:
  278. type: string
  279. description: The parameter name
  280. activated:
  281. type: boolean
  282. description: Whether or not the parameter echoing is active
  283. Rules:
  284. title: Rule link list
  285. type: array
  286. items:
  287. title: ruleListItem
  288. type: object
  289. properties:
  290. id:
  291. type: string
  292. description: Identifeir of the rule
  293. link:
  294. type: string
  295. description: URL to the rule definition
  296. Rule:
  297. title: Rule
  298. type: object
  299. properties:
  300. id:
  301. type: string
  302. description: identifier of the rule
  303. activated:
  304. type: boolean
  305. description: Whether or not the parameter echoing is active
  306. position:
  307. type: integer
  308. description: The position of the URL base path element to be selected
  309. parameter:
  310. type: string
  311. description: The name of the parameter produced by this rule
  312. transform:
  313. type: string
  314. description: Expression that defines the value of the parameter, use {PARAMETER} as a placeholder for the selected path element
  315. match:
  316. type: string
  317. description: Regex match expression with groups, for example ^(?:/[^/]*){3}(/([^/]+)).*$ selects the URL base path third element
  318. activation:
  319. type: string
  320. description: If defined this rule will only be applied to URLs that match this regex expression
  321. remove:
  322. type: integer
  323. description: The match expression group to be removed from URL, by default 1
  324. combine:
  325. type: string
  326. description: Defines how to combine parameter existing value ($1 existing value, $2 new value), by default the value is overridden