canonical / canonical/pydantic-kitbash

Quotes are always stripped from example string values

Open
#42 0 comments 0 reactions 1 assignee Claimed by @jahn-junior View on GitHub
Dominant language
Python
Stars
3
Forks
2
Avg merge
1d 5h
Merged PRs (30d)
9

Description

PyYAML's dumper strips quotes from string values regardless of how they are passed in.

Consider the following field:

```python
myField: str = pydantic.Field(
examples=["one", "\"two\""],
)
```

Despite the escaped quotes in the second example, the examples section of this field's kitbash entry would render as:

**Examples**
```yaml
myField: one
```
```yaml
myField: two
```

I would like Kitbash to be less opinionated about how string values are formatted as YAML, as there are cases where keys should be enclosed in quotes for safety (e.g., version strings).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.