Merge pull request #3 from wing328/add_go_generator_testfix

Add missing generator cliOption
This commit is contained in:
William Cheng 2018-03-28 15:42:30 +08:00 committed by GitHub
commit 0821cf7fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -51,6 +51,12 @@ public class GoClientCodegen extends AbstractGoCodegen {
.defaultValue("1.0.0")); .defaultValue("1.0.0"));
cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)")); cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)"));
// option to change the order of form/body parameter
cliOptions.add(CliOption.newBoolean(
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS,
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC)
.defaultValue(Boolean.FALSE.toString()));
} }
@Override @Override

View File

@ -46,7 +46,7 @@ public abstract class AbstractOptionsTest {
final Set<String> undocumented = new HashSet<String>(testOptions); final Set<String> undocumented = new HashSet<String>(testOptions);
undocumented.removeAll(cliOptions); undocumented.removeAll(cliOptions);
if (!undocumented.isEmpty()) { if (!undocumented.isEmpty()) {
Assert.fail(String.format("These options weren't documented: %s.", StringUtils.join(undocumented, ", "))); Assert.fail(String.format("These options weren't documented: %s. Are you expecting base options and calling cliOptions.clear()?", StringUtils.join(undocumented, ", ")));
} }
} }