diff --git a/lib/generator.js b/lib/generator.js index 28039db..7ccaa40 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -43,8 +43,11 @@ generator.newModel = function (schema, definitions) { } const pick = _.has(value, '$ref') ? ['$ref'] : ['type', 'format', 'items', 'default', 'description', '$ref', 'enum', 'minimum', 'maximum', 'minLength', 'maxLength', 'collectionFormat', 'example'] - memo[key] = _.pick(value, pick) - + const val = _.pick(value, pick) + if(val.example && val.example.value) { + val.example = val.example.value + } + memo[key] = val return memo }, model.properties)