🎩 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.9
to
0.0.10
+28
test/examples/GatitosApi.java
package org.gex.client;
import retrofit.http.Body;
import retrofit.http.Path;
import retrofit.http.DELETE;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.PUT;
import java.util.List;
import rx.Observable;
import com.pojos.*;
public interface GatitosAPI {
@GET("/cats")
public Observable<Cats> getGatitos(@Query("search") String search);
@POST("/cats")
public Observable<Cat> postGatitos(@Body Cat cat);
@GET("/cats/{catId}")
public Observable<Cat> getGatitoById(@Path("catId") String catId, @Query("filterBy") String filterBy);
@PUT("/cats/{catId}")
public Observable<Cat> putGatitoById(@Path("catId") String catId, @Body Cat cat);
}
+3
-2

@@ -18,6 +18,7 @@ package {{extra.package}}

@{{annotation}}
Response {{{name}}}({{#each args}}{{#if @index}}, {{/if}}{{{kind}}} {{type}} {{name}}{{/each}});
Response {{{name}}}({{#each args}}{{#if @index}}, {{/if}}
{{{kind}}}{{type}} {{name}}{{/each}});
{{/methods}}
}
}
+1
-1

@@ -21,4 +21,4 @@ package {{extra.package}};

public Observable<{{{respond}}}> {{{name}}}({{#each args}}{{#if @index}}, {{/if}}{{{kind}}} {{type}} {{name}}{{/each}});
{{/methods}}
}
{
"name": "raml2code",
"version": "0.0.9",
"version": "0.0.10",
"description": "Raml spec to code",

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

@@ -18,6 +18,7 @@ package {{extra.package}}

@{{annotation}}
Response {{{name}}}({{#each args}}{{#if @index}}, {{/if}}{{{kind}}} {{type}} {{name}}{{/each}});
Response {{{name}}}({{#each args}}{{#if @index}}, {{/if}}
{{{kind}}}{{type}} {{name}}{{/each}});
{{/methods}}
}
}

@@ -21,4 +21,4 @@ package {{extra.package}};

public Observable<{{{respond}}}> {{{name}}}({{#each args}}{{#if @index}}, {{/if}}{{{kind}}} {{type}} {{name}}{{/each}});
{{/methods}}
}

@@ -17,3 +17,4 @@ package org.gex

@GET
Response getGatitos(@QueryParam("search") String search);
Response getGatitos(
@QueryParam("search")String search);

@@ -24,5 +25,6 @@ /***

@POST
Response postGatitos( Cat cat);
Response postGatitos(
Cat cat);
}
}

@@ -10,5 +10,5 @@ var raml2code =require('../..');

describe('RAML to Retrofit client ', function () {
describe('RAML to JAX-RS', function () {
it('should generate a resource interface from RAML file', function(done) {
it('should generate a resource interface', function(done) {
var gen = require("../../lib/generators/groovy/jaxrsInterface");

@@ -29,9 +29,8 @@ var raml2codeInstance = raml2code({generator:gen, extra: {package: 'org.gex'}});

var content = file.contents.toString('utf8');
//console.log("=======");
//console.log(content);
//console.log("=======");
if(file.path == 'GatitosResource.groovy'){
wrapAssertion(function () {
file.isBuffer().should.equal(true);
var content = file.contents.toString('utf8');
// console.log(content)
exampleContents = exampleContents.toString('utf8').split('\n');

@@ -38,0 +37,0 @@ content.split('\n').forEach(function(e,i){

@@ -32,3 +32,2 @@ var raml2code =require('../..');

var content = file.contents.toString('utf8');
//console.log(content);
exampleContents = exampleContents.toString('utf8').split('\n');

@@ -35,0 +34,0 @@ content.split('\n').forEach(function(e,i){

@@ -17,3 +17,3 @@ var raml2code =require('../..');

var ramlPath = path.join(__dirname, '../raml/cats.raml');
var examplePath = path.join(__dirname, '../examples/CatDTO.groovy');
var examplePath = path.join(__dirname, '../examples/GatitosApi.java');

@@ -34,7 +34,7 @@ var ramlContents = fs.readFileSync(ramlPath);

var content = file.contents.toString('utf8');
//console.log(content);
// console.log(content);
exampleContents = exampleContents.toString('utf8').split('\n');
// content.split('\n').forEach(function(e,i){
// e.should.equal(exampleContents[i]);
// });
content.split('\n').forEach(function(e,i){
e.should.equal(exampleContents[i]);
});
}, done);

@@ -41,0 +41,0 @@ }