Skip to content

Examples are required to be strings #11

@lengau

Description

@lengau

Right now each example is required to be a string, even if the type isn't necessarily a string.

Given this input:

    build_on: list[str] | str = pydantic.Field(
        min_length=1,
        examples=[
            "amd64",
            ["arm64", "riscv64"]
        ]
    )

I would expect it to work properly. However, instead I get this exception:

Exception occurred:
File "/home/lengau/Work/Code/craft-application/.venv/lib/python3.12/site-packages/yaml/reader.py", line 178, in update_raw
data = self.stream.read(size)
^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'read'
The full traceback has been saved in /tmp/sphinx-err-ua2zgx1a.log, if you want to report the issue to the developers.

Metadata

Metadata

Assignees

No one assigned

    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