Comments (4)
Very coincidental that you've opened this. Over the weekend I published difunc. It uses esprima
which handles arrow functions (the current solution does not).
While object destructuring works great for shortening code, it doesn't validate that the dependency you're wanting to use is actually defined.
from open-api.
Very coincidental that you've opened this. Over the weekend I published difunc. It uses esprima which handles arrow functions (the current solution does not).
... and the entire babel runtime apparently. You'll probably find yourself updating regexes with every new JS runtime that comes out.
While object destructuring works great for shortening code, it doesn't validate that the dependency you're wanting to use is actually defined.
I don't find this to be a problem, and at a higher level I believe it to be fighting the nature of JS. Module tests are good enough for me.
Hmm... given that you just authored a project just for introspective dependency injection, I don't think we're ever going to agree on this topic. I wish you well, but at this point it's clear to me that I need to go in a different direction.
BTW, I was attracted to the word "unopinionated" when picking an openapi framework last week. IMHO, dep injection magic and forced directory layouts are not unopinionated. Might just want to embrace the opposite terminology.
from open-api.
I don't think we're ever going to agree on this topic. I wish you well, but at this point it's clear to me that I need to go in a different direction.
There are less abrasive means of engaging in dialog on github for an open source project that a maintainer is voluntarily donating their time to. I'm not opposed to any of your ideas. I appreciate you for raising your concerns. My goal is to make the framework better for everyone.
BTW, I was attracted to the word "unopinionated" when picking an openapi framework last week. IMHO, dep injection magic and forced directory layouts are not unopinionated. Might just want to embrace the opposite terminology.
- I'm not opposed to object destructuring. I just hadn't considered it as an option. And just because I published a package (
difunc
), doesn't mean I'm 100% sold on using it. - I agree that babel-runtime is a non-starter. I'll remove that from
difunc
so it's not required. - For me the danger in destructuring is the potential to unknowingly break your API by removing a dependency in
.initialize
. Up until now, users ofexpress-openapi
who've used the DI feature have had some level of confidence knowing that the framework has their back in terms of ensuring that the dependency is defined. With object destructuring there's no way to provide that guarantee. Stability is a priority for this framework. - There's nothing forcing people to use DI. Going with object destructuring is just as opinionated as supporting angular style DI. There's also nothing stopping you from defining api documentation in the global api doc. This was added recently. I'm also open to PRs that provide support for wiring up the handlers through operation name or some other means.
from open-api.
See #96
from open-api.
Related Issues (20)
- Allow openapi-types extensions of other things than `OperationObject` HOT 1
- [openapi-schema-validator] Add support for OAS v3.1.0 schema HOT 6
- Load `.ts` route file HOT 6
- Quick Question: Can we parse a list of param in a PostgREST format ?
- [express-openapi] How to integrate with passport-azure-ad?
- Invalid query validation when using oneOf
- openapi-request-validator doesn't validate JSON objects given in headers or query params HOT 1
- Type 'string' is not assignable to type 'NonArraySchemaObjectType | undefined'. HOT 4
- [express-openapi] How to open the swagger UI web interface? HOT 1
- express-openapi: Unclear how to validate successful completion of tutorial HOT 5
- pnpm and glob issue in express-openapi
- Add application/json content type support in openapi-request-coercer
- Add support for `prefixItems` HOT 3
- SyntaxError: Invalid regular expression during path-to-regexp conversion HOT 4
- openapi-framework: fixed windows path names HOT 4
- [enhancement] openapi-response-validator: native ESM node modules default export not working as intended HOT 3
- [ft. request] openapi-response-validator - allow access to response param in errorTransformer HOT 1
- Using automatic paths with ESM HOT 2
- OpenAPI Types package, Path Item Object HOT 1
- Supertest integration tests fail after update to express-openapi 12.x.x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-api.