forked from loafle/openapi-generator-original
"External Documentation Object" implemented (according to spec)
Depends on https://github.com/wordnik/swagger-core/pull/716
This commit is contained in:
parent
77053fa855
commit
436d2530e4
@ -12,4 +12,5 @@ public class CodegenModel {
|
|||||||
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>();
|
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>();
|
||||||
public Set<String> imports = new HashSet<String>();
|
public Set<String> imports = new HashSet<String>();
|
||||||
public Boolean hasVars, emptyVars, hasMoreModels;
|
public Boolean hasVars, emptyVars, hasMoreModels;
|
||||||
|
public ExternalDocs externalDocs;
|
||||||
}
|
}
|
@ -1,7 +1,6 @@
|
|||||||
package com.wordnik.swagger.codegen;
|
package com.wordnik.swagger.codegen;
|
||||||
|
|
||||||
import com.wordnik.swagger.models.*;
|
import com.wordnik.swagger.models.*;
|
||||||
import com.wordnik.swagger.models.properties.*;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -23,6 +22,7 @@ public class CodegenOperation {
|
|||||||
|
|
||||||
public Set<String> imports = new HashSet<String>();
|
public Set<String> imports = new HashSet<String>();
|
||||||
public List<Map<String, String>> examples;
|
public List<Map<String, String>> examples;
|
||||||
|
public ExternalDocs externalDocs;
|
||||||
|
|
||||||
// legacy support
|
// legacy support
|
||||||
public String nickname;
|
public String nickname;
|
||||||
|
@ -325,6 +325,7 @@ public class DefaultCodegen {
|
|||||||
m.classname = toModelName(name);
|
m.classname = toModelName(name);
|
||||||
m.classVarName = toVarName(name);
|
m.classVarName = toVarName(name);
|
||||||
m.modelJson = Json.pretty(model);
|
m.modelJson = Json.pretty(model);
|
||||||
|
m.externalDocs = model.getExternalDocs();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if(model instanceof ArrayModel) {
|
if(model instanceof ArrayModel) {
|
||||||
ArrayModel am = (ArrayModel) model;
|
ArrayModel am = (ArrayModel) model;
|
||||||
@ -775,7 +776,7 @@ public class DefaultCodegen {
|
|||||||
|
|
||||||
if(op.allParams.size() > 0)
|
if(op.allParams.size() > 0)
|
||||||
op.hasParams = true;
|
op.hasParams = true;
|
||||||
|
op.externalDocs = operation.getExternalDocs();
|
||||||
return op;
|
return op;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,9 @@ public class DefaultGenerator implements Generator {
|
|||||||
bundle.put("models", allModels);
|
bundle.put("models", allModels);
|
||||||
bundle.put("apiFolder", config.apiPackage().replaceAll("\\.", "/"));
|
bundle.put("apiFolder", config.apiPackage().replaceAll("\\.", "/"));
|
||||||
bundle.put("modelPackage", config.modelPackage());
|
bundle.put("modelPackage", config.modelPackage());
|
||||||
|
if (swagger.getExternalDocs() != null) {
|
||||||
|
bundle.put("externalDocs", swagger.getExternalDocs());
|
||||||
|
}
|
||||||
for(int i = 0; i < allModels.size() - 1; i++) {
|
for(int i = 0; i < allModels.size() - 1; i++) {
|
||||||
HashMap<String, CodegenModel> cm = (HashMap<String, CodegenModel>) allModels.get(i);
|
HashMap<String, CodegenModel> cm = (HashMap<String, CodegenModel>) allModels.get(i);
|
||||||
CodegenModel m = cm.get("model");
|
CodegenModel m = cm.get("model");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user