dove: service.options with scoped adapter-options #2878
fratzinger
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Where I came from:
I wanted to add the json
schema
to the service, so I would have add it to theservice.options
.I use
sql
and knex.js and started typingnew Service({ ...
and saw that it hadschema
available. I 💯 would have mistaken it to be the json schema.The knex.js adapter uses three options:
Model
,name
andschema
.While
Model
is somehow clear, what does the other two even mean? To answer that, I had to take a look in the docs.What I'm suggesting:
Use adapter-specific options within the adapter key:
service.options.knex
. So it becomes:This has several advantages:
services.filter(service => !!service.options.knex)
schema
is free for the json schema.context.params.knex
I know that would be a breaking change. At least I wanted to open a discussion about it, though.
Beta Was this translation helpful? Give feedback.
All reactions