Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Allow Configuration on Option::None handling #352

Open
bnheise opened this issue Jan 30, 2023 · 1 comment
Open

Allow Configuration on Option::None handling #352

bnheise opened this issue Jan 30, 2023 · 1 comment

Comments

@bnheise
Copy link

bnheise commented Jan 30, 2023

Currently if you have an optional field in Rust:

struct Something {
  maybe_not_there: Option<String>
}

Something {
  maybe_not_there: None
}

And you serialize it using this crate, you get this:

something
  maybe_not_there: null

However, valid yaml accepts also a tilde, no value at all, or simply omitting the key altogether.

Valid:

something
  maybe_not_there: ~

something
  maybe_not_there:

something

It would be nice if it were possible to configure the desired output.

@nim65s
Copy link

nim65s commented May 13, 2023

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants