Replies: 1 comment
-
Leading underscores for optional fields is fine with me. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It has been raised (by ChatGPT) that using leading _underscores to designate optional fields is non-standard and potentially confusing, and that a schema should be used instead.
My reasoning behind the underscores was, well, I kinda just used it temporarily while things out for my own clarity, but I felt it worked really well and decided to keep it.
There's no doubt a schema needs to be made, but not everyone using (both implementing and reading) the spec will always be using the schema, so even with a schema, I feel like having the simple, glanceable leading underscore indicator to denote optional fields would have value.
You can instantly tell what fields are and aren't optional as long as you know "underscore is optional".
But it is certainly "non-standard".
How do other people feel about this? Should we keep them? Or get rid of them? Why?
Beta Was this translation helpful? Give feedback.
All reactions