Originally created by @linux-china on GitHub (Mar 1, 2024).
I have the schema as following:
```
server: Server
class Server {
endpoints: Listing<Endpoint>
}
class Endpoint {
name: String
port: UInt16(isBetween(1024, 65535))
}
```
and configuration:
```
server {
endpoints {
new {
name = "localhost"
port = 8080
}
new {
name = "demo"
port = 8080
}
}
}
```
when run `pkl eval -f properties application.pkl` and got the stackstrace:
```
– Pkl Error ––
Cannot render value of type `Listing` as Properties.
Value: new Listing { ?; ? }
```
I think pkl properties render could adopt list style.
```
foo.bar[0]="a"
foo.bar[1]="b"
foo.demo[0].host="localhost"
foo.bar[0].port=8080
```
It's not clear how one would want a List/Listing rendered to properties.
A foo = List(1, 2, 3) could as well be rendered as foo=1, 2, 3.
That's why you should use a converter to decide how you want these classes to be handled.
@stackoverflow commented on GitHub (Mar 1, 2024):
It's not clear how one would want a `List`/`Listing` rendered to properties.
A `foo = List(1, 2, 3)` could as well be rendered as `foo=1, 2, 3`.
That's why you should use a converter to decide how you want these classes to be handled.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @linux-china on GitHub (Mar 1, 2024).
I have the schema as following:
and configuration:
when run
pkl eval -f properties application.pkland got the stackstrace:I think pkl properties render could adopt list style.
@stackoverflow commented on GitHub (Mar 1, 2024):
It's not clear how one would want a
List/Listingrendered to properties.A
foo = List(1, 2, 3)could as well be rendered asfoo=1, 2, 3.That's why you should use a converter to decide how you want these classes to be handled.