Skip to content

Commit

Permalink
support integer as alternative to number
Browse files Browse the repository at this point in the history
  • Loading branch information
nazieb committed Apr 13, 2017
1 parent ad1354a commit ad1395e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "optimusjs",
"version": "0.2.1",
"version": "0.3.0",
"description": "Transform API Blueprint into any other formats",
"main": "dist/index.js",
"bin": {
Expand Down
6 changes: 5 additions & 1 deletion src/formatters/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ function getDefinitions(dataStructures) {

for (let structure of dataStructures) {
structure = structure.content[0];
if (structure.element != "object") {
continue;
}

const definitionName = convertDefinitionName(structure.meta.id);

const defaultDefinition = {
Expand Down Expand Up @@ -390,7 +394,7 @@ function convertDefinitionPath(name) {
return "#/definitions/" + convertDefinitionName(name);
}

const primitives = ["number", "string", "boolean"];
const primitives = ["number", "string", "boolean", "integer"];
const structures = ["array", "object", "enum"];

function isPrimitiveType(type) {
Expand Down

0 comments on commit ad1395e

Please sign in to comment.