Skip to content
This repository has been archived by the owner on Mar 15, 2019. It is now read-only.

Commit

Permalink
closes #32
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaston Lodieu committed Oct 5, 2016
1 parent b4b9684 commit 2efb78f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/exporters/baseraml.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ RAML.prototype.convertRefFromModel = function(object) {
object[id] = {
type: 'string'
};
}
if (val.format == 'date') {
} else if (val.format == 'date') {
object[id] = {
type: 'date-only'
};
Expand All @@ -375,7 +374,11 @@ RAML.prototype.convertRefFromModel = function(object) {
type: 'datetime',
format: 'rfc3339'
};
}
} else { //remove invalid format.
if (ramlHelper.getValidFormat.indexOf(val.format) < 0) {
delete object[id].format;
}
}
} else {
object[id] = this.convertRefFromModel(val);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/helpers/raml.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ var _ = require('lodash');
module.exports = {

getScalarTypes: ['string', 'number', 'integer', 'boolean', 'date', 'datetime', 'date-only', 'file', 'array', 'nilValue'],

getValidFormat: [ 'byte', 'binary', 'password', 'date', 'date-time' ],

parameterMappings: {},

Expand Down

0 comments on commit 2efb78f

Please sign in to comment.