Swagr code-gen: Changes to support 'ok' as return type and removing an unused reference

This commit is contained in:
Deepak Michael 2011-07-20 10:41:58 +05:30
parent f73ef03c50
commit e2e830235e
2 changed files with 4 additions and 3 deletions

View File

@ -134,6 +134,8 @@ public class JavaDataTypeMapper implements DataTypeMapper {
}else if (type.startsWith("Map[")) {
classShortName = type.substring(4, type.length()-1);
classShortName = getObjectType(classShortName, true);
}else if (type.equals("ok")) {
classShortName = "void";
}else{
classShortName = getObjectType(type, true);
}
@ -148,7 +150,7 @@ public class JavaDataTypeMapper implements DataTypeMapper {
* @return
*/
public String getReturnValueType(String type) {
if(type.equalsIgnoreCase("void")){
if(type.equalsIgnoreCase("void")|| type.equalsIgnoreCase("ok")){
return "void";
}
String classShortName = "";

View File

@ -6,7 +6,6 @@ import com.wordnik.exception.WordnikAPIException;
import com.wordnik.exception.WordnikExceptionCodes;
import com.wordnik.model.AudioFile;
import com.wordnik.model.FrequencySummary;
import com.wordnik.model.GetFrequencyOutput;
import org.codehaus.jackson.map.type.TypeFactory;
import org.codehaus.jackson.type.TypeReference;
@ -89,7 +88,7 @@ public abstract class AbstractWordAPI extends WordnikAPI {
*
* @param endYear Ending Year
*
* @return GetFrequencyOutput {@link com.wordnik.model.GetFrequencyOutput}
* @return FrequencySummary {@link com.wordnik.model.FrequencySummary}
* @throws WordnikAPIException 400 - Invalid word supplied. 404 - No results. 400 - Invalid word supplied. 404 - No results.
*/
@MethodArgumentNames(value="word, useCanonical, startYear, endYear")