Giải pháp chuyển đổi số trọn gói cho doanh nghiệp Việt

Tạo file cars.xml - Xây dựng API frontend quản lý Car bằng server nodejs

Xây dựng API frontend quản lý Car bằng server nodejs

← Toàn bộ tài liệu


Bước 6.1: Tạo file cars.xml

Bài 6/20 Xem dạng sách

Tên file: cars.xml

Nơi lưu file: apps/ecommerce/api_doc

Nội dung file:

<?xml version="1.0" encoding="utf-8"?>
<list_api>
<scope type="get" route="/limit/{limit}/start/{start}" authorization="false">
<content summary="get list car" description="get list car" type="list">
<parameters name="Content-Type" type="string" required="true" in="header" example="application/json" />
<parameters name="Authorization" type="string" required="true" in="header" example="Bearer 123" />
<parameters name="api_key" type="string" in="path" example="20" />
<parameters name="limit" type="number" in="path" example="20" />
<parameters name="start" type="number" in="path" example="0" />
</content>
</scope>

<scope type="get" route="/{id}" authorization="false">
<content summary="get car by id" description="get car id" type="item">
<parameters name="Content-Type" type="string" required="true" in="header" example="application/json" />
<parameters name="Authorization" type="string" required="true" in="header" example="Bearer 123" />
<parameters name="id" type="string" description="id" in="path" example="" />
</content>
</scope>
</list_api>

Sơ đồ quan hệ các bảng

Table Name: {{table.name}}
Num Name Type
{{field_index+1}}
{{field.name}} {{field.type}}

Hỏi đáp

Gửi với tên {{comment_full_name}}

Chưa có câu hỏi nào cho bài này.

Zalo 0936.006.058 Hotline 0936.006.058