You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to get a nice flow of loading pkl files nicely on to the generated structs, but I was wondering if there is built-in support for loading other generated file types as well. Brute forcing it with existing tools results in errors since the generated go code often relies in interfaces and then implementations of those interfaces (at least in my use case).
I understand context is lost when it is translated to other file types and in some cases, it would be impossible to determine what struct the data corresponds to- my particular data models don't have any potential conflicts.
No problem if this isn't possible!
Also, one ugly solution I thought of is making some manual structs and relationships so the yaml can grab on to what it needs to. And also I did add yaml struct tags using the generator file.
The text was updated successfully, but these errors were encountered:
This slipped through the cracks. Apologies. I don't fully understand what you're asking. If you have yaml struct tags, you can deserialise (or, in GoSpeak, unmarshall) YAML files into your structs, no? If you want to read YAML in Pkl itself, there's a parser in the "pkl:yaml" module.
I believe those struct tags only work if you use the go-yaml library which is "sort of" unmaintained. Since Pkl has the ability to parse YAML we were looking for a way to parse YAML files straight into Go leveraging Pkl's validation and type checking
I was able to get a nice flow of loading pkl files nicely on to the generated structs, but I was wondering if there is built-in support for loading other generated file types as well. Brute forcing it with existing tools results in errors since the generated go code often relies in interfaces and then implementations of those interfaces (at least in my use case).
I understand context is lost when it is translated to other file types and in some cases, it would be impossible to determine what struct the data corresponds to- my particular data models don't have any potential conflicts.
No problem if this isn't possible!
Also, one ugly solution I thought of is making some manual structs and relationships so the yaml can grab on to what it needs to. And also I did add yaml struct tags using the generator file.
The text was updated successfully, but these errors were encountered: