[jira] [Updated] (CAMEL-8420) Not possible to use inner classes for Dtos in Camel Swagger

2015-03-02 Thread Espen Tjonneland (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-8420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Espen Tjonneland updated CAMEL-8420:

Description: 
If you inline your Dto classes with your services then Camel fails to load them 
(ClassNotFoundException).

Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
example by moving the User class into the UserService and update the UserRoute 
builder to use the moved type.

{code:title=UserService.java|borderStyle=solid}
public class UserService {

// use a tree map so they become sorted
private final MapString, org.apache.camel.example.rest.UserService.User 
users = new TreeMapString, org.apache.camel.example.rest.UserService.User();

private Random ran = new Random();

public UserService() {
users.put(123, new 
org.apache.camel.example.rest.UserService.User(123, John Doe));
users.put(456, new 
org.apache.camel.example.rest.UserService.User(456, Donald Duck));
users.put(789, new 
org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
}

/**
 * Gets a user by the given id
 *
 * @param id  the id of the user
 * @return the user, or ttnull/tt if no user exists
 */
public org.apache.camel.example.rest.UserService.User getUser(String id) {
   
}

/**
 * List all users
 *
 * @return the list of all users
 */
public Collectionorg.apache.camel.example.rest.UserService.User 
listUsers() {
   
}

/**
 * Updates or creates the given user
 *
 * @param user the user
 */
public void updateUser(org.apache.camel.example.rest.UserService.User user) 
{

}

public static class User {

private int id;
private String name;


}
{code}

  was:
If you inline your Dto classes with your services then Camel fails to load them 
(ClassNotFoundException).

Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
example by moving the User class into the UserService and update the UserRoute 
builder to use the moved type.

{code:title=Bar.java|borderStyle=solid}
public class UserService {

// use a tree map so they become sorted
private final MapString, org.apache.camel.example.rest.UserService.User 
users = new TreeMapString, org.apache.camel.example.rest.UserService.User();

private Random ran = new Random();

public UserService() {
users.put(123, new 
org.apache.camel.example.rest.UserService.User(123, John Doe));
users.put(456, new 
org.apache.camel.example.rest.UserService.User(456, Donald Duck));
users.put(789, new 
org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
}

/**
 * Gets a user by the given id
 *
 * @param id  the id of the user
 * @return the user, or ttnull/tt if no user exists
 */
public org.apache.camel.example.rest.UserService.User getUser(String id) {
   
}

/**
 * List all users
 *
 * @return the list of all users
 */
public Collectionorg.apache.camel.example.rest.UserService.User 
listUsers() {
   
}

/**
 * Updates or creates the given user
 *
 * @param user the user
 */
public void updateUser(org.apache.camel.example.rest.UserService.User user) 
{

}

public static class User {

private int id;
private String name;


}
{code}


 Not possible to use inner classes for Dtos in Camel Swagger
 ---

 Key: CAMEL-8420
 URL: https://issues.apache.org/jira/browse/CAMEL-8420
 Project: Camel
  Issue Type: Bug
  Components: camel-core, camel-swagger
Affects Versions: 2.14.1
Reporter: Espen Tjonneland

 If you inline your Dto classes with your services then Camel fails to load 
 them (ClassNotFoundException).
 Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
 example by moving the User class into the UserService and update the 
 UserRoute builder to use the moved type.
 {code:title=UserService.java|borderStyle=solid}
 public class UserService {
 // use a tree map so they become sorted
 private final MapString, org.apache.camel.example.rest.UserService.User 
 users = new TreeMapString, org.apache.camel.example.rest.UserService.User();
 private Random ran = new Random();
 public UserService() {
 users.put(123, new 
 org.apache.camel.example.rest.UserService.User(123, John Doe));
 users.put(456, new 
 org.apache.camel.example.rest.UserService.User(456, Donald Duck));
 users.put(789, new 
 org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
 }
 /**
  * Gets a user by the given id
  *
  * @param id  the id of the user
  * 

[jira] [Created] (CAMEL-8420) Not possible to use inner classes for Dtos in Camel Swagger

2015-03-02 Thread Espen Tjonneland (JIRA)
Espen Tjonneland created CAMEL-8420:
---

 Summary: Not possible to use inner classes for Dtos in Camel 
Swagger
 Key: CAMEL-8420
 URL: https://issues.apache.org/jira/browse/CAMEL-8420
 Project: Camel
  Issue Type: Bug
  Components: camel-core, camel-swagger
Affects Versions: 2.14.1
Reporter: Espen Tjonneland


If you inline your Dto classes with your services then Camel fails to load them 
(ClassNotFoundException).

Can be reproduced by modifying the Camel :: Example :: Serlet REST Tomcat and 
moving the User class into the User Service:

If you inline your Dto objects in your service as a public static class, camel 
fails loading it with a  java.lang.ClassNotFoundException

Can easily be reproduced by modifying the Servlet Rest Tomcat example by moving 
the User class into the UserService and update the UserRoute builder to use the 
moved type.

public class UserService {

// use a tree map so they become sorted
private final MapString, org.apache.camel.example.rest.UserService.User 
users = new TreeMapString, org.apache.camel.example.rest.UserService.User();

private Random ran = new Random();

public UserService() {
users.put(123, new 
org.apache.camel.example.rest.UserService.User(123, John Doe));
users.put(456, new 
org.apache.camel.example.rest.UserService.User(456, Donald Duck));
users.put(789, new 
org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
}

/**
 * Gets a user by the given id
 *
 * @param id  the id of the user
 * @return the user, or ttnull/tt if no user exists
 */
public org.apache.camel.example.rest.UserService.User getUser(String id) {
   
}

/**
 * List all users
 *
 * @return the list of all users
 */
public Collectionorg.apache.camel.example.rest.UserService.User 
listUsers() {
   
}

/**
 * Updates or creates the given user
 *
 * @param user the user
 */
public void updateUser(org.apache.camel.example.rest.UserService.User user) 
{

}

public static class User {

private int id;
private String name;


}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CAMEL-8420) Not possible to use inner classes for Dtos in Camel Swagger

2015-03-02 Thread Espen Tjonneland (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-8420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Espen Tjonneland updated CAMEL-8420:

Description: 
If you inline your Dto classes with your services then Camel fails to load them 
(ClassNotFoundException).

Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
example by moving the User class into the UserService and update the UserRoute 
builder to use the moved type.

{code:title=Bar.java|borderStyle=solid}
public class UserService {

// use a tree map so they become sorted
private final MapString, org.apache.camel.example.rest.UserService.User 
users = new TreeMapString, org.apache.camel.example.rest.UserService.User();

private Random ran = new Random();

public UserService() {
users.put(123, new 
org.apache.camel.example.rest.UserService.User(123, John Doe));
users.put(456, new 
org.apache.camel.example.rest.UserService.User(456, Donald Duck));
users.put(789, new 
org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
}

/**
 * Gets a user by the given id
 *
 * @param id  the id of the user
 * @return the user, or ttnull/tt if no user exists
 */
public org.apache.camel.example.rest.UserService.User getUser(String id) {
   
}

/**
 * List all users
 *
 * @return the list of all users
 */
public Collectionorg.apache.camel.example.rest.UserService.User 
listUsers() {
   
}

/**
 * Updates or creates the given user
 *
 * @param user the user
 */
public void updateUser(org.apache.camel.example.rest.UserService.User user) 
{

}

public static class User {

private int id;
private String name;


}
{code}

  was:
If you inline your Dto classes with your services then Camel fails to load them 
(ClassNotFoundException).

Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
example by moving the User class into the UserService and update the UserRoute 
builder to use the moved type.

[code]
public class UserService {

// use a tree map so they become sorted
private final MapString, org.apache.camel.example.rest.UserService.User 
users = new TreeMapString, org.apache.camel.example.rest.UserService.User();

private Random ran = new Random();

public UserService() {
users.put(123, new 
org.apache.camel.example.rest.UserService.User(123, John Doe));
users.put(456, new 
org.apache.camel.example.rest.UserService.User(456, Donald Duck));
users.put(789, new 
org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
}

/**
 * Gets a user by the given id
 *
 * @param id  the id of the user
 * @return the user, or ttnull/tt if no user exists
 */
public org.apache.camel.example.rest.UserService.User getUser(String id) {
   
}

/**
 * List all users
 *
 * @return the list of all users
 */
public Collectionorg.apache.camel.example.rest.UserService.User 
listUsers() {
   
}

/**
 * Updates or creates the given user
 *
 * @param user the user
 */
public void updateUser(org.apache.camel.example.rest.UserService.User user) 
{

}

public static class User {

private int id;
private String name;


}
[code]


 Not possible to use inner classes for Dtos in Camel Swagger
 ---

 Key: CAMEL-8420
 URL: https://issues.apache.org/jira/browse/CAMEL-8420
 Project: Camel
  Issue Type: Bug
  Components: camel-core, camel-swagger
Affects Versions: 2.14.1
Reporter: Espen Tjonneland

 If you inline your Dto classes with your services then Camel fails to load 
 them (ClassNotFoundException).
 Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
 example by moving the User class into the UserService and update the 
 UserRoute builder to use the moved type.
 {code:title=Bar.java|borderStyle=solid}
 public class UserService {
 // use a tree map so they become sorted
 private final MapString, org.apache.camel.example.rest.UserService.User 
 users = new TreeMapString, org.apache.camel.example.rest.UserService.User();
 private Random ran = new Random();
 public UserService() {
 users.put(123, new 
 org.apache.camel.example.rest.UserService.User(123, John Doe));
 users.put(456, new 
 org.apache.camel.example.rest.UserService.User(456, Donald Duck));
 users.put(789, new 
 org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
 }
 /**
  * Gets a user by the given id
  *
  * @param id  the id of the user
  * @return the user, or ttnull/tt if no user exists
  

[jira] [Updated] (CAMEL-8420) Not possible to use inner classes for Dtos in Camel Swagger

2015-03-02 Thread Espen Tjonneland (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-8420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Espen Tjonneland updated CAMEL-8420:

Description: 
If you inline your Dto classes with your services then Camel fails to load them 
(ClassNotFoundException).

Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
example by moving the User class into the UserService and update the UserRoute 
builder to use the moved type.

public class UserService {

// use a tree map so they become sorted
private final MapString, org.apache.camel.example.rest.UserService.User 
users = new TreeMapString, org.apache.camel.example.rest.UserService.User();

private Random ran = new Random();

public UserService() {
users.put(123, new 
org.apache.camel.example.rest.UserService.User(123, John Doe));
users.put(456, new 
org.apache.camel.example.rest.UserService.User(456, Donald Duck));
users.put(789, new 
org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
}

/**
 * Gets a user by the given id
 *
 * @param id  the id of the user
 * @return the user, or ttnull/tt if no user exists
 */
public org.apache.camel.example.rest.UserService.User getUser(String id) {
   
}

/**
 * List all users
 *
 * @return the list of all users
 */
public Collectionorg.apache.camel.example.rest.UserService.User 
listUsers() {
   
}

/**
 * Updates or creates the given user
 *
 * @param user the user
 */
public void updateUser(org.apache.camel.example.rest.UserService.User user) 
{

}

public static class User {

private int id;
private String name;


}

  was:
If you inline your Dto classes with your services then Camel fails to load them 
(ClassNotFoundException).

Can be reproduced by modifying the Camel :: Example :: Serlet REST Tomcat and 
moving the User class into the User Service:

If you inline your Dto objects in your service as a public static class, camel 
fails loading it with a  java.lang.ClassNotFoundException

Can easily be reproduced by modifying the Servlet Rest Tomcat example by moving 
the User class into the UserService and update the UserRoute builder to use the 
moved type.

public class UserService {

// use a tree map so they become sorted
private final MapString, org.apache.camel.example.rest.UserService.User 
users = new TreeMapString, org.apache.camel.example.rest.UserService.User();

private Random ran = new Random();

public UserService() {
users.put(123, new 
org.apache.camel.example.rest.UserService.User(123, John Doe));
users.put(456, new 
org.apache.camel.example.rest.UserService.User(456, Donald Duck));
users.put(789, new 
org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
}

/**
 * Gets a user by the given id
 *
 * @param id  the id of the user
 * @return the user, or ttnull/tt if no user exists
 */
public org.apache.camel.example.rest.UserService.User getUser(String id) {
   
}

/**
 * List all users
 *
 * @return the list of all users
 */
public Collectionorg.apache.camel.example.rest.UserService.User 
listUsers() {
   
}

/**
 * Updates or creates the given user
 *
 * @param user the user
 */
public void updateUser(org.apache.camel.example.rest.UserService.User user) 
{

}

public static class User {

private int id;
private String name;


}


 Not possible to use inner classes for Dtos in Camel Swagger
 ---

 Key: CAMEL-8420
 URL: https://issues.apache.org/jira/browse/CAMEL-8420
 Project: Camel
  Issue Type: Bug
  Components: camel-core, camel-swagger
Affects Versions: 2.14.1
Reporter: Espen Tjonneland

 If you inline your Dto classes with your services then Camel fails to load 
 them (ClassNotFoundException).
 Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
 example by moving the User class into the UserService and update the 
 UserRoute builder to use the moved type.
 public class UserService {
 // use a tree map so they become sorted
 private final MapString, org.apache.camel.example.rest.UserService.User 
 users = new TreeMapString, org.apache.camel.example.rest.UserService.User();
 private Random ran = new Random();
 public UserService() {
 users.put(123, new 
 org.apache.camel.example.rest.UserService.User(123, John Doe));
 users.put(456, new 
 org.apache.camel.example.rest.UserService.User(456, Donald Duck));
 users.put(789, new 
 org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
 }
 

[jira] [Updated] (CAMEL-8420) Not possible to use inner classes for Dtos in Camel Swagger

2015-03-02 Thread Espen Tjonneland (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-8420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Espen Tjonneland updated CAMEL-8420:

Description: 
If you inline your Dto classes with your services then Camel fails to load them 
(ClassNotFoundException).

Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
example by moving the User class into the UserService and update the UserRoute 
builder to use the moved type.

[code]
public class UserService {

// use a tree map so they become sorted
private final MapString, org.apache.camel.example.rest.UserService.User 
users = new TreeMapString, org.apache.camel.example.rest.UserService.User();

private Random ran = new Random();

public UserService() {
users.put(123, new 
org.apache.camel.example.rest.UserService.User(123, John Doe));
users.put(456, new 
org.apache.camel.example.rest.UserService.User(456, Donald Duck));
users.put(789, new 
org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
}

/**
 * Gets a user by the given id
 *
 * @param id  the id of the user
 * @return the user, or ttnull/tt if no user exists
 */
public org.apache.camel.example.rest.UserService.User getUser(String id) {
   
}

/**
 * List all users
 *
 * @return the list of all users
 */
public Collectionorg.apache.camel.example.rest.UserService.User 
listUsers() {
   
}

/**
 * Updates or creates the given user
 *
 * @param user the user
 */
public void updateUser(org.apache.camel.example.rest.UserService.User user) 
{

}

public static class User {

private int id;
private String name;


}
[code]

  was:
If you inline your Dto classes with your services then Camel fails to load them 
(ClassNotFoundException).

Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
example by moving the User class into the UserService and update the UserRoute 
builder to use the moved type.

public class UserService {

// use a tree map so they become sorted
private final MapString, org.apache.camel.example.rest.UserService.User 
users = new TreeMapString, org.apache.camel.example.rest.UserService.User();

private Random ran = new Random();

public UserService() {
users.put(123, new 
org.apache.camel.example.rest.UserService.User(123, John Doe));
users.put(456, new 
org.apache.camel.example.rest.UserService.User(456, Donald Duck));
users.put(789, new 
org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
}

/**
 * Gets a user by the given id
 *
 * @param id  the id of the user
 * @return the user, or ttnull/tt if no user exists
 */
public org.apache.camel.example.rest.UserService.User getUser(String id) {
   
}

/**
 * List all users
 *
 * @return the list of all users
 */
public Collectionorg.apache.camel.example.rest.UserService.User 
listUsers() {
   
}

/**
 * Updates or creates the given user
 *
 * @param user the user
 */
public void updateUser(org.apache.camel.example.rest.UserService.User user) 
{

}

public static class User {

private int id;
private String name;


}


 Not possible to use inner classes for Dtos in Camel Swagger
 ---

 Key: CAMEL-8420
 URL: https://issues.apache.org/jira/browse/CAMEL-8420
 Project: Camel
  Issue Type: Bug
  Components: camel-core, camel-swagger
Affects Versions: 2.14.1
Reporter: Espen Tjonneland

 If you inline your Dto classes with your services then Camel fails to load 
 them (ClassNotFoundException).
 Can easily be reproduced by modifying the Camel :: Example :: Serlet REST  
 example by moving the User class into the UserService and update the 
 UserRoute builder to use the moved type.
 [code]
 public class UserService {
 // use a tree map so they become sorted
 private final MapString, org.apache.camel.example.rest.UserService.User 
 users = new TreeMapString, org.apache.camel.example.rest.UserService.User();
 private Random ran = new Random();
 public UserService() {
 users.put(123, new 
 org.apache.camel.example.rest.UserService.User(123, John Doe));
 users.put(456, new 
 org.apache.camel.example.rest.UserService.User(456, Donald Duck));
 users.put(789, new 
 org.apache.camel.example.rest.UserService.User(789, Slow Turtle));
 }
 /**
  * Gets a user by the given id
  *
  * @param id  the id of the user
  * @return the user, or ttnull/tt if no user exists
  */
 public org.apache.camel.example.rest.UserService.User getUser(String 

[jira] [Comment Edited] (CAMEL-8104) rest-dsl - Allow custom error responses as-is without invoking the output binding

2014-12-05 Thread Espen Tjonneland (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-8104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14235294#comment-14235294
 ] 

Espen Tjonneland edited comment on CAMEL-8104 at 12/5/14 9:21 AM:
--

I wonder if there is still missing some bits (pun intended) here. And I am 
guessing it is failing due to it being done inside an interceptor.
Consider the following route def:
{code}

public class MyRestRouteDefs extends RouteBuilder {
imports .;

@Override
public void configure() {
. config stuff

interceptFrom().id(Create an error)
.bean(CreateAnError.class); //Sets up one interceptor that always 
creates an error message - just to clarify this issue


restConfiguration().component(servlet).bindingMode(RestBindingMode.json)
.contextPath(/MyContext/api/).port(8080);

RestDefinition privateAPI = 
rest(ServiceConstants.PRIVATE_API_VERSION_1).description(Private (internal) 
REST services for MyServices.)
  
.skipBindingOnErrorCode(true);  //Not neccecary (for clarity)

privateAPI.get(/fetchsomething).description(Lists stuff from some 
service) 
.outTypeList(MyPojoForSomething.class) 
.route().routeId(A descriptive ID) 
.choice() 

.when(header(ServiceConstants.REQUEST_VALIDATED).isEqualTo(TRUE)) 
   .bean(GoAheadAndFillAMyPojoForSomething-into-body.class) 
.otherwise()); //Otherwise might not be needed. Added it there 
to show that it is a branching point.
}
}


public class CreateAnError {
imports .;

@Handler
public void createAnError (@Body Message requestMessage) {
requestMessage.setHeader(ServiceConstants.REQUEST_VALIDATED,  FALSE);
requestMessage.setHeader(Exchange.HTTP_RESPONSE_CODE, 
HttpServletResponse.SC_FORBIDDEN);
requestMessage.setHeader(Exchange.CONTENT_TYPE, text/plain);
requestMessage.setBody(I raised this error inside an interceptor and 
just wanted to tell you about it);
   }
}

{code}

This results in an error: 
{code}
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Missing': 
was expecting ('true', 'false' or 'null') 
 at [Source: java.io.ByteArrayInputStream@67618968; line: 1, column: 9] 
at 
com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1419) 
{code}



was (Author: espentj):
I wonder if there is still missing some bits here. And I am guessing it is 
failing due to it being done inside an interceptor.
Consider the following route def:
{code}

public class MyRestRouteDefs extends RouteBuilder {
imports .;

@Override
public void configure() {
. config stuff

interceptFrom().id(Create an error)
.bean(CreateAnError.class); //Sets up one interceptor that always 
creates an error message - just to clarify this issue


restConfiguration().component(servlet).bindingMode(RestBindingMode.json)
.contextPath(/MyContext/api/).port(8080);

RestDefinition privateAPI = 
rest(ServiceConstants.PRIVATE_API_VERSION_1).description(Private (internal) 
REST services for MyServices.)
  
.skipBindingOnErrorCode(true);  //Not neccecary (for clarity)

privateAPI.get(/fetchsomething).description(Lists stuff from some 
service) 
.outTypeList(MyPojoForSomething.class) 
.route().routeId(A descriptive ID) 
.choice() 

.when(header(ServiceConstants.REQUEST_VALIDATED).isEqualTo(TRUE)) 
   .bean(GoAheadAndFillAMyPojoForSomething-into-body.class) 
.otherwise()); //Otherwise might not be needed. Added it there 
to show that it is a branching point.
}
}


public class CreateAnError {
imports .;

@Handler
public void createAnError (@Body Message requestMessage) {
requestMessage.setHeader(ServiceConstants.REQUEST_VALIDATED,  FALSE);
requestMessage.setHeader(Exchange.HTTP_RESPONSE_CODE, 
HttpServletResponse.SC_FORBIDDEN);
requestMessage.setHeader(Exchange.CONTENT_TYPE, text/plain);
requestMessage.setBody(I raised this error inside an interceptor and 
just wanted to tell you about it);
   }
}

{code}

This results in an error: 
{code}
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Missing': 
was expecting ('true', 'false' or 'null') 
 at [Source: java.io.ByteArrayInputStream@67618968; line: 1, column: 9] 
at 
com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1419) 
{code}


 rest-dsl - Allow custom error responses as-is without invoking the output 
 binding
 -

 Key: CAMEL-8104
 URL: 

[jira] [Created] (CAMEL-7941) Expose private variables as JSON for camel-swagger

2014-10-22 Thread Espen Tjonneland (JIRA)
Espen Tjonneland created CAMEL-7941:
---

 Summary: Expose private variables as JSON for camel-swagger
 Key: CAMEL-7941
 URL: https://issues.apache.org/jira/browse/CAMEL-7941
 Project: Camel
  Issue Type: Improvement
  Components: camel-swagger
Affects Versions: 2.14.0
Reporter: Espen Tjonneland
Priority: Minor


Consider the following class:

@ApiModel(value = MyDTO , description = My data transporter) 
public class MyDTO { 
@ApiModelProperty(value = This is a private field) 
private String myPrivateField; 
} 

Swagger will not document the class as JSON. I am unsure if this is happening 
in camel-core, or if this is a problem with Swagger. However, the behavior is 
inconsistent with e.g. Gson, which handles private fields just fine. Instead it 
relies on annotations for how the class variables should be exposed. 

Would it be possible to have this variable exposed by default even though it is 
private, and instead rely on annotations for deciding how to expose the 
variables (like Gson does).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CAMEL-7936) Add support for Query Params in the REST DSL

2014-10-21 Thread Espen Tjonneland (JIRA)
Espen Tjonneland created CAMEL-7936:
---

 Summary: Add support for Query Params in the REST DSL
 Key: CAMEL-7936
 URL: https://issues.apache.org/jira/browse/CAMEL-7936
 Project: Camel
  Issue Type: New Feature
  Components: camel-core, camel-swagger
Affects Versions: 2.14.0
Reporter: Espen Tjonneland


Query parameters are currently supported implicitly through HTTP Headers. 
However, this does not play very well with the new Swagger component. 

Without the declarative support of query params in the Rest DSL camel-swagger 
cannot add that information to the REST-description (api-docs).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CAMEL-7820) Interceptors not regestering for Rest DSL

2014-09-15 Thread Espen Tjonneland (JIRA)
Espen Tjonneland created CAMEL-7820:
---

 Summary: Interceptors not regestering for Rest DSL
 Key: CAMEL-7820
 URL: https://issues.apache.org/jira/browse/CAMEL-7820
 Project: Camel
  Issue Type: Bug
  Components: camel-core
Affects Versions: 2.14.0
Reporter: Espen Tjonneland


My project only has one Rest DSL route. 

If I add interceptFrom().stop() in the beginning of a my RouteDefinition file, 
no stop of that route occurs. In addition, if I add the interceptFrom().stop() 
after my rest dsl route is defined, no exception is thrown (as it should be). 

However, if I add another regular DSL, like: 

from(timer://foo?fixedRate=trueperiod=10s).log(Hello world) 

The interceptor is fired (and Exception is thrown if I move the interceptor 
below the route). 

Here is a snippet of the code (I have removed some details inside it, like just 
piping the rest call over to log hello, and removed the details for the servlet 
config part).

{code}
@Component 
@DependsOn(camelConfig) 
public class IncomingRestCalls extends RouteBuilder { 

interceptFrom().id(Logging interceptor).bean(NISAccessLog.class); 

   restConfiguration()more code here..; 

rest(NISConfig.API_VERSION_1 + /holdings).description(Holdings 
service  +   NISConfig.API_VERSION_1) 
.consumes(application/json).produces(application/json) 

.get(/{ID}).description(List the customers holdings for the 
given ID.).outTypeList( 
InsuranceDTO.class).to(log:hello); 
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CAMEL-7820) Interceptors not working for Rest DSL

2014-09-15 Thread Espen Tjonneland (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-7820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Espen Tjonneland updated CAMEL-7820:

Summary: Interceptors not working for Rest DSL  (was: Interceptors not 
regestering for Rest DSL)

 Interceptors not working for Rest DSL
 -

 Key: CAMEL-7820
 URL: https://issues.apache.org/jira/browse/CAMEL-7820
 Project: Camel
  Issue Type: Bug
  Components: camel-core
Affects Versions: 2.14.0
Reporter: Espen Tjonneland

 My project only has one Rest DSL route. 
 If I add interceptFrom().stop() in the beginning of a my RouteDefinition 
 file, no stop of that route occurs. In addition, if I add the 
 interceptFrom().stop() after my rest dsl route is defined, no exception is 
 thrown (as it should be). 
 However, if I add another regular DSL, like: 
 from(timer://foo?fixedRate=trueperiod=10s).log(Hello world) 
 The interceptor is fired (and Exception is thrown if I move the interceptor 
 below the route). 
 Here is a snippet of the code (I have removed some details inside it, like 
 just piping the rest call over to log hello, and removed the details for the 
 servlet config part).
 {code}
 @Component 
 @DependsOn(camelConfig) 
 public class IncomingRestCalls extends RouteBuilder { 
 interceptFrom().id(Logging interceptor).bean(NISAccessLog.class); 
restConfiguration()more code here..; 
 rest(NISConfig.API_VERSION_1 + /holdings).description(Holdings 
 service  +   NISConfig.API_VERSION_1) 
 .consumes(application/json).produces(application/json) 
 .get(/{ID}).description(List the customers holdings for 
 the given ID.).outTypeList( 
 InsuranceDTO.class).to(log:hello); 
 }
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)