Closed mzeitlin11 closed 2 months ago
There's another question which doesn't need to be answered here around usage of Unknown as a fallback so that added enum variants are not a breaking change for parsing.
I have no strong opinions here. I am tempted to say that if you update your stripe API version you should make sure this library is updated to handle it but I don't think that adding variants is considered a breaking change... I think we could bring the threshhold down a little, perhaps down to 4 or 6, or maybe always insert Unknown for 'regular' enums (as opposed to tagged variants with associated data). I have a feeling most of the churn will come from 'this field has n string values' rather than fundamental differences in response type.
I will open a ticket on the project and lets move on.
After using this, I realized a couple issues
from_str(s)?
reminded me()
as the error type forFromStr
is terrible since it doesn't implError
orDisplay
.Unknown
can have an infallibleFromStr
.from_str
and deserialization did not match.There's another question which doesn't need to be answered here around usage of
Unknown
as a fallback so that added enum variants are not a breaking change for parsing.The
openapi
code currently uses the completely unscientific value of12
variants for determining whenUnknown
should be inserted - there's probably an argument for usingUnknown
on smaller enums than that (or always, but that might start to hurt ergonomics for pretty stable enums).