ApiTagSection
Domain · API DocBir OpenAPI tag grubunu, altındaki endpoint satırlarıyla birlikte katlanabilir bölüm olarak gösterir.
Products
4
Product catalogue — create, read, update, delete
Products
4Product catalogue — create, read, update, delete
EndpointRow × 4
<%- include('modules/domain/api-doc/ApiTagSection', {
tag: { tagId: 'tag-products', name: 'Products', description: 'Product catalogue — create, read, update, delete' },
paths: [
{ pathItem: { pathItemId: 'pi-products', path: '/products', operations: [
{ operationId: 'list-products', operationKey: 'list-products', method: 'GET', summary: 'List products', parameters: [], responses: [] },
{ operationId: 'create-product', operationKey: 'create-product', method: 'POST', summary: 'Create product', parameters: [], responses: [] },
]}}
]
}) %>
<%
var _tag = locals.tag || {};
var _paths = locals.paths || [];
var _defaultOpen = locals.defaultOpen !== false;
var totalOps = _paths.reduce(function(acc, p) {
return acc + ((p.pathItem && p.pathItem.operations) ? p.pathItem.operations.length : 0);
}, 0);
%>
class="group">
<%= _tag.name || '' %>
<%= totalOps %>
<% if (_tag.description) { %>
<%= _tag.description %>
<% } %>
<% if (_tag.externalDocs) { %>
Docs
<% } %>
<% _paths.forEach(function(p) {
var pathItem = p.pathItem || {};
var ops = pathItem.operations || [];
ops.forEach(function(op) {
%>
<%- include('./EndpointRow', { path: pathItem.path || '', operation: op }) %>
<% });
});
%>