šŸŽ© You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP →
Sign In

raml2code

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raml2code - npm Package Compare versions

Comparing version
0.0.7
to
0.0.8
+11
test/raml/cat.example.json
{
"id": 123,
"name": "hola",
"errors": [
{
"code": "500",
"messages": "Error",
"status": 200
}
]
}
+1
-2

@@ -33,3 +33,2 @@ var util;

p.type = "List";
p.name = "items";
break;

@@ -82,3 +81,3 @@ case 'string':

methodDef.request = (_ref2 = request.title) != null ? _ref2 : null;
methodDef.respond = respond.type === "array" ? "List<" + respond.title + ">" : respond.title;
methodDef.respond = respond.title;
methodDef.annotation = m.method.toUpperCase();

@@ -85,0 +84,0 @@ methodDef.name = m.method + resource.displayName;

{
"name": "raml2code",
"version": "0.0.7",
"version": "0.0.8",
"description": "Raml spec to code",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -24,3 +24,3 @@ util = {}

p.type = "List"
p.name = "items"
# p.name = "items"
when 'string' then p.type = "String"

@@ -31,2 +31,3 @@ when 'boolean' then p.type = "Boolean"

when 'object' then p.type = "Map"
p.kind = annotation + "(\"#{p.name}\")"

@@ -52,3 +53,3 @@ p

methodDef.request = request.title ? null
methodDef.respond = if respond.type is "array" then "List<#{respond.title}>" else respond.title
methodDef.respond = respond.title
methodDef.annotation = m.method.toUpperCase()

@@ -55,0 +56,0 @@ methodDef.name = m.method + resource.displayName

@@ -25,2 +25,5 @@ package org.gex

/* Errores al procesar la petición */
List errors
}

@@ -14,3 +14,3 @@ package org.gex

/***
* @return Response This must be a valid List<Cats> JSON object.
* @return Response This must be a valid Cats JSON object.
*/

@@ -17,0 +17,0 @@ @GET

{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Cat",
"id": "cat.schema.json",
"description": "A cat from Atoms catalog",

@@ -32,6 +33,11 @@ "type": "object",

}
},
"errors":{
"title": "Errors",
"description": "Errores al procesar la petición",
"type": "array",
"items": { "$ref": "error.schema.json" }
}
},
"required": ["id", "name"]
"required": ["id", "name", "errors"]
}

@@ -5,4 +5,11 @@ {

"description": "A cats collection",
"type": "array",
"items": { "$ref": "#/cat" }
"properties": {
"cats" : {
"title": "Cats",
"description": "A lot of cats",
"type": "array",
"items": { "$ref": "cat.schema.json" }
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error",
"description": "A server error",
"type": "object",
"properties": {
"error": {
"description": "The unique identifier for a cat",
"properties": {
"code": {"type": "string"},
"messages": {"type": "string"},
"status": {"type": "integer"}
},
"required": ["code", "messages", "status"]
}
}
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error",
"id": "error.schema.json",
"description": "A server error",
"type": "object",
"properties": {
"code": {"type": "string"},
"messages": {"type": "string"},
"status": {"type": "integer"}
},
"required": [
"code",
"messages",
"status"
]
}

Sorry, the diff of this file is not supported yet