Skip to content

Optional Attributes are omitted on response #23

@cickes

Description

@cickes
class Item(BaseModel):
    name: str
    quantity: int
    price: float
    description: [Optional] str = "Not included"

In the database, description is stored as None for 1 object.
In the response, we expect

...
"attributes": {
    "name": "Orange",
    "quantity": "5",
    "price": "1.00",
    "description": "Not included"
}
...

Instead, description is omitted and not returned in the response. How can we include Optional attributes when they are None in the database?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions