Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load API definition when using "meta({swaggerHidden: true})" #704

Closed
oren-z opened this issue Mar 1, 2021 · 1 comment · Fixed by #771
Closed

Failed to load API definition when using "meta({swaggerHidden: true})" #704

oren-z opened this issue Mar 1, 2021 · 1 comment · Fixed by #771

Comments

@oren-z
Copy link

oren-z commented Mar 1, 2021

Issue

Environment

npx envinfo --npmPackages '*hapi*' --binaries

Binaries:
Node: 14.15.4
Yarn: 1.22.5
npm: 7.5.4
npmPackages:
hapi-auth-jwt2: ^10.2.0 => 10.2.0
hapi-swagger: ^14.1.0 => 14.1.0

Steps to Reproduce

Use .meta({ swaggerHidden: true }) as a chained command in the Joi validation

'x-something': Joi.string().meta({ swaggerHidden: true }),

Expected Behavior

A working swagger page without the specific Joi property using the swaggerHidden value as specified in the document.

Actual Behavior

Failed to load API definition.

Reproducible Demo

Latest library.

NOTE

A simple fix for this is to add the following line :
if (schemaObj.properties[key]=== undefined ) return ;
here

@AndriiNyzhnyk
Copy link
Contributor

I will check it.

AndriiNyzhnyk added a commit to AndriiNyzhnyk/hapi-swagger that referenced this issue Jun 18, 2022
AndriiNyzhnyk added a commit to AndriiNyzhnyk/hapi-swagger that referenced this issue Jun 18, 2022
AndriiNyzhnyk added a commit to AndriiNyzhnyk/hapi-swagger that referenced this issue Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants