com.reprezen.genflow.openapi3.doc.ParamDoc Maven / Gradle / Ivy
package com.reprezen.genflow.openapi3.doc;
import com.reprezen.genflow.openapi3.doc.HelperHelper;
import com.reprezen.genflow.openapi3.doc.HtmlHelper;
import com.reprezen.genflow.openapi3.doc.StructureTable;
import com.reprezen.kaizen.oasparser.model3.OpenApi3;
import com.reprezen.kaizen.oasparser.model3.Parameter;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
@SuppressWarnings("all")
public class ParamDoc {
@Extension
private HtmlHelper _htmlHelper = HelperHelper.getHtmlHelper();
private final String name;
private final OpenApi3 model = HelperHelper.getModel();
public ParamDoc(final OpenApi3 model, final String name) {
this.name = name;
}
public CharSequence getHtml() {
CharSequence _xblockexpression = null;
{
final Parameter param = this.model.getParameters().get(this.name);
StringConcatenation _builder = new StringConcatenation();
_builder.append("");
_builder.newLineIfNotEmpty();
_builder.append("");
_builder.newLine();
_builder.append(" ");
_builder.append("");
_builder.newLine();
_builder.append(" ");
_builder.append("");
_builder.append(this.name, " ");
_builder.append("
");
_builder.newLineIfNotEmpty();
_builder.append(" ");
_builder.append("");
_builder.newLine();
_builder.append(" ");
_builder.append("");
_builder.newLine();
_builder.append(" ");
String _paramHtml = this.paramHtml(this.model.getParameters().get(this.name));
_builder.append(_paramHtml, " ");
_builder.newLineIfNotEmpty();
_builder.append(" ");
_builder.append("");
_builder.newLine();
_builder.append("");
_builder.newLine();
_xblockexpression = _builder;
}
return _xblockexpression;
}
public String paramHtml(final Parameter param) {
return this.nonBodyParamHtml(param);
}
public String nonBodyParamHtml(final Parameter param) {
String _xblockexpression = null;
{
final StructureTable.ParameterStructureTable table = new StructureTable.ParameterStructureTable(param, new String[] { "name", "Name" }, new String[] { "in", "In" }, new String[] { "default", "Default" },
new String[] { "type", "Type" }, new String[] { "doc", "Description" });
_xblockexpression = table.render(param.getName());
}
return _xblockexpression;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy