From f50bbecc3820ee48cf9a80b0f5fe0f85bd9e3edc Mon Sep 17 00:00:00 2001 From: Alan Wessman Date: Tue, 9 Apr 2019 18:17:36 -0600 Subject: [PATCH] improve: error message when rendering XML example (via #5253) The original message gave no clues as to the underlying cause, which is that the element name needs to be specified explicitly (using xml/name) if it can't be determined from a $ref. --- src/core/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/utils.js b/src/core/utils.js index d3e6104e..ccc27c36 100644 --- a/src/core/utils.js +++ b/src/core/utils.js @@ -632,7 +632,7 @@ export const getSampleSchema = (schema, contentType="", config={}) => { let match = schema.$$ref.match(/\S*\/(\S+)$/) schema.xml.name = match[1] } else if (schema.type || schema.items || schema.properties || schema.additionalProperties) { - return "\n" + return "\n" } else { return null } @@ -842,4 +842,4 @@ export function paramToValue(param, paramValues) { .filter(value => value !== undefined) return values[0] -} \ No newline at end of file +}