Closed marcandre closed 4 years ago
I don't plan on rebasing this PR in the near future.
I understand.
I'll take a look into a possible API for ranges myself. After the refactoring is complete, I need to think about further directions for the library. Really want to keep things tidy, it is already overthought at some points (for ex., response processing, as discussed here) and I feel like param(...)
DSL API starts to get out of hand, becoming one more of thousands of "typed attr DSL for Ruby" already in presence.
This PR improves handling of
param :foo, enum: 1..1000
. It also allows float enums.This builds on #21; only the last commit is new.
Note: it's not clear to me why the API allows
type: {a: 1}
,enum: {a: 1}
andenum: 1..42
but nottype: 1..42
. I find this inconsistent and would suggest to either allow it, or forbidtype: {...}
. This PR doesn't address this.