Open jannyHou opened 4 years ago
Another possibility would be to assign weight variable to each enhancer for fine control. Not sure how necessary it is though.
Since this issue is nice-to-have, I'm going to remove this from the epic https://github.com/strongloop/loopback-next/issues/4391 which is target for Q2.
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS
file at the top-level of this repository. This issue will be closed within 30 days of being stale.
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS
file at the top-level of this repository. This issue will be closed within 30 days of being stale.
Suggestion
See discussion in https://github.com/strongloop/loopback-next/pull/4258#discussion_r355542472, when load spec enhancers, people should be able to specify order for them.
A proposal would be using a combination of group and alphabet order like how we load observers group by group in https://loopback.io/doc/en/lb4/Life-cycle.html#observer-groups.
Use Cases
When define an enhancer, you can specify the
tag
in the binding template like@bind(asSpecEnhancer({CoreTags.OAS_SPEC_ENHANCER_GROUP: 'path'}))
Then specify the enhancer order like:
please note this is just a proposal, the story owner can think of better design to provide the group name and specify the group order through
options
For enhancers in the same group, they are loaded according to the name(alphabetically)
Examples
Define a path spec enhancers with tag
path
and a component enhancer with tagcomponent
Then specify the enhancer order like:
Acceptance criteria