loadSpec() issues, asynchronous middleware registration
See original GitHub issueIn some cases it may not ideal to have express-openapi-validator
load and dereference the provided Open API spec on its own.
Would it be feasible for us to add support for a string or buffer argument in place of filePath
in loadSpec() which skips the JSON scheme dereferencing and calls to fs
?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Strange behaviour of async middlewares (maybe need docs)
Hi! Yesterday we got next error (maybe bug - I don't know). If we call next() in the async middleware, our handler run...
Read more >Don't get burned by missing await Calls for Async Code in ...
I recently got burned in an upgraded ASP.NET Core server application where a missing `await` statement caused wildly inconsistent and ...
Read more >Asynchronous initialization in ASP.NET Core with custom ...
Async initialization middleware. A simple way to do it involves writing a custom middleware that ensures initialization is complete before ...
Read more >Async/Await in Express Middleware - Stack Overflow
I get that async/await allows us to deal with the async code and work with the returned values easily, but in Express middleware...
Read more >ASP.NET Core Middleware | Microsoft Learn
Middleware is software that's assembled into an app pipeline to handle requests and responses. Each component:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, it’s no longer necessary – Thank you so much for your help
Update: I took a look and found out why doing this synchronously would be challenging, and why you chose
deasync
. 😄It looks thejson-schema-ref-parser
dependency is strictly async.One much better approach I found was to use
await
Instead of a non-awaited
.installSync()
. This allows my middlewares to bootstrap in the order I want.