Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Allow setting a default JSON Encoder and JSON Decoder

オープン
#1,322 コメント 1 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
api, backend

調査の方向性

まず JSONString フィールドとその serialize() メソッドを確認し、要求されているグローバル、設定ベース、フィールド単位のエンコーダーオプションを、既存の graphene-django の動作と比較します。カスタム JSON エンコーダーとデコーダーを利用できるドキュメント化された API があり、想定される設定をカバーしていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

✨ enhancement

Is your feature request related to a problem? Please describe.
I'm using graphene_django, which auto-converts model fields to JSONString, which doesn't allow customizing the JSONEncoder class. I'm doing this for some semi-hacky code where I just want to store a big blob-o-stuff, using a custom encoder to convert enums and datetimes.

PS - I'm happy to implement this! Just looking for feedback on what are reasonable modifications to API for this (if any) or if I should give up on this thread :)

Describe the solution you'd like
Allow me to specify a custom JSON encoder via some setting or a global.

Describe alternatives you've considered

  1. In my ideal world, I'd be able to pass custom encoders to specific JSON fields. (realistically, you can always merge all the JSONEncoders, so being able to specify just one is fine).
  2. serialize() no longer a static method (seems like overkill for small change)
  3. Make graphene-django create custom JSONString fields based upon jsonencoder / decoder (possible, slightly more goofy perhaps)

Additional context

主要言語
Python
スター
8.2k
フォーク
818
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphql-python/graphene のほかの issue

graphql-python/graphene の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。