Closed LinYunling closed 3 months ago
Hello @LinYunling
The type of attribute alias
is depended on the definition instead of the doc string. For example, if you write the definition with the optional op ?
, the doc will generate the right the form.
schema ResourceModel:
'''
Resource Model Definition
Attributes
----------
name: str, default is "", required.
The name of resource.
alias: str, default is "", optional.
The alias name of resource.
type: str, default is "string", required.
The type of resource.
Examples
----------------------
res = ResourceModel {
name = "ServerA"
alias = "My Computer"
type = "PC"
}
'''
name: str
alias?: str # Note the `?` here.
type: str
check:
type in ["PC", "Notebook", "IPad", "SmartPhone"]
Only the description is from comments ? May I define the sorting order of attributes?
The document is misleading.
Only the description is from comments ? May I define the sorting order of attributes?
alias?: str
or alias: str
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
The schema define: schema ResourceModel: ''' Resource Model Definition
''' name: str alias: str type: str
check: type in ["PC", "Notebook", "IPad", "SmartPhone"]
kcl doc generate
see the markdown file, the result is error.
2. What did you expect to see? (Required)
3. What did you see instead (Required)
like 2
4. What is your KCL components version? (Required)
0.9.0-beta.1