Comments (3)
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.
from hapi-swagger.
Also - when multiple routes are defined like so:
- events/{id} GET
- events/{id} POST
- events/{id} DELETE
And no className is set and the automatic one is generated (eventsid_response) and if responses are different (for example DELETE response returns affected rows), they are mixed up and all of them are the same as the first one ever defined (in this case - GET response schema).
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:
eventsid_GET_response
eventsid_POST_response
eventsid_DELETE_response
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.
from hapi-swagger.
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.
from hapi-swagger.
Related Issues (20)
- ValidationError: "contact.license" is not allowed HOT 2
- Enhancement: support ZOD validator HOT 1
- Speed slowdown on swagger.json generation HOT 2
- Is swagger.json regenerated on every server restart? HOT 2
- Feature Request/Offer: Proxy Prefix HOT 2
- Could not load content for webpack://SwaggerUIBundle/node_modules/swagger-client/es/http/index.js (Fetch through target failed: Unsupported URL scheme; Fallback: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME) HOT 1
- Static generation of swagger.json HOT 1
- Feature request: ability to set a query parameter as deprecated
- More format handled for string
- `Joi.ref`s as default values outputs a raw object HOT 1
- Failed to load API definition hapi-swagger ^17.1.0 HOT 1
- [FIX] Invalid schema on requestBody.content[multipart/form-data].schema for uploaded file on OAS3
- Swagger `queryConfigEnabled` property is not supported
- Feature Proposal: Ability to customize the `default` values for individual parameters
- OpenAPI 3.1 support
- description becomes summary
- Add more example for `auth` options from optionsreference.md
- Add a better default to auto increment model naming in hapi-swagger HOT 1
- [email protected] breaks the swagger UI
- joi.regex(//, { invert: true}); is not generated correctly in the swagger.
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-swagger.