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
schemato the service, so I would have add it to theservice.options.I use
sqland knex.js and started typingnew Service({ ...and saw that it hadschemaavailable. I 💯 would have mistaken it to be the json schema.The knex.js adapter uses three options:
Model,nameandschema.While
Modelis 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)schemais free for the json schema.context.params.knexI 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