Skip to content

Commit

Permalink
add auto-generated cpanfile in perl client (#17662)
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Jan 20, 2024
1 parent 27f7667 commit e326d6a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ public PerlClientCodegen() {

// 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)
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS,
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC)
.defaultValue(Boolean.FALSE.toString()));

}
Expand Down Expand Up @@ -202,6 +202,7 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
supportingFiles.add(new SupportingFile("cpanfile.mustache", "", "cpanfile"));
}

@Override
Expand Down Expand Up @@ -700,9 +701,9 @@ public CodegenModel fromModel(String name, Schema sc) {
* A custom version is made for this method to ensure that
* property.format remains empty string
*
* @param name name of the property
* @param p OAS property schema
* @param required true if the property is required in the next higher object schema, false otherwise
* @param name name of the property
* @param p OAS property schema
* @param required true if the property is required in the next higher object schema, false otherwise
* @param schemaIsFromAdditionalProperties true if the property is defined by additional properties schema
* @return Codegen Property object
*/
Expand All @@ -714,5 +715,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo
}

@Override
public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.PERL; }
public GeneratorLanguage generatorLanguage() {
return GeneratorLanguage.PERL;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
requires 'Class::Accessor';
requires 'Test::Exception';
requires 'Test::More';
requires 'Log::Any';
requires 'LWP::UserAgent';
requires 'URI::Query';
requires 'Module::Runtime';
requires 'DateTime';
requires 'Module::Find';
requires 'Moose::Role';
requires 'JSON', '>= 2.00, < 2.80';
1 change: 1 addition & 0 deletions samples/client/petstore/perl/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.travis.yml
README.md
bin/autodoc
cpanfile
docs/AdditionalPropertiesClass.md
docs/AllOfWithSingleRef.md
docs/Animal.md
Expand Down
11 changes: 11 additions & 0 deletions samples/client/petstore/perl/cpanfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
requires 'Class::Accessor';
requires 'Test::Exception';
requires 'Test::More';
requires 'Log::Any';
requires 'LWP::UserAgent';
requires 'URI::Query';
requires 'Module::Runtime';
requires 'DateTime';
requires 'Module::Find';
requires 'Moose::Role';
requires 'JSON', '>= 2.00, < 2.80';

0 comments on commit e326d6a

Please sign in to comment.