We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example: ...
... put: parameters: - name: body required: true in: body schema: $ref: '#/definitions/employeeFull'
validator.js does not call $ref resolution before enjoi at line 97. Suggested fix:
if ((parameter.in === 'body' || parameter.in === 'formData') && template.schema) { iif (template.schema.$ref) { template.schema = refresolver(schemas, template.schema.$ref); } // resolve schema! schema = enjoi(template.schema, { subSchemas: schemas, types: types }); }
The text was updated successfully, but these errors were encountered:
Maybe resolving all of the refs makes it easier. I do it externally currently, but I would have expected it to be done:
const http = require('http'); const express = require('express'); const swaggerize = require('swaggerize-express'); const refParser = require('json-schema-ref-parser'); const morgan = require('morgan'); app = express(); const server = http.createServer(app); refParser.dereference('./api-docs/swagger.yaml') .then(function(schema) { app.use(morgan("dev")); app.use(swaggerize({ api: schema, docspath: '/api-docs', handlers: './handlers' })); server.listen(10010, 'localhost', function () { app.swagger.api.host = server.address().address + ':' + server.address().port; }); }) .catch(function(err) { console.error(err); });
Sorry, something went wrong.
I think I'm running into exactly this on query parameters as well. It's partly because it's using it as a key in a dictionary:
if (def.parameters) { def.parameters.forEach(function (parameter) { validators[parameter.in + parameter.name] = parameter; }); }
And with a ref, those things aren't there.
No branches or pull requests
Example:
...
validator.js does not call $ref resolution before enjoi at line 97. Suggested fix:
The text was updated successfully, but these errors were encountered: