Questions tagged [hapi-swagger]
21 questions
7
votes
1 answer
Hide some api in swagger ui
Is it possible in hapi-swagger to hide some APIs from documentation (swagger ui) based on user role.
I mean suppose I have /employee and /admin two APIs so whenever admin login to swagger ui or swagger documentation so both /employee and /admin API…

ppb
- 2,299
- 4
- 43
- 75
5
votes
3 answers
Uncaught ReferenceError: SwaggerUIBundle is not defined at window.onload
In my localhost, my swagger UI working well. localhost:3030/documentation
This UI was working on the server also but from today on the server it is not working https://digitalpathshalabd.com/documentation
Errors

Durjoy Talukdar
- 51
- 1
- 3
3
votes
1 answer
hapijs - Cannot start server before plugins finished registration
So I have Hapi (v17.5.1) and when I have my plugins array as
[
{
plugin: good,
options: {
reporters: {
errorReporter: [
{
module: 'good-squeeze',
name: 'Squeeze',
args: [{ error: '*' }],
…

Aakash Verma
- 3,705
- 5
- 29
- 66
3
votes
1 answer
Swagger UI seems to not handle optional keys with POST json body
Packages :
hapi-swagger: 9.0.1
joi: 13.0.2
Context :
I use the swagger-ui with a swagger.json file generated by hapi-swagger.
I use for hapi-swagger the jsonEditor option set to true.
Which means that i don't enter myself the body in a single text…

user7364588
- 1,014
- 2
- 12
- 32
2
votes
1 answer
hapi-swagger Joi string example
I'm having an issue with adding proper examples to hapi-swagger with Joi. When I add .example('') to either the response schema or validate { payload: {} } it's adding an additional obj with a value.
response: {
schema:…

Joseph Chambers
- 3,698
- 4
- 22
- 37
2
votes
3 answers
Unable to register hapi-swagger to hapi rest api latest version 17
I created a REST api a year ago using following versions of hapi and hapi-swagger.
hapi: "8.5.1",
hapi-swagger: "0.7.3"
For registering hapi-swagger, I used following register options:
server.register([{
register: require('hapi-swagger'),
…

kgangadhar
- 4,886
- 5
- 36
- 54
1
vote
0 answers
Not able to reference object using hapi-swagger library
I am using hapi-swagger library 14.0.0. As per hapi-swagger library documentation used options.deReference = true. Still, I am not able to reference object.
Can anybody help me to solve the issue?
Expected behavior
{
"200": {
…

Jit Sarkar
- 11
- 2
1
vote
0 answers
hapi-swagger returning JSON data but no UI
My routes contain the the 'api' tag
...
{
method: 'GET',
path: '/blah/albums',
options: { tags: ['api'], handler: myHandlerFunction }
},
...
and I am including the Inert, Vision, and hapi-swagger plugins
import Hapi from '@hapi/hapi'
import…

steve-o
- 1,303
- 1
- 14
- 20
1
vote
1 answer
Hapi-Swagger failing with header value
I am using hapi-swagger in our application where one of API trying to use custom header but when I ivoke that API with custom header getting below error
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid request headers input"
}
Below…

ppb
- 2,299
- 4
- 43
- 75
0
votes
0 answers
Changing Swagger Path URI to Server Name In Hapi-js Using Hapi-swagger
How Can Change SwaggerPath Dynamically to severname, Down I have Given Swagger Options and Sever
with Plugins.
/** ******************** swagger Options*********************** */ const swaggerOptions: HapiSwagger.RegisterOptions = { info: { title:…
0
votes
1 answer
How to correctly describe a golang struct using swagger?
I have some problem. In different sites you can find how to correctly describe go struct using swagger(annotations).
Example:
// swagger:model
type User struct {
// the id for this user
//
// required: true
// min: 1
ID int64…

Gringo
- 1
0
votes
1 answer
Is there a hapi-swagger library that supports OpenAPI 3.0?
We are using hapi-swagger for our hapi Node APIs to generate our Swagger pages.
We are also trying to use Postman Contract Test Generator to create automated tests for our APIs. This works great for our non-node APIs.
However, Postman Contract Test…

franzcatch
- 169
- 2
- 15
0
votes
2 answers
Is there a way to define an integer property as int64 in a Joi model that is used by Hapi Swagger
I am having the following Joi model
const SimpleModel = Joi.object({
id: Joi.number().integer().required().description('ID')
}).label('SimpleModel');
The model is being used in the @hapi/hapi route below
{
method: 'GET',
path:…

Tasos K.
- 7,979
- 7
- 39
- 63
0
votes
0 answers
Can't get any response from hapi-swagger on windows server
I have a code that use hapi-swagger for my API Documentation, and i put that code into windows server, but i can't get any response when i hit my endpoint. I don't know why, cause when i pull my code and try on localhost everything is fine.
This is…

Alif Pratama
- 1
- 1
0
votes
0 answers
TypeError: Uncaught error: Converting circular structure to JSON
I am using Hapi-Swagger to create api documentation. This is my manifest file.
const manifest = {
$meta: 'Our main server manifest',
server: {},
connections: [
AppConfig.get('/server')
],
registrations: [
{ plugin: 'hapi-auth-jwt2'…

Profer
- 553
- 8
- 40
- 81