REST Connect generates the names of operations based on the operationName, displayName, and endpoint attributes, in that order.
To modify a generated connector name using RAML, change the text in displayName, for example:
#%RAML 1.0
title: Sample API
baseUri: https://jsonplaceholder.typicode.com
version: 0.1
mediaType: application/json
...
/{postId}:
uriParameters:
postId: integer
get:
displayName: Get a post by ID.
responses:
200:
body:
type: Post
To modify a generated connector name using OAS, change the text in summary, for example:
openapi: 3.0.3
info:
title: Sample API
version: "0.1"
servers:
- url: https://jsonplaceholder.typicode.com
paths:
/{postId}:
parameters:
- name: postId
in: path
required: true
schema:
type: integer
get:
summary: Get a post by ID.
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/Post"
components:
schemas:
Post: {}
You can also modify a generated connector name by pointing to the REST Connect library and using the operationName annotation (RAML) or x-rest-connect-operationName extension (OAS) from a method such as GET, POST, and DELETE.
RAML Example using operationName:
#%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.0/rest-connect-library.raml
...
/{postId}:
uriParameters:
postId: integer
get:
(rest-connect.operationName): Retrieve a post by id
displayName: Get a post by ID.
responses:
200:
body:
type: Post
OAS Example using x-rest-connect-operationName:
openapi: 3.0.3
info:
title: Sample API
version: "0.1"
servers:
- url: https://jsonplaceholder.typicode.com
paths:
/{postId}:
parameters:
- name: postId
in: path
required: true
schema:
type: integer
get:
summary: Get a post by ID.
x-rest-connect-operationName: Retrieve a post by id
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Post'
components:
schemas:
Post:
type: object
additionalProperties: true