diff --git a/bin/prompt.js b/bin/prompt.js index 48c84de..4d7b4cb 100644 --- a/bin/prompt.js +++ b/bin/prompt.js @@ -34,6 +34,7 @@ module.exports.start = function(schema, cb) { if(!line && currentQuestion.default) { line = currentQuestion.default(results) } + line = line.length && line || undefined results[currentQuestion.name] = line; idx++; if(idx >= schema.length) { diff --git a/test.json b/test.json new file mode 100644 index 0000000..626ab3c --- /dev/null +++ b/test.json @@ -0,0 +1,45 @@ +{ + "name": "test", + "description": "Hadasd.", + "info": { + "contact": { + "name": "Niclas Thobaben", + "email": "info@nclazz.de", + "url": "nclazz.de" + } + }, + "imports": [], + "headers": [], + "enums": {}, + "interfaces": {}, + "models": { + "healthcheck": { + "description": "A simple response indicating the health status of a service.", + "fields": [ + { + "name": "status", + "type": "string" + } + ] + } + }, + "unions": {}, + "resources": { + "healthcheck": { + "path": "/_internal_/healthcheck", + "operations": { + "method": "GET", + "path": "/healthcheck", + "description": "Simple healthcheck endpoint to test the status of the service.", + "responses": { + "200": { + "type": "healthcheck", + "description": "Get the current health status of the service." + } + } + } + } + }, + "attributes": {}, + "annotations": {} +} \ No newline at end of file