Closed patrycju closed 6 months ago
Hello @patrycju. Thank you very much for your feedback. Currently, the API only returns named schema types for schema instances. Can you provide me with some more specific scenarios? For example, do you want to obtain the types of all instances or the values after running.
Additionally, PR is welcome. If not, I will probably implement it and release a new v0.8.6 version next week.
Hey @Peefy, hope you're going well. What I essentially need is to load all instances (named and not named) of all schemas (e.g. all Dirs, Files, Socket) into their corresponding structs in Go. I can't use JSON/YAML output as it does not have Schema name information, so as far as I know, the only way is to use GetSchemaType[Mapping] and somehow map schemas and the values from JSON.
Is there a way to do this in the SDK?
Make sense. You can use the 'WithFullTypePath' option to get all schema type instance names in the 'Run' API. And use the GetSchemaTypeMapping to get the type information.
WithFullTypePath
works like a charm, thanks! Issue can be closed.
Thank you! ❤
Bug Report
When schema instances are created without identifier (e.g. as an element of list or without assigning it to any name), they are ignored by GetSchemaType and GetSchemaTypeMapping functions.
1. Minimal reproduce step (Required)
KCL file:
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your KCL components version? (Required)
KCL go SDK v0.8.5