Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

✨ Add support fordeque objects and children injsonable_encoder#9433

Merged
tiangolo merged 5 commits intofastapi:masterfrom
cranium:master
Jun 28, 2023
Merged

✨ Add support fordeque objects and children injsonable_encoder#9433
tiangolo merged 5 commits intofastapi:masterfrom
cranium:master

Conversation

@cranium
Copy link
Contributor

@craniumcranium commentedApr 24, 2023
edited
Loading

Currently, deques with pydantic models as children are not encoded byjsonable_encoder.

dq=deque([Model(test="test")])jsonable_encoder(dq)# => [Model(test="test")]

This PR addresses this by including deque along with the other iterable types (set, generator, etc)

dq=deque([Model(test="test")])jsonable_encoder(dq)# => [{"test": "test"}]

@craniumcranium changed the titlefix deque of models not encoding child typesfix jsonable_encoder not encoding child models for dequeApr 24, 2023
@github-actions
Copy link
Contributor

📝 Docs preview for commitfaafda3 at:https://64470059d8fc5b293f54d0fc--fastapi.netlify.app

@github-actions
Copy link
Contributor

📝 Docs preview for commitb81030c at:https://644ab94b383f0b00b860c4ed--fastapi.netlify.app

@tiangolo
Copy link
Member

📝 Docs preview for commit17152bb at:https://6494b2e083dfc10a6bce7973--fastapi.netlify.app

@tiangolotiangolo changed the titlefix jsonable_encoder not encoding child models for deque✨ Add support fordeque objects and children injsonable_encoderJun 28, 2023
@tiangolo
Copy link
Member

Yep, makes sense, thank you! 🚀 ☕

cranium reacted with heart emoji

@tiangolotiangolo merged commit1f21b16 intofastapi:masterJun 28, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@yezz123yezz123yezz123 approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@cranium@tiangolo@yezz123

[8]ページ先頭

©2009-2026 Movatter.jp