Skip to content

add new feature of Schema( "") to open default.yaml#334

Open
shewer wants to merge 1 commit intohchunhui:masterfrom
shewer:patch-21
Open

add new feature of Schema( "") to open default.yaml#334
shewer wants to merge 1 commit intohchunhui:masterfrom
shewer:patch-21

Conversation

@shewer
Copy link
Copy Markdown
Contributor

@shewer shewer commented May 4, 2024

Schema('') == Schema('.default')

-- 取得 default.yaml:/schema_list 所有 schema_id
local  schema= Schema('')
local size = schema.config:get_list('schema_list').size
local schemas_id={}
for i = 0, size-1 do 
   local path = ("schema_list/@%d/schema"):format(i)
   table.insert(schema_id ,  schema.config:get_string( path ) )
end
print(  table.concat(schemas_id, "\n") )
---

Schema('')  ==  Schema('.default') 
```lua
-- 取得 default.yaml:/schema_list 所有 schema_id
local  schema= Schema('')
local size = schema.config:get_list('schema_list').size
local schemas_id={}
for i = 0, size-1 do 
   local path = ("schema_list/@%d/schema"):format(i)
   table.insert(schema_id ,  schema.config:get_string( path ) )
end
print(  table.concat(schemas_id, "\n") )
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant