Comments (14)
Hi Fabriece, whatβs your problem with both plugins active on a hapi server? Can you please provide more details?
Thank your for your kind words π
from hapi-dev-errors.
Both plugins do register fine. But when errors do happen, the swagger plugin takes over and I don't get the nice stacktrace that comes from using your plugin. This is why I suggested integration with hapi-swagger, so that you do the rendering of responses and errors. Because the rendering in hapi-swagger has room for improvement.
Is this enough?
from hapi-dev-errors.
Hi Fabriece,
I'm sorry, I couldn't reproduce your issue yet. Can you please help me with more details about your setup.
- What Node.js version are you using?
- What version of
hapi-dev-errors
are you using? - What's your
hapi-dev-errors
configuration you're passing to the plugin while registering it to the server? - What version of
hapi-swagger
are you using? - What's your
hapi-swagger
configuration you're passing to the plugin while registering it to the server?
Are you using the default theme for hapi-swagger? Are the API docs generated correctly when no error occurs?
Thanks!
from hapi-dev-errors.
Swagger config:
version : 9.1.1
await server.register([
require('inert'),
require('vision'),
{
plugin: require('hapi-swagger'),
options: {
schemes: ['http', 'https'],
host: swagger.host,
info: {
'title': 'API Documentation',
'description': 'API documentation ',
'version': '0.0.1',
'termsOfService': 'terms of Service link',
'contact': {
'email': ''
}
},
jsonEditor: true,
securityDefinitions: {
'Bearer': {
'type': 'apiKey',
'name': 'Authorization',
'in': 'header'
}
},
security: [{
'Bearer ': ['']
}]
}
}
]);
hapi-dev-erros:
version 2.0.1
await server.register({
plugin: require('hapi-dev-errors'),
options: {
showErrors: Config.util.getEnv('NODE_ENV') !== 'production',
useYouch: true
}
});
Hapi version: 17.2.0
from hapi-dev-errors.
@sfabriece Thank you for the details. I'll try to reproduce the issue with your configs.
Do you register hapi-dev-errors
after hapi-swagger
?
from hapi-dev-errors.
yes I do
from hapi-dev-errors.
π alright, I'll let know you about my findings
from hapi-dev-errors.
Thanks π
from hapi-dev-errors.
@sfabriece Hey Fabriece,
did you solve your issue already?
I couldnβt reproduce it in my local setup. Can you give me a minimal project that has your issue? This way I could debug the problem there.
Thanks!
from hapi-dev-errors.
I'm currently a bit busy with a project. I'll get back to you when things cool down. Thanks for your help so far.
from hapi-dev-errors.
@sfabriece Sure, no problem. I had an idea to try another way of finding the issue. Will let you know about my testings.
from hapi-dev-errors.
I used your Swagger configuration and I see an error with the JSON payload from hapi-dev-errors
when opening the Swagger docs in the browser. The issue on my side is that Swagger can't find the swagger.json
file.
Seems like hapi-dev-errors
intercepts the 500 response, returns JSON and Swagger ultimately renders this payload.
@sfabriece Is this your issue?
from hapi-dev-errors.
@sfabriece Did you had the chance to check on this issue?
from hapi-dev-errors.
@sfabriece I'm closing this issue due to inactivity. Please don't mind reopening it if you still run into this problem in the future. Let me know about your setup and findings then :)
Thanks!
from hapi-dev-errors.
Related Issues (5)
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 hapi-dev-errors.