Skip to main content

Add Method to Service

Endpoint: POST /api/registry/service/{registryName}/methods

Adds a method to a registered service.

Path parameters

ParameterDescriptionTypeRequired/ Optional
nameThe name of the service to add the method to.stringRequired.

Request body

Format the request body as an array with the following parameters:

ParameterDescriptionTypeRequired/ Optional
operationNameThe action or purpose of the method.stringRequired.
descriptionA description of the method.stringOptional.
methodNameThe method name for the endpoint.stringOptional.
methodTypeThe method type. Supported values for HTTP:
  • GET
  • POST
  • PUT
  • DELETE
  • PATCH
Supported values for gRPC:
  • UNARY
  • SERVER_STREAMING
  • CLIENT_STREAMING
  • BIDIRECTIONAL_STREAMING
stringOptional.
acceptThe accept header required by the HTTP server. For example, application/json.stringOptional.
requestContentTypeThe request content-type for the HTTP server. For example, application/json.stringOptional.
responseContentTypeThe response content-type for the HTTP server. For example, application/json.stringOptional.
inputTypeThe input schema for the service.stringOptional.
outputTypeThe output schema for the service.stringOptional.
deprecatedWhether this method is deprecated.booleanOptional.

Response

Returns 200 OK, indicating that the method has been added successfully.

Examples

Add a method to a service

Request

curl -X 'POST' \
'https://<YOUR-SERVER-URL>/api/registry/service/petstore/methods' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"operationName": "getPetById",
"methodName": "/pet/{petId}",
"methodType": "GET",
"requestContentType": "application/json",
"responseContentType": "application/json",
"description": "Returns a single pet",
"deprecated": false
}'

Response

Returns 200 OK, indicating that the method has been added successfully.