Skip to content

Serializer 'field' object is inconsistent with Struct 'field' #108

@Rey092

Description

@Rey092

Is serializer 'field' (from django_bolt.serializers import field) experimental?

class Shelf(msgspec.Struct):
      book_count: int = msgspec.field(name="bookCount")
# if i set this struct as return type for endpoint, it would use 'bookCount' for both openapi schema and response serialization

class Shelf(Serializer):
      book_count: int = field(alias="bookCount", title="bookCount")
# but if return type is a serializer - both openapi schema and response would use 'book_count'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions