Skip to content

Quotes are always stripped from example string values #42

@jahn-junior

Description

@jahn-junior

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

Consider the following field:

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

myField: one
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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions