Skip to content

Add Method to Service

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

Adds a method to a registered service.

Path parameters

Parameter Description Type Required/ Optional
name The name of the service to add the method to. string Required.

Request body

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

Parameter Description Type Required/ Optional
operationName The action or purpose of the method. string Required.
description A description of the method. string Optional.
methodName The method name for the endpoint. string Optional.
methodType The method type. Supported values for HTTP:
  • GET
  • POST
  • PUT
  • DELETE
  • PATCH
Supported values for gRPC:
  • UNARY
  • SERVER_STREAMING
  • CLIENT_STREAMING
  • BIDIRECTIONAL_STREAMING
string Optional.
accept The accept header required by the HTTP server. For example, application/json. string Optional.
requestContentType The request content-type for the HTTP server. For example, application/json. string Optional.
responseContentType The response content-type for the HTTP server. For example, application/json. string Optional.
inputType The input schema for the service. string Optional.
outputType The output schema for the service. string Optional.
deprecated Whether this method is deprecated. boolean Optional.

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.