add a setting to be less fussy about `Option` fields where `null` is not allowed
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reading the code that renders optional properties as Rust Option<T> fields and the tests covering their generated serde attributes. Add the optional_value setting with RejectNull as the default and AllowNull producing a plain Option<T> with the skip attribute. Done when tests confirm both variants generate the described code.
索引モデルが issue の本文から書いたものです。
説明
An Optional property (whose type is not an Option, a container, or the
unit type) renders as Option<T> with deserialize_some:
#[serde(
default,
deserialize_with = "::json_serde::deserialize_some",
skip_serializing_if = "::std::option::Option::is_none"
)]
pub value: ::std::option::Option<i64>,
An absend field serializes as None and null is an error. And that's
accurate! While a bare Option<T> permits null, an Optional property is
merely optional, not nullable.
However, not all people are quite as fussy, and they're used to reading
imprecise Rust code that looks like this:
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<i64>,
To produce code more like that, we can add a setting: optional_value with two
variants:
RejectNull: the rendering above. Precise, accurate and the default; it's
what typespace does today.AllowNull: a plainOption<T>with just the skip, which is serde's own
behavior--absent andnullare bothNone.
- 主要言語
- Rust
- スター
- 4
- フォーク
- 4
- 平均マージ
- 15時間 16分
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
oxidecomputer/typespace のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
oxidecomputer/typespace#47 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
add a setting to annotate generated types with its id再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 1/100
oxidecomputer/typespace#45 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 36/100
oxidecomputer/typespace#44 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
oxidecomputer/typespace#43 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
oxidecomputer/typespace#41 ·
メンテナーはふだん 1 日以内に返信
oxidecomputer/typespace の issue をすべて見る
似ている issue
-
area: cli good first issue type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
renaming a provider to a taken name fails with a raw sql error対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:storage kind:bug priority:p3 ready
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug bugfix
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
storytold/photocraft#16975 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信