Closed ohpauleez closed 8 years ago
I just landed some potential fixes on master; We should reevaluate this.
@ohpauleez any chance to have the commits reference the github issues? This would make it easier to follow along.
aac2d75ac5ddaef07ed7d85c3850ede2c72b04ac
https://github.com/cognitect-labs/vase/commit/aac2d75ac5ddaef07ed7d85c3850ede2c72b04ac#diff-3ccc7ee0d66a7ac4f495ddde20024936R20 I would recommend to make a decision about the arity of the argument. In my experience, a function that accepts an item or a list of items leads to confusion over time.
The entire top-level API consumes spec-or-specs
. There is exactly one function for each part of a full api-spec (schema/norms, specs, routes/api). Everything below this layer consumes exactly one spec.
Landed on master
The top-level Vase API supports multiple descriptors to be into the main functions. This is nice for end-users because it's common to break large descriptors down into smaller, cohesive descriptors.
Currently those functions map over the descriptors individually, but Vase injects routes and other artifacts when processing descriptors (routes like the
describe
route used to reflect the APIs back out to the user for discovery/docs). Injecting the reflection capabilities should be a separate function called from the top-level API after process routes. Additionally, in the new format, it's cleaner to merge Descriptor subsections (norms, specs, apis) -- the top-level functions should merge descriptor subsections when processing them, instead of mapping over descriptors individually.