Pkl Error: Cannot render value of type `Listing` as Properties.
- Dominant language
- Java
- Stars
- 11.5k
- Forks
- 402
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 20
Description
I have the schema as following:
```
server: Server
class Server {
endpoints: Listing
}
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
```
Contributor guide
Research direction
Reproduce the failure with `pkl eval -f properties application.pkl` using the schema and configuration in the issue, then trace the Properties rendering entry point. Determine how Listing values are handled and define indexed output such as `foo.bar[0]="a"`; done means listings render without the current error and their nested values use stable indexes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100