Updated on 2022-08-15 GMT+08:00

Querying a Microservice Schema

Function

This API is used to query a microservice schema based on the service ID and schema ID.

URI

GET /v4/{project_id}/registry/microservices/{serviceId}/schemas/{schemaId}

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Fixed value: default.

serviceId

String

Yes

Microservice ID, which must be unique.

The value must be 1 to 64 characters long.

Regular expression: ^.*$

schemaId

String

Yes

Schema ID.

Request

None

Response

Response parameters

Table 2 describes the parameters.

Table 2 Parameter

Parameter

Type

Description

schema

String

Microservice schema content.

Example

Example request

GET /v4/default/registry/microservices/e0f0da073f2c91e8979a89ff2d7c69t6/schemas/com.test.TestService

Example response

{"schema": "---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for com.service.provider.controller.ProviderImpl\"\n  x-java-interface: \"cse.gen.springmvc.provider.provider.ProviderImplIntf\"\nbasePath: \"/provider\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /helloworld:\n    get:\n      operationId: \"helloworld\"\n      produces:\n      - \"application/json\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n"}

Status Code

See Status Codes.

Error Code

See CSE Error Codes.