Copied.
Obtaining the Code Navigation Outline
Function
This API is used to obtain the code navigation outline.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
No identity policy-based permission required for calling this API.
URI
GET https://{hostURL}/v4/repositories/{repository_id}/repository/nav/outline
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| repository_id | Yes | Integer | Definition You can call the API used to query all repositories of the user to query the project list to obtain the repository ID. Constraints N/A Default Value N/A Value range: 1~2147483647 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| revision | No | String | Definition Version commit ID. Range N/A |
| ref | No | String | Definition Reference, which can be a branch name, label name, or commit ID. If this parameter is not transferred, the default branch is used. Range 1–2,000 characters. |
| language | Yes | String | Definition Coding language. Range |
| blob | Yes | String | Definition Blob file ID. You can call the API used to query file information of a repository to query the file information of a repository to obtain the ID. Range N/A |
| file_path | Yes | String | Definition File path. Range 1–10,000 characters. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. You can obtain the token by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. Constraints N/A Range A string that can contain 1 to 100,000 characters. Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| result | String | Definition Result identifier. Constraints N/A |
| message | String | Definition Result message. Constraints N/A |
| file_path | String | Definition File path. Constraints N/A |
| revision | String | Definition Version number (commit ID). Constraints N/A |
| symbols | Array of SymbolNodeDto objects | Definition Symbol list. Constraints N/A |
| Parameter | Type | Description |
|---|---|---|
| def | DefEntryDto object | Definition Code navigation information about def statements. |
| children | Array of SymbolNodeDto objects | Definition Subnode information. |
| Parameter | Type | Description |
|---|---|---|
| tag_name | String | Definition Label name. Constraints N/A |
| file_path | String | Definition File path. Constraints N/A |
| blob | String | Definition Blob file ID. Constraints N/A |
| line_image | String | Definition Brief content in the index row. Constraints N/A |
| line_number | Integer | Definition Row No. Constraints N/A |
| range | String | Definition Range information. Constraints N/A |
| syntax_type | String | Definition Syntax type. Constraints N/A |
| revision | String | Definition Version number (commit ID). Constraints N/A |
| extend | String | Definition Other information. Constraints N/A |
Example Requests
GET https://{endpoint}/v4/repositories/123/repository/nav/outline?file_path=Demo.java&project_id=324&ref=master&language=java&blob=4df51a22adc9xxxb9cd328385db6de14e Example Responses
Status code: 200
OK
{
"result" : "0",
"message" : "",
"file_path" : "Test.java",
"revision" : "23af980a11c164fxxxx3c9e4b8e3f25ba5c9c3aa",
"symbols" : [ {
"def" : {
"tag_name" : "JacksonUtils",
"file_path" : "Test.java",
"blob" : "69db78cd4b81xxx214838149771852e7f7da71",
"line_image" : "public class JacksonUtils {",
"line_number" : 25,
"range" : "23-82",
"syntax_type" : "class",
"revision" : "23af980a11c164f9c1d3c9e4b8e3f25ba5c9c3aa",
"extend" : ""
},
"children" : [ {
"def" : {
"tag_name" : "toJson",
"file_path" : "Test.java",
"blob" : "69db78cd4b81exxx838149771852e7f7da71",
"line_image" : "public static String toJson(Object object) ",
"line_number" : 34,
"range" : "33-41",
"syntax_type" : "method",
"revision" : "23af980a11cxxxd3c9e4b8e3f25ba5c9c3aa",
"extend" : ""
},
"children" : null
}, {
"def" : {
"tag_name" : "fromJson",
"file_path" : "Test.java",
"blob" : "69db78cd4b81eb82xxx771852e7f7da71",
"line_image" : "public static <T> T fromJson(String json, lass<T> clazz) {",
"line_number" : 51,
"range" : "50-58",
"syntax_type" : "method",
"revision" : "23af980a11c164f9c1d3c9e4b8e3f25ba5c9c3aa",
"extend" : ""
},
"children" : null
}, {
"def" : {
"tag_name" : "fromJsonToList",
"file_path" : "Test.java",
"blob" : "69db78cd4b81xxx38149771852e7f7da71",
"line_image" : "public static <T> List<T> fromJsonToList(String json, lass<T> clazz) {",
"line_number" : 68,
"range" : "67-81",
"syntax_type" : "method",
"revision" : "23af980a11c164f9c1d3c9e4b8e3f25ba5c9c3aa",
"extend" : ""
},
"children" : null
} ]
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot