參數與契約
參數與契約的可用範例與撰寫介面。
API 輸入的識別字、型別與說明需要完整閱讀寬度時,請使用 DocumentParameters。必要與選填狀態都用文字表示,兩者都不是驗證控制項。巢狀路徑保留完整名稱,並說明父項已提供時的必填條件。
- class
Name stringRequired One complete class, including any selector or condition suffix.
- modestringOptional
Use the active manifest’s default behavior when omitted.
- range.start.characterintegerRequired when parent is provided
Zero-based UTF-16 code-unit offset. Keep the full path visible so readers can build the correct request object.
完整輸入結構描述
{ "type": "object", "properties": { "className": { "type": "string", "minLength": 1 } }, "required": ["className"]}展開的補充細節
原生可展開區塊將補充內容保留在文件中,讓讀者使用鍵盤展開或收合。必要指示應放在可展開區塊之外。
<DocumentParameters label="Parameters" parameters={[ { name: 'className', type: 'string', requirement: 'Required', description: 'One complete class.' }]} /><DocumentDisclosure title="Complete input schema"> <Code lang="json">{schema}</Code></DocumentDisclosure>兩種元件都應放在文件流中、示範版面之外。參數清單為空時,用一般句子說明。長程式碼可在展開區塊內捲動,參數說明則自然換行。即使頁面起初將其收合,可攜 Markdown 與搜尋仍須保留完整契約。