json-schema-to-case-class icon indicating copy to clipboard operation
json-schema-to-case-class copied to clipboard

"Use `Option[]` for optional parameters except collections" wanted

Open plokhotnyuk opened this issue 4 years ago • 1 comments

Currently there are 3 options:

  • Use Option[] for optional parameters
  • Use Option[] for all parameters
  • Do not use Option[]

Could you please add 4th one to avoid wrapping collections to Option[] for class fields because a lot of JSON parsers for Scala can handle missing values for them using empty collection instances.

plokhotnyuk avatar Jun 16 '20 07:06 plokhotnyuk

That would be useful. Some(Seq.empty) and None often has the same meaning, so such duality introduces ambiguity in processing code.

wajda avatar Aug 11 '22 16:08 wajda