-
Notifications
You must be signed in to change notification settings - Fork 420
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
Multiple Joi.object() with className break docs #95
Comments
I am not going to be able to look at this for next three weeks as just about to leave for hols. If you want track down the issue and create a PR great, otherwise I pick it up on my return. |
Also - when multiple routes are defined like so:
Quick fix can be done by modifying this line: var responseProperty = internals.validatorToProperty(responseClassName || op.nickname + '_response', to var responseProperty = internals.validatorToProperty(responseClassName || op.nickname + '_' + route.method + '_response', I guess it is because Swagger returns all of models under "models" property, so if the name is the same, they overwrite themselves. So - the results are: Also I think that "name generation" should be done inside __getClassName, instead of doing || conditional in method args. Can do PR for this and above as well if you want. |
Hi Mike, sorry taken I while to get back to you I believe I have fixed the two use case issues you where having. Can you try out v0.6.3 and make sure it works the way you expected. |
If I generate schema:
that I include it let's say in response schema and then - I modify it like below:
or
Swagger UI shows first schema (schema1) everywhere instead of displaying schema2 in request parameters.
After removing className, everything works as expected. This might be a bug due to className resolving.
The text was updated successfully, but these errors were encountered: