Closed pbrisbin closed 5 months ago
I'm bumping in a few of these sorts of conversions, such as using Natural
when minimum: 0
or UUID
when format: uuid
. But I will wait for your thoughts on this one before proceeding to make more Issues.
I like this idea!
I like this idea as well! I am not sure if I get to do an implementation of this in the near future myself, so if you want to give it a try, feel free to open a PR 🙏
Great, I've got a draft PR for NonEmpty
here: https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/pull/102
Happy to poke at the other stuff I mentioned after that lands.
Hey @pbrisbin, with #102 being merged, do we want to close this issue?
Yeah, I think we should close this one. Up to you though: do you want me to open separate Issues for (e.g.) Natural
or UUID
?
I think we could also just discuss these in a respective PR, wdyt? But I am also fine with leaving this one open to keep track on them.
I think we could also just discuss these in a respective PR, wdyt?
Yeah, that works. Only downside is there's nothing tracking things if I don't get to those PRs for a while (which is likely), but that's minor so sounds good.
When I generate a spec from a Haskell server using
NonEmpty
, it addsminItems: 1
:Ideally the generator should generate a
NonEmpty ElaArticleLevel
instead of[ElaArticleLevel]
when it sees this. Currently, I have a bunch ofNE.fromList
conversions, with comments that's it's actually safe because the spec saysminItems: 1
-- but that's only true right now, and could change going forward.Hard to say what something like
minItems: 2
(for example) should do. I'd be inclined to just sayNonEmpty
for anyminItems: x | x > 0
as a good 80/20 vs getting fancier.