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
for an API parameter definition:
"parameters": [ { "name": "body", "dataType": "Data", "paramType": "body" } ] ... "Data": { "id": "Data", "properties": { "a": { "type": "string" }, "b": { "type": "string" } }
the current implementation of the validator expects:
{"body": {"a": "xxx", "b": "yyy"}}
Instead of
{"a": "xxx", "b": "yyy"}}
This is incorrect according to Swagger 1.1 spec (and subsequent versions):
If paramType is body, the name is used only for UI and codegeneration.
Simple fixes are in validator.js
case 'body': errPrefix = "body parameter " + spec.name; if (spec.name) { if (type === 'file') { value = (_ref1 = bodyContainer.files) != null ? _ref1[spec.name] : void 0; return done(!(value != null) && spec.schema.schema.required ? new Error("" + errPrefix + " is required") : void 0); } else { if (bodyContainer.body) { //fix: value = bodyContainer.body; //broken: value = bodyContainer.body[spec.name]; } else { value = void 0; } } } else {
and
if (err != null) { err.message = "" + errPrefix + " " + (err.message.replace(/^JSON object /, '')); } else { if (spec.kind !== 'body') { input[spec.name] = value; } else { //fix: if (spec.name != null && spec.name !== 'body') { //broken: if (spec.name != null) { bodyContainer.body[spec.name] = value; } else { bodyContainer.body = value; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
for an API parameter definition:
the current implementation of the validator expects:
Instead of
This is incorrect according to Swagger 1.1 spec (and subsequent versions):
If paramType is body, the name is used only for UI and codegeneration.
Simple fixes are in validator.js
and
The text was updated successfully, but these errors were encountered: