REST Connect Library
home
REST Connect Library can be included in your API specification to generate a connector from your API specification properly.
REST Connect Library v1.0.2 provides several enhancements to API specs. The most used are:
- ignored: This annotation allows to specify a method which will not be transformed into an operation. Optionally, a reason can be defined.
- operationName: This annotation allows to specify a custom operation name inside the extension.
- parameterName: This annotation allows to specify a custom parameter name.
- default: Use this annotation to select a default media type for an operation body (i.e application/json).
- renewTokenExpression: Allows you to provide a DW expression used to check if the OAuth token should be renewed.
You can add the REST Connect Library to your API specification in API Designer through Dependencies. Please take a look at the following example.
#%RAML 1.0
title: Sample API
baseUri: https://jsonplaceholder.typicode.com
version: 0.1
mediaType: application/json
...
uses:
rest-connect: exchange_modules/org.mule.connectivity/rest-connect-library/1.0.2/rest-connect-library.raml
...
/posts:
get:
(rest-connect.ignored): Ignored for now.
displayName: Get posts
responses:
200:
body:
application/json:
type: PostList
/{postId}:
uriParameters:
postId: integer
get:
(rest-connect.operationName): Retrieve a single post by id
displayName: Get single post by id.
responses:
200:
body:
type: Post