Skip to content

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

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

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

Conversation

@shewer

@shewer shewer commented May 4, 2024

Copy link
Copy Markdown
Contributor

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