From 7d642b28b95beb376750e5bda5c8b14c299d929c Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 11 Feb 2016 18:43:51 +0800 Subject: [PATCH 1/7] add doc for api method --- .../io/swagger/codegen/CodegenConfig.java | 14 +++++ .../io/swagger/codegen/DefaultCodegen.java | 51 +++++++++++++++++++ .../io/swagger/codegen/DefaultGenerator.java | 45 ++++++++++++++++ .../codegen/languages/PerlClientCodegen.java | 23 ++++++++- samples/client/petstore/perl/README.md | 2 +- .../perl/lib/WWW/SwaggerClient/Role.pm | 4 +- samples/client/petstore/perl/test.pl | 8 +++ 7 files changed, 143 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConfig.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConfig.java index 6809c4970d2..0253582a639 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConfig.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConfig.java @@ -29,6 +29,8 @@ public interface CodegenConfig { String apiTestFileFolder(); + String apiDocFileFolder(); + String fileSuffix(); String outputFolder(); @@ -41,6 +43,8 @@ public interface CodegenConfig { String modelTestFileFolder(); + String modelDocFileFolder(); + String modelPackage(); String toApiName(String name); @@ -99,6 +103,10 @@ public interface CodegenConfig { Map modelTestTemplateFiles(); + Map apiDocTemplateFiles(); + + Map modelDocTemplateFiles(); + Set languageSpecificPrimitives(); void preprocessSwagger(Swagger swagger); @@ -115,6 +123,10 @@ public interface CodegenConfig { String toModelTestFilename(String name); + String toApiDocFilename(String name); + + String toModelDocFilename(String name); + String toModelImport(String name); String toApiImport(String name); @@ -137,6 +149,8 @@ public interface CodegenConfig { String apiTestFilename(String templateName, String tag); + String apiDocFilename(String templateName, String tag); + boolean shouldOverwrite(String filename); boolean isSkipOverwrite(); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 071f6220cff..9238a770589 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -69,6 +69,8 @@ public class DefaultCodegen { protected Map modelTemplateFiles = new HashMap(); protected Map apiTestTemplateFiles = new HashMap(); protected Map modelTestTemplateFiles = new HashMap(); + protected Map apiDocTemplateFiles = new HashMap(); + protected Map modelDocTemplateFiles = new HashMap(); protected String templateDir; protected String embeddedTemplateDir; protected Map additionalProperties = new HashMap(); @@ -228,6 +230,14 @@ public String embeddedTemplateDir() { } } + public Map apiDocTemplateFiles() { + return apiDocTemplateFiles; + } + + public Map modelDocTemplateFiles() { + return modelDocTemplateFiles; + } + public Map apiTestTemplateFiles() { return apiTestTemplateFiles; } @@ -260,6 +270,14 @@ public String modelTestFileFolder() { return outputFolder + "/" + testPackage().replace('.', '/'); } + public String apiDocFileFolder() { + return outputFolder; + } + + public String modelDocFileFolder() { + return outputFolder; + } + public Map additionalProperties() { return additionalProperties; } @@ -322,6 +340,16 @@ public String toApiFilename(String name) { return toApiName(name); } + /** + * Return the file name of the Api Documentation + * + * @param name the file name of the Api + * @return the file name of the Api + */ + public String toApiDocFilename(String name) { + return toApiName(name); + } + /** * Return the file name of the Api Test * @@ -362,6 +390,16 @@ public String toModelTestFilename(String name) { return initialCaps(name) + "Test"; } + /** + * Return the capitalized file name of the model documentation + * + * @param name the model name + * @return the file name of the model + */ + public String toModelDocFilename(String name) { + return initialCaps(name); + } + /** * Return the operation ID (method name) * @@ -2196,6 +2234,19 @@ public String apiFilename(String templateName, String tag) { return apiFileFolder() + '/' + toApiFilename(tag) + suffix; } + /** + * Return the full path and API documentation file + * + * @param templateName template name + * @param tag tag + * + * @return the API documentation file name with full path + */ + public String apiDocFilename(String templateName, String tag) { + String suffix = apiDocTemplateFiles().get(templateName); + return apiDocFileFolder() + '/' + toApiDocFilename(tag) + suffix; + } + /** * Return the full path and API test file * diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index c966cf6ba66..7bf60521d0e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -263,6 +263,28 @@ public Reader getTemplate(String name) { writeToFile(filename, tmpl.execute(models)); files.add(new File(filename)); } + + // to generate model documentation files + for (String templateName : config.modelDocTemplateFiles().keySet()) { + String suffix = config.modelDocTemplateFiles().get(templateName); + String filename = config.modelDocFileFolder() + File.separator + config.toModelDocFilename(name) + suffix; + if (!config.shouldOverwrite(filename)) { + continue; + } + String templateFile = getFullTemplateFile(config, templateName); + String template = readTemplate(templateFile); + Template tmpl = Mustache.compiler() + .withLoader(new Mustache.TemplateLoader() { + @Override + public Reader getTemplate(String name) { + return getTemplateReader(getFullTemplateFile(config, name + ".mustache")); + } + }) + .defaultValue("") + .compile(template); + writeToFile(filename, tmpl.execute(models)); + files.add(new File(filename)); + } } catch (Exception e) { throw new RuntimeException("Could not generate model '" + name + "'", e); } @@ -368,6 +390,29 @@ public Reader getTemplate(String name) { files.add(new File(filename)); } + // to generate api documentation files + for (String templateName : config.apiDocTemplateFiles().keySet()) { + String filename = config.apiDocFilename(templateName, tag); + if (!config.shouldOverwrite(filename) && new File(filename).exists()) { + continue; + } + + String templateFile = getFullTemplateFile(config, templateName); + String template = readTemplate(templateFile); + Template tmpl = Mustache.compiler() + .withLoader(new Mustache.TemplateLoader() { + @Override + public Reader getTemplate(String name) { + return getTemplateReader(getFullTemplateFile(config, name + ".mustache")); + } + }) + .defaultValue("") + .compile(template); + + writeToFile(filename, tmpl.execute(operation)); + files.add(new File(filename)); + } + } catch (Exception e) { throw new RuntimeException("Could not generate api file for '" + tag + "'", e); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java index 740f9ac2b21..5ba366c39c1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java @@ -34,6 +34,8 @@ public PerlClientCodegen() { apiTemplateFiles.put("api.mustache", ".pm"); modelTestTemplateFiles.put("object_test.mustache", ".t"); apiTestTemplateFiles.put("api_test.mustache", ".t"); + modelDocTemplateFiles.put("object_doc.mustache", ".md"); + apiDocTemplateFiles.put("api_doc.mustache", ".md"); embeddedTemplateDir = templateDir = "perl"; @@ -147,7 +149,6 @@ public String modelFileFolder() { return (outputFolder + "/lib/" + modulePathPart + modelPackage()).replace('/', File.separatorChar); } - @Override public String apiTestFileFolder() { return (outputFolder + "/t").replace('/', File.separatorChar); @@ -158,6 +159,16 @@ public String modelTestFileFolder() { return (outputFolder + "/t").replace('/', File.separatorChar); } + @Override + public String apiDocFileFolder() { + return (outputFolder).replace('/', File.separatorChar); + } + + @Override + public String modelDocFileFolder() { + return (outputFolder).replace('/', File.separatorChar); + } + @Override public String getTypeDeclaration(Property p) { if (p instanceof ArrayProperty) { @@ -251,11 +262,21 @@ public String toModelTestFilename(String name) { return toModelFilename(name) + "Test"; } + @Override + public String toModelDocFilename(String name) { + return toModelFilename(name); + } + @Override public String toApiTestFilename(String name) { return toApiFilename(name) + "Test"; } + @Override + public String toApiDocFilename(String name) { + return toApiFilename(name); + } + @Override public String toApiFilename(String name) { // replace - with _ e.g. created-at => created_at diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 06dc39ccad2..70fdd1b6c70 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore Automatically generated by the Perl Swagger Codegen project: -- Build date: 2016-03-04T14:39:09.479+08:00 +- Build date: 2016-02-11T18:16:24.249+08:00 - Build package: class io.swagger.codegen.languages.PerlClientCodegen - Codegen version: diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm index 1334b695271..05ff51b7c22 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm @@ -37,7 +37,7 @@ has version_info => ( is => 'ro', default => sub { { app_name => 'Swagger Petstore', app_version => '1.0.0', - generated_date => '2016-03-04T14:39:09.479+08:00', + generated_date => '2016-02-11T18:16:24.249+08:00', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', } }, documentation => 'Information about the application version and the codegen codebase version' @@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project: =over 4 -=item Build date: 2016-03-04T14:39:09.479+08:00 +=item Build date: 2016-02-11T18:16:24.249+08:00 =item Build package: class io.swagger.codegen.languages.PerlClientCodegen diff --git a/samples/client/petstore/perl/test.pl b/samples/client/petstore/perl/test.pl index b12105c9054..626d25357fc 100755 --- a/samples/client/petstore/perl/test.pl +++ b/samples/client/petstore/perl/test.pl @@ -25,6 +25,14 @@ my $api = WWW::SwaggerClient::PetApi->new(); +# exception handling +#eval { +# print "\nget_pet_by_id:".Dumper $api->get_pet_by_id(pet_id => 9999); +#}; +#if ($@) { +# print "Exception when calling: $@\n"; +#} + my $pet_id = 10008; my $category = WWW::SwaggerClient::Object::Category->new('id' => '2', 'name' => 'perl'); From e5ed295a789eb693ad03de19e81546b1950b4c1a Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 6 Mar 2016 01:24:41 +0800 Subject: [PATCH 2/7] add example to codegen parameter --- .../io/swagger/codegen/CodegenParameter.java | 2 + .../io/swagger/codegen/DefaultCodegen.java | 41 +++++++++++- .../codegen/languages/PerlClientCodegen.java | 63 +++++++++++++++++++ samples/client/petstore/perl/README.md | 2 +- .../SwaggerClient/Object/InlineResponse200.pm | 31 ++++++++- .../perl/lib/WWW/SwaggerClient/Role.pm | 4 +- 6 files changed, 137 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java index 4a8c34e374f..a1b299f818c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java @@ -10,6 +10,7 @@ public class CodegenParameter { isCookieParam, isBodyParam, hasMore, isContainer, secondaryParam, isCollectionFormatMulti; public String baseName, paramName, dataType, datatypeWithEnum, collectionFormat, description, baseType, defaultValue; + public String example; // example value (x-example) public String jsonSchema; public Boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime; public Boolean isListContainer, isMapContainer; @@ -107,6 +108,7 @@ public CodegenParameter copy() { output.multipleOf = this.multipleOf; output.jsonSchema = this.jsonSchema; output.defaultValue = this.defaultValue; + output.example = this.example; output.isEnum = this.isEnum; if (this._enum != null) { output._enum = new ArrayList(this._enum); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 9238a770589..47d475eba84 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -652,13 +652,22 @@ public String toInstantiationType(Property p) { } } + /** + * Return the example value of the parameter. + * + * @param p Swagger property object + * @return string presentation of the example value of the property + */ + public void setParameterExampleValue(CodegenParameter p) { + + } + /** * Return the example value of the property * * @param p Swagger property object * @return string presentation of the example value of the property */ - @SuppressWarnings("static-method") public String toExampleValue(Property p) { if(p.getExample() != null) { return p.getExample().toString(); @@ -1806,6 +1815,36 @@ public CodegenParameter fromParameter(Parameter param, Set imports) { p.paramName = toParamName(bp.getName()); } + // set the example value + // if not specified in x-example, generate a default value + if (p.vendorExtensions.containsKey("x-example")) { + p.example = (String) p.vendorExtensions.get("x-example"); + } else if (Boolean.TRUE.equals(p.isString)) { + p.example = p.paramName + "_example"; + } else if (Boolean.TRUE.equals(p.isBoolean)) { + p.example = new String("true"); + } else if (Boolean.TRUE.equals(p.isLong)) { + p.example = new String("789"); + } else if (Boolean.TRUE.equals(p.isInteger)) { + p.example = new String("56"); + } else if (Boolean.TRUE.equals(p.isFloat)) { + p.example = new String("3.4"); + } else if (Boolean.TRUE.equals(p.isDouble)) { + p.example = new String("1.2"); + } else if (Boolean.TRUE.equals(p.isBinary)) { + p.example = new String("BINARY_DATA_HERE"); + } else if (Boolean.TRUE.equals(p.isByteArray)) { + p.example = new String("B"); + } else if (Boolean.TRUE.equals(p.isDate)) { + p.example = new String("2013-10-20"); + } else if (Boolean.TRUE.equals(p.isDateTime)) { + p.example = new String("2013-10-20T19:20:30+01:00"); + } + + // set the parameter excample value + // should be overridden by exmaple value + setParameterExampleValue(p); + postProcessParameter(p); return p; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java index 5ba366c39c1..b770f84bac1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java @@ -1,6 +1,7 @@ package io.swagger.codegen.languages; import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.CodegenParameter; import io.swagger.codegen.CodegenType; import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.SupportingFile; @@ -9,6 +10,17 @@ import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.Property; +import io.swagger.models.properties.StringProperty; +import io.swagger.models.properties.LongProperty; +import io.swagger.models.properties.IntegerProperty; +import io.swagger.models.properties.FloatProperty; +import io.swagger.models.properties.DoubleProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.BinaryProperty; +import io.swagger.models.properties.ByteArrayProperty; +import io.swagger.models.properties.DateTimeProperty; +import io.swagger.models.properties.DateProperty; + import java.io.File; import java.util.Arrays; @@ -203,6 +215,42 @@ public String getSwaggerType(Property p) { @Override public String toDefaultValue(Property p) { + if (p instanceof StringProperty) { + StringProperty dp = (StringProperty) p; + if (dp.getDefault() != null) { + return "'" + dp.getDefault().toString() + "'"; + } + } else if (p instanceof BooleanProperty) { + BooleanProperty dp = (BooleanProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof DateProperty) { + // TODO + } else if (p instanceof DateTimeProperty) { + // TODO + } else if (p instanceof DoubleProperty) { + DoubleProperty dp = (DoubleProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof FloatProperty) { + FloatProperty dp = (FloatProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof IntegerProperty) { + IntegerProperty dp = (IntegerProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof LongProperty) { + LongProperty dp = (LongProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } + return "null"; } @@ -324,4 +372,19 @@ public void setModulePathPart(String modulePathPart) { public void setModuleVersion(String moduleVersion) { this.moduleVersion = moduleVersion; } + + @Override + public void setParameterExampleValue(CodegenParameter p) { + if (Boolean.TRUE.equals(p.isString) || Boolean.TRUE.equals(p.isBinary) || Boolean.TRUE.equals(p.isByteArray)) { + p.example = "'" + p.example + "'"; + } else if (Boolean.TRUE.equals(p.isBoolean)) { + if (Boolean.parseBoolean(p.example)) + p.example = new String("1"); + else + p.example = new String("0"); + } else if (Boolean.TRUE.equals(p.isDateTime) || Boolean.TRUE.equals(p.isDate)) { + p.example = "DateTime->from_epoch(epoch => str2time('" + p.example + "'))"; + } + + } } diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 70fdd1b6c70..1fa95a7c7f8 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore Automatically generated by the Perl Swagger Codegen project: -- Build date: 2016-02-11T18:16:24.249+08:00 +- Build date: 2016-03-05T22:31:46.328+08:00 - Build package: class io.swagger.codegen.languages.PerlClientCodegen - Codegen version: diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/InlineResponse200.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/InlineResponse200.pm index 61ce10e3a2e..90f7bad236e 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/InlineResponse200.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/InlineResponse200.pm @@ -103,6 +103,13 @@ __PACKAGE__->class_documentation({description => '', } ); __PACKAGE__->method_documentation({ + 'tags' => { + datatype => 'ARRAY[Tag]', + base_name => 'tags', + description => '', + format => '', + read_only => '', + }, 'id' => { datatype => 'int', base_name => 'id', @@ -117,6 +124,13 @@ __PACKAGE__->method_documentation({ format => '', read_only => '', }, + 'status' => { + datatype => 'string', + base_name => 'status', + description => 'pet status in the store', + format => '', + read_only => '', + }, 'name' => { datatype => 'string', base_name => 'name', @@ -124,19 +138,32 @@ __PACKAGE__->method_documentation({ format => '', read_only => '', }, + 'photo_urls' => { + datatype => 'ARRAY[string]', + base_name => 'photoUrls', + description => '', + format => '', + read_only => '', + }, }); __PACKAGE__->swagger_types( { + 'tags' => 'ARRAY[Tag]', 'id' => 'int', 'category' => 'object', - 'name' => 'string' + 'status' => 'string', + 'name' => 'string', + 'photo_urls' => 'ARRAY[string]' } ); __PACKAGE__->attribute_map( { + 'tags' => 'tags', 'id' => 'id', 'category' => 'category', - 'name' => 'name' + 'status' => 'status', + 'name' => 'name', + 'photo_urls' => 'photoUrls' } ); __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm index 05ff51b7c22..98f45f53af0 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm @@ -37,7 +37,7 @@ has version_info => ( is => 'ro', default => sub { { app_name => 'Swagger Petstore', app_version => '1.0.0', - generated_date => '2016-02-11T18:16:24.249+08:00', + generated_date => '2016-03-05T22:31:46.328+08:00', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', } }, documentation => 'Information about the application version and the codegen codebase version' @@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project: =over 4 -=item Build date: 2016-02-11T18:16:24.249+08:00 +=item Build date: 2016-03-05T22:31:46.328+08:00 =item Build package: class io.swagger.codegen.languages.PerlClientCodegen From 855f46fed0e98104fd4ba8f518d95ebd54a429be Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 6 Mar 2016 13:07:09 +0800 Subject: [PATCH 3/7] add api and model documentation --- .../io/swagger/codegen/DefaultCodegen.java | 9 +- .../codegen/languages/PerlClientCodegen.java | 13 +- .../src/main/resources/perl/README.mustache | 14 + .../src/test/resources/2_0/petstore.json | 1 + samples/client/petstore/perl/README.md | 47 +- .../perl/deep_module_testdocs/Category.md | 14 + .../deep_module_testdocs/InlineResponse200.md | 18 + .../perl/deep_module_testdocs/ObjectReturn.md | 13 + .../perl/deep_module_testdocs/Order.md | 18 + .../petstore/perl/deep_module_testdocs/Pet.md | 18 + .../perl/deep_module_testdocs/PetApi.md | 443 ++++++++++++++++++ .../deep_module_testdocs/SpecialModelName.md | 13 + .../perl/deep_module_testdocs/StoreApi.md | 234 +++++++++ .../petstore/perl/deep_module_testdocs/Tag.md | 14 + .../perl/deep_module_testdocs/User.md | 20 + .../perl/deep_module_testdocs/UserApi.md | 318 +++++++++++++ samples/client/petstore/perl/docs/Category.md | 14 + .../petstore/perl/docs/InlineResponse200.md | 18 + .../client/petstore/perl/docs/ObjectReturn.md | 13 + samples/client/petstore/perl/docs/Order.md | 18 + samples/client/petstore/perl/docs/Pet.md | 18 + samples/client/petstore/perl/docs/PetApi.md | 443 ++++++++++++++++++ .../petstore/perl/docs/SpecialModelName.md | 13 + samples/client/petstore/perl/docs/StoreApi.md | 234 +++++++++ samples/client/petstore/perl/docs/Tag.md | 14 + samples/client/petstore/perl/docs/User.md | 20 + samples/client/petstore/perl/docs/UserApi.md | 318 +++++++++++++ .../perl/lib/WWW/SwaggerClient/Role.pm | 4 +- 28 files changed, 2326 insertions(+), 8 deletions(-) create mode 100644 samples/client/petstore/perl/deep_module_testdocs/Category.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/InlineResponse200.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/ObjectReturn.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/Order.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/Pet.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/PetApi.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/SpecialModelName.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/StoreApi.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/Tag.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/User.md create mode 100644 samples/client/petstore/perl/deep_module_testdocs/UserApi.md create mode 100644 samples/client/petstore/perl/docs/Category.md create mode 100644 samples/client/petstore/perl/docs/InlineResponse200.md create mode 100644 samples/client/petstore/perl/docs/ObjectReturn.md create mode 100644 samples/client/petstore/perl/docs/Order.md create mode 100644 samples/client/petstore/perl/docs/Pet.md create mode 100644 samples/client/petstore/perl/docs/PetApi.md create mode 100644 samples/client/petstore/perl/docs/SpecialModelName.md create mode 100644 samples/client/petstore/perl/docs/StoreApi.md create mode 100644 samples/client/petstore/perl/docs/Tag.md create mode 100644 samples/client/petstore/perl/docs/User.md create mode 100644 samples/client/petstore/perl/docs/UserApi.md diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 47d475eba84..6f4987669bb 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -1839,10 +1839,15 @@ public CodegenParameter fromParameter(Parameter param, Set imports) { p.example = new String("2013-10-20"); } else if (Boolean.TRUE.equals(p.isDateTime)) { p.example = new String("2013-10-20T19:20:30+01:00"); - } + } else if (param instanceof FormParameter && + ("file".equalsIgnoreCase(((FormParameter) param).getType()) || + "file".equals(p.baseType))) { + p.isFile = true; + p.example = new String("/path/to/file.txt"); + } // set the parameter excample value - // should be overridden by exmaple value + // should be overridden by lang codegen setParameterExampleValue(p); postProcessParameter(p); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java index b770f84bac1..f53d7c1a1e1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java @@ -35,6 +35,8 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig { protected String moduleName = "WWW::SwaggerClient"; protected String modulePathPart = moduleName.replaceAll("::", Matcher.quoteReplacement(File.separator)); protected String moduleVersion = "1.0.0"; + protected String apiDocPath = "docs/"; + protected String modelDocPath = "docs/"; protected static int emptyFunctionNameCounter = 0; @@ -122,6 +124,10 @@ public void processOpts() { additionalProperties.put(MODULE_NAME, moduleName); } + // make api and model doc path available in mustache template + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + supportingFiles.add(new SupportingFile("ApiClient.mustache", ("lib/" + modulePathPart).replace('/', File.separatorChar), "ApiClient.pm")); supportingFiles.add(new SupportingFile("Configuration.mustache", ("lib/" + modulePathPart).replace('/', File.separatorChar), "Configuration.pm")); supportingFiles.add(new SupportingFile("ApiFactory.mustache", ("lib/" + modulePathPart).replace('/', File.separatorChar), "ApiFactory.pm")); @@ -173,12 +179,12 @@ public String modelTestFileFolder() { @Override public String apiDocFileFolder() { - return (outputFolder).replace('/', File.separatorChar); + return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); } @Override public String modelDocFileFolder() { - return (outputFolder).replace('/', File.separatorChar); + return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); } @Override @@ -375,7 +381,8 @@ public void setModuleVersion(String moduleVersion) { @Override public void setParameterExampleValue(CodegenParameter p) { - if (Boolean.TRUE.equals(p.isString) || Boolean.TRUE.equals(p.isBinary) || Boolean.TRUE.equals(p.isByteArray)) { + if (Boolean.TRUE.equals(p.isString) || Boolean.TRUE.equals(p.isBinary) || + Boolean.TRUE.equals(p.isByteArray) || Boolean.TRUE.equals(p.isFile)) { p.example = "'" + p.example + "'"; } else if (Boolean.TRUE.equals(p.isBoolean)) { if (Boolean.parseBoolean(p.example)) diff --git a/modules/swagger-codegen/src/main/resources/perl/README.mustache b/modules/swagger-codegen/src/main/resources/perl/README.mustache index 62d57f6b3cf..cf59be85a57 100644 --- a/modules/swagger-codegen/src/main/resources/perl/README.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/README.mustache @@ -217,3 +217,17 @@ spec. If so, this is available via the `class_documentation()` and Each of these calls returns a hashref with various useful pieces of information. + +# DOCUMENTATION FOR API ENDPOINTS + +All URIs are relative to {{basePath}} + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{classname}} | [{{nickname}}]({{apiDocPath}}{{classname}}.md#{{nickname}}) | {{httpMethod}} {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +# DOCUMENTATION FOR MODELS +{{#models}}{{#model}} - [{{moduleName}}::Object::{{classname}}]({{modelDocPath}}{{classname}}.md) +{{/model}}{{/models}} + diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore.json b/modules/swagger-codegen/src/test/resources/2_0/petstore.json index 3034c0a8ce5..d418e35c141 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore.json +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore.json @@ -1293,6 +1293,7 @@ } }, "Return": { + "descripton": "Model for testing reserved words", "properties": { "return": { "type": "integer", diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 1fa95a7c7f8..3044f17d76c 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore Automatically generated by the Perl Swagger Codegen project: -- Build date: 2016-03-05T22:31:46.328+08:00 +- Build date: 2016-03-06T12:43:31.929+08:00 - Build package: class io.swagger.codegen.languages.PerlClientCodegen - Codegen version: @@ -217,3 +217,48 @@ spec. If so, this is available via the `class_documentation()` and Each of these calls returns a hashref with various useful pieces of information. + +# DOCUMENTATION FOR API ENDPOINTS + +All URIs are relative to http://petstore.swagger.io/v2 + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +UserApi | [create_user](docs/UserApi.md#create_user) | POST /user | Create user +UserApi | [create_users_with_array_input](docs/UserApi.md#create_users_with_array_input) | POST /user/createWithArray | Creates list of users with given input array +UserApi | [create_users_with_list_input](docs/UserApi.md#create_users_with_list_input) | POST /user/createWithList | Creates list of users with given input array +UserApi | [login_user](docs/UserApi.md#login_user) | GET /user/login | Logs user into the system +UserApi | [logout_user](docs/UserApi.md#logout_user) | GET /user/logout | Logs out current logged in user session +UserApi | [get_user_by_name](docs/UserApi.md#get_user_by_name) | GET /user/{username} | Get user by user name +UserApi | [update_user](docs/UserApi.md#update_user) | PUT /user/{username} | Updated user +UserApi | [delete_user](docs/UserApi.md#delete_user) | DELETE /user/{username} | Delete user +PetApi | [update_pet](docs/PetApi.md#update_pet) | PUT /pet | Update an existing pet +PetApi | [add_pet](docs/PetApi.md#add_pet) | POST /pet | Add a new pet to the store +PetApi | [find_pets_by_status](docs/PetApi.md#find_pets_by_status) | GET /pet/findByStatus | Finds Pets by status +PetApi | [find_pets_by_tags](docs/PetApi.md#find_pets_by_tags) | GET /pet/findByTags | Finds Pets by tags +PetApi | [get_pet_by_id](docs/PetApi.md#get_pet_by_id) | GET /pet/{petId} | Find pet by ID +PetApi | [update_pet_with_form](docs/PetApi.md#update_pet_with_form) | POST /pet/{petId} | Updates a pet in the store with form data +PetApi | [delete_pet](docs/PetApi.md#delete_pet) | DELETE /pet/{petId} | Deletes a pet +PetApi | [upload_file](docs/PetApi.md#upload_file) | POST /pet/{petId}/uploadImage | uploads an image +PetApi | [get_pet_by_id_in_object](docs/PetApi.md#get_pet_by_id_in_object) | GET /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' +PetApi | [pet_pet_idtesting_byte_arraytrue_get](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | GET /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' +PetApi | [add_pet_using_byte_array](docs/PetApi.md#add_pet_using_byte_array) | POST /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store +StoreApi | [find_orders_by_status](docs/StoreApi.md#find_orders_by_status) | GET /store/findByStatus | Finds orders by status +StoreApi | [get_inventory](docs/StoreApi.md#get_inventory) | GET /store/inventory | Returns pet inventories by status +StoreApi | [get_inventory_in_object](docs/StoreApi.md#get_inventory_in_object) | GET /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' +StoreApi | [place_order](docs/StoreApi.md#place_order) | POST /store/order | Place an order for a pet +StoreApi | [get_order_by_id](docs/StoreApi.md#get_order_by_id) | GET /store/order/{orderId} | Find purchase order by ID +StoreApi | [delete_order](docs/StoreApi.md#delete_order) | DELETE /store/order/{orderId} | Delete purchase order by ID + + +# DOCUMENTATION FOR MODELS + - [WWW::SwaggerClient::Object::User](docs/User.md) + - [WWW::SwaggerClient::Object::Category](docs/Category.md) + - [WWW::SwaggerClient::Object::Pet](docs/Pet.md) + - [WWW::SwaggerClient::Object::Tag](docs/Tag.md) + - [WWW::SwaggerClient::Object::ObjectReturn](docs/ObjectReturn.md) + - [WWW::SwaggerClient::Object::Order](docs/Order.md) + - [WWW::SwaggerClient::Object::SpecialModelName](docs/SpecialModelName.md) + - [WWW::SwaggerClient::Object::InlineResponse200](docs/InlineResponse200.md) + + diff --git a/samples/client/petstore/perl/deep_module_testdocs/Category.md b/samples/client/petstore/perl/deep_module_testdocs/Category.md new file mode 100644 index 00000000000..b1e3583fb3f --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/Category.md @@ -0,0 +1,14 @@ +# Something::Deep::Object::Category + +## Import the module +```perl +use Something::Deep::Object::Category; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**name** | **string** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/deep_module_testdocs/InlineResponse200.md b/samples/client/petstore/perl/deep_module_testdocs/InlineResponse200.md new file mode 100644 index 00000000000..15521e3d323 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/InlineResponse200.md @@ -0,0 +1,18 @@ +# Something::Deep::Object::InlineResponse200 + +## Import the module +```perl +use Something::Deep::Object::InlineResponse200; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | [**ARRAY[Tag]**](docs/Tag.md) | | [optional][default to null] +**id** | **int** | | [default to null] +**category** | **object** | | [optional][default to null] +**status** | **string** | pet status in the store | [optional][default to null] +**name** | **string** | | [optional][default to null] +**photo_urls** | **ARRAY[string]** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/deep_module_testdocs/ObjectReturn.md b/samples/client/petstore/perl/deep_module_testdocs/ObjectReturn.md new file mode 100644 index 00000000000..e1195f4f899 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/ObjectReturn.md @@ -0,0 +1,13 @@ +# Something::Deep::Object::ObjectReturn + +## Import the module +```perl +use Something::Deep::Object::ObjectReturn; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return** | **int** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/deep_module_testdocs/Order.md b/samples/client/petstore/perl/deep_module_testdocs/Order.md new file mode 100644 index 00000000000..930360b85d1 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/Order.md @@ -0,0 +1,18 @@ +# Something::Deep::Object::Order + +## Import the module +```perl +use Something::Deep::Object::Order; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**pet_id** | **int** | | [optional][default to null] +**quantity** | **int** | | [optional][default to null] +**ship_date** | **DateTime** | | [optional][default to null] +**status** | **string** | Order Status | [optional][default to null] +**complete** | **boolean** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/deep_module_testdocs/Pet.md b/samples/client/petstore/perl/deep_module_testdocs/Pet.md new file mode 100644 index 00000000000..f0b71169504 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/Pet.md @@ -0,0 +1,18 @@ +# Something::Deep::Object::Pet + +## Import the module +```perl +use Something::Deep::Object::Pet; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**category** | [**Category**](docs/Category.md) | | [optional][default to null] +**name** | **string** | | [default to null] +**photo_urls** | **ARRAY[string]** | | [default to null] +**tags** | [**ARRAY[Tag]**](docs/Tag.md) | | [optional][default to null] +**status** | **string** | pet status in the store | [optional][default to null] + + diff --git a/samples/client/petstore/perl/deep_module_testdocs/PetApi.md b/samples/client/petstore/perl/deep_module_testdocs/PetApi.md new file mode 100644 index 00000000000..fe44d5a2910 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/PetApi.md @@ -0,0 +1,443 @@ +# Something::Deep::PetApi + +- [update_pet](#update_pet): Update an existing pet +- [add_pet](#add_pet): Add a new pet to the store +- [find_pets_by_status](#find_pets_by_status): Finds Pets by status +- [find_pets_by_tags](#find_pets_by_tags): Finds Pets by tags +- [get_pet_by_id](#get_pet_by_id): Find pet by ID +- [update_pet_with_form](#update_pet_with_form): Updates a pet in the store with form data +- [delete_pet](#delete_pet): Deletes a pet +- [upload_file](#upload_file): uploads an image +- [get_pet_by_id_in_object](#get_pet_by_id_in_object): Fake endpoint to test inline arbitrary object return by 'Find pet by ID' +- [pet_pet_idtesting_byte_arraytrue_get](#pet_pet_idtesting_byte_arraytrue_get): Fake endpoint to test byte array return by 'Find pet by ID' +- [add_pet_using_byte_array](#add_pet_using_byte_array): Fake endpoint to test byte array in body parameter for adding a new pet to the store + +## **update_pet** + +Update an existing pet + + + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $body = new Something::Deep::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store + +eval { + my $result = $api->update_pet(body => $body); +}; +if ($@) { + warn "Exception when calling update_pet: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | Pet | Pet object that needs to be added to the store + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: application/json, application/xml +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **add_pet** + +Add a new pet to the store + + + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $body = new Something::Deep::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store + +eval { + my $result = $api->add_pet(body => $body); +}; +if ($@) { + warn "Exception when calling add_pet: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | Pet | Pet object that needs to be added to the store + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: application/json, application/xml +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **find_pets_by_status** + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $status = ; # [ARRAY[string]] Status values that need to be considered for query + +eval { + my $result = $api->find_pets_by_status(status => $status); +}; +if ($@) { + warn "Exception when calling find_pets_by_status: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | status | ARRAY[string] | Status values that need to be considered for query + +### Return type + +ARRAY[Pet] + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **find_pets_by_tags** + +Finds Pets by tags + +Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $tags = ; # [ARRAY[string]] Tags to filter by + +eval { + my $result = $api->find_pets_by_tags(tags => $tags); +}; +if ($@) { + warn "Exception when calling find_pets_by_tags: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | tags | ARRAY[string] | Tags to filter by + +### Return type + +ARRAY[Pet] + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **get_pet_by_id** + +Find pet by ID + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $pet_id = 789; # [int] ID of pet that needs to be fetched + +eval { + my $result = $api->get_pet_by_id(pet_id => $pet_id); +}; +if ($@) { + warn "Exception when calling get_pet_by_id: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | ID of pet that needs to be fetched + +### Return type + +Pet + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key petstore_auth + + +## **update_pet_with_form** + +Updates a pet in the store with form data + + + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $pet_id = 'pet_id_example'; # [string] ID of pet that needs to be updated +my $name = 'name_example'; # [string] Updated name of the pet +my $status = 'status_example'; # [string] Updated status of the pet + +eval { + my $result = $api->update_pet_with_form(pet_id => $pet_id, name => $name, status => $status); +}; +if ($@) { + warn "Exception when calling update_pet_with_form: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | string | ID of pet that needs to be updated + No | name | string | Updated name of the pet + No | status | string | Updated status of the pet + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: application/x-www-form-urlencoded +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **delete_pet** + +Deletes a pet + + + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $pet_id = 789; # [int] Pet id to delete +my $api_key = 'api_key_example'; # [string] + +eval { + my $result = $api->delete_pet(pet_id => $pet_id, api_key => $api_key); +}; +if ($@) { + warn "Exception when calling delete_pet: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | Pet id to delete + No | api_key | string | + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **upload_file** + +uploads an image + + + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $pet_id = 789; # [int] ID of pet to update +my $additional_metadata = 'additional_metadata_example'; # [string] Additional data to pass to server +my $file = '/path/to/file.txt'; # [File] file to upload + +eval { + my $result = $api->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file); +}; +if ($@) { + warn "Exception when calling upload_file: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | ID of pet to update + No | additional_metadata | string | Additional data to pass to server + No | file | File | file to upload + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: multipart/form-data +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **get_pet_by_id_in_object** + +Fake endpoint to test inline arbitrary object return by 'Find pet by ID' + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $pet_id = 789; # [int] ID of pet that needs to be fetched + +eval { + my $result = $api->get_pet_by_id_in_object(pet_id => $pet_id); +}; +if ($@) { + warn "Exception when calling get_pet_by_id_in_object: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | ID of pet that needs to be fetched + +### Return type + +InlineResponse200 + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key petstore_auth + + +## **pet_pet_idtesting_byte_arraytrue_get** + +Fake endpoint to test byte array return by 'Find pet by ID' + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $pet_id = 789; # [int] ID of pet that needs to be fetched + +eval { + my $result = $api->pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id); +}; +if ($@) { + warn "Exception when calling pet_pet_idtesting_byte_arraytrue_get: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | ID of pet that needs to be fetched + +### Return type + +string + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key petstore_auth + + +## **add_pet_using_byte_array** + +Fake endpoint to test byte array in body parameter for adding a new pet to the store + + + +### Sample +```perl +my $api = Something::Deep::PetApi->new(); +my $body = new Something::Deep::Object::string->new(); # [string] Pet object in the form of byte array + +eval { + my $result = $api->add_pet_using_byte_array(body => $body); +}; +if ($@) { + warn "Exception when calling add_pet_using_byte_array: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | string | Pet object in the form of byte array + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: application/json, application/xml +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +1; diff --git a/samples/client/petstore/perl/deep_module_testdocs/SpecialModelName.md b/samples/client/petstore/perl/deep_module_testdocs/SpecialModelName.md new file mode 100644 index 00000000000..03e33db3420 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/SpecialModelName.md @@ -0,0 +1,13 @@ +# Something::Deep::Object::SpecialModelName + +## Import the module +```perl +use Something::Deep::Object::SpecialModelName; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**__special[property/name]** | **int** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/deep_module_testdocs/StoreApi.md b/samples/client/petstore/perl/deep_module_testdocs/StoreApi.md new file mode 100644 index 00000000000..d79ad6f5b28 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/StoreApi.md @@ -0,0 +1,234 @@ +# Something::Deep::StoreApi + +- [find_orders_by_status](#find_orders_by_status): Finds orders by status +- [get_inventory](#get_inventory): Returns pet inventories by status +- [get_inventory_in_object](#get_inventory_in_object): Fake endpoint to test arbitrary object return by 'Get inventory' +- [place_order](#place_order): Place an order for a pet +- [get_order_by_id](#get_order_by_id): Find purchase order by ID +- [delete_order](#delete_order): Delete purchase order by ID + +## **find_orders_by_status** + +Finds orders by status + +A single status value can be provided as a string + +### Sample +```perl +my $api = Something::Deep::StoreApi->new(); +my $status = 'status_example'; # [string] Status value that needs to be considered for query + +eval { + my $result = $api->find_orders_by_status(status => $status); +}; +if ($@) { + warn "Exception when calling find_orders_by_status: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | status | string | Status value that needs to be considered for query + +### Return type + +ARRAY[Order] + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +test_api_client_id test_api_client_secret + + +## **get_inventory** + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Sample +```perl +my $api = Something::Deep::StoreApi->new(); + +eval { + my $result = $api->get_inventory(); +}; +if ($@) { + warn "Exception when calling get_inventory: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + +### Return type + +HASH[string,int] + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key + + +## **get_inventory_in_object** + +Fake endpoint to test arbitrary object return by 'Get inventory' + +Returns an arbitrary object which is actually a map of status codes to quantities + +### Sample +```perl +my $api = Something::Deep::StoreApi->new(); + +eval { + my $result = $api->get_inventory_in_object(); +}; +if ($@) { + warn "Exception when calling get_inventory_in_object: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + +### Return type + +object + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key + + +## **place_order** + +Place an order for a pet + + + +### Sample +```perl +my $api = Something::Deep::StoreApi->new(); +my $body = new Something::Deep::Object::Order->new(); # [Order] order placed for purchasing the pet + +eval { + my $result = $api->place_order(body => $body); +}; +if ($@) { + warn "Exception when calling place_order: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | Order | order placed for purchasing the pet + +### Return type + +Order + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +test_api_client_id test_api_client_secret + + +## **get_order_by_id** + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Sample +```perl +my $api = Something::Deep::StoreApi->new(); +my $order_id = 'order_id_example'; # [string] ID of pet that needs to be fetched + +eval { + my $result = $api->get_order_by_id(order_id => $order_id); +}; +if ($@) { + warn "Exception when calling get_order_by_id: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | order_id | string | ID of pet that needs to be fetched + +### Return type + +Order + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +test_api_key_header test_api_key_query + + +## **delete_order** + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Sample +```perl +my $api = Something::Deep::StoreApi->new(); +my $order_id = 'order_id_example'; # [string] ID of the order that needs to be deleted + +eval { + my $result = $api->delete_order(order_id => $order_id); +}; +if ($@) { + warn "Exception when calling delete_order: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | order_id | string | ID of the order that needs to be deleted + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +1; diff --git a/samples/client/petstore/perl/deep_module_testdocs/Tag.md b/samples/client/petstore/perl/deep_module_testdocs/Tag.md new file mode 100644 index 00000000000..7c140141216 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/Tag.md @@ -0,0 +1,14 @@ +# Something::Deep::Object::Tag + +## Import the module +```perl +use Something::Deep::Object::Tag; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**name** | **string** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/deep_module_testdocs/User.md b/samples/client/petstore/perl/deep_module_testdocs/User.md new file mode 100644 index 00000000000..6b4eba222f4 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/User.md @@ -0,0 +1,20 @@ +# Something::Deep::Object::User + +## Import the module +```perl +use Something::Deep::Object::User; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**username** | **string** | | [optional][default to null] +**first_name** | **string** | | [optional][default to null] +**last_name** | **string** | | [optional][default to null] +**email** | **string** | | [optional][default to null] +**password** | **string** | | [optional][default to null] +**phone** | **string** | | [optional][default to null] +**user_status** | **int** | User Status | [optional][default to null] + + diff --git a/samples/client/petstore/perl/deep_module_testdocs/UserApi.md b/samples/client/petstore/perl/deep_module_testdocs/UserApi.md new file mode 100644 index 00000000000..a2ff0756586 --- /dev/null +++ b/samples/client/petstore/perl/deep_module_testdocs/UserApi.md @@ -0,0 +1,318 @@ +# Something::Deep::UserApi + +- [create_user](#create_user): Create user +- [create_users_with_array_input](#create_users_with_array_input): Creates list of users with given input array +- [create_users_with_list_input](#create_users_with_list_input): Creates list of users with given input array +- [login_user](#login_user): Logs user into the system +- [logout_user](#logout_user): Logs out current logged in user session +- [get_user_by_name](#get_user_by_name): Get user by user name +- [update_user](#update_user): Updated user +- [delete_user](#delete_user): Delete user + +## **create_user** + +Create user + +This can only be done by the logged in user. + +### Sample +```perl +my $api = Something::Deep::UserApi->new(); +my $body = new Something::Deep::Object::User->new(); # [User] Created user object + +eval { + my $result = $api->create_user(body => $body); +}; +if ($@) { + warn "Exception when calling create_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | User | Created user object + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **create_users_with_array_input** + +Creates list of users with given input array + + + +### Sample +```perl +my $api = Something::Deep::UserApi->new(); +my $body = new Something::Deep::Object::ARRAY[User]->new(); # [ARRAY[User]] List of user object + +eval { + my $result = $api->create_users_with_array_input(body => $body); +}; +if ($@) { + warn "Exception when calling create_users_with_array_input: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | ARRAY[User] | List of user object + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **create_users_with_list_input** + +Creates list of users with given input array + + + +### Sample +```perl +my $api = Something::Deep::UserApi->new(); +my $body = new Something::Deep::Object::ARRAY[User]->new(); # [ARRAY[User]] List of user object + +eval { + my $result = $api->create_users_with_list_input(body => $body); +}; +if ($@) { + warn "Exception when calling create_users_with_list_input: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | ARRAY[User] | List of user object + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **login_user** + +Logs user into the system + + + +### Sample +```perl +my $api = Something::Deep::UserApi->new(); +my $username = 'username_example'; # [string] The user name for login +my $password = 'password_example'; # [string] The password for login in clear text + +eval { + my $result = $api->login_user(username => $username, password => $password); +}; +if ($@) { + warn "Exception when calling login_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | username | string | The user name for login + No | password | string | The password for login in clear text + +### Return type + +string + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **logout_user** + +Logs out current logged in user session + + + +### Sample +```perl +my $api = Something::Deep::UserApi->new(); + +eval { + my $result = $api->logout_user(); +}; +if ($@) { + warn "Exception when calling logout_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **get_user_by_name** + +Get user by user name + + + +### Sample +```perl +my $api = Something::Deep::UserApi->new(); +my $username = 'username_example'; # [string] The name that needs to be fetched. Use user1 for testing. + +eval { + my $result = $api->get_user_by_name(username => $username); +}; +if ($@) { + warn "Exception when calling get_user_by_name: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | username | string | The name that needs to be fetched. Use user1 for testing. + +### Return type + +User + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **update_user** + +Updated user + +This can only be done by the logged in user. + +### Sample +```perl +my $api = Something::Deep::UserApi->new(); +my $username = 'username_example'; # [string] name that need to be deleted +my $body = new Something::Deep::Object::User->new(); # [User] Updated user object + +eval { + my $result = $api->update_user(username => $username, body => $body); +}; +if ($@) { + warn "Exception when calling update_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | username | string | name that need to be deleted + No | body | User | Updated user object + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **delete_user** + +Delete user + +This can only be done by the logged in user. + +### Sample +```perl +my $api = Something::Deep::UserApi->new(); +my $username = 'username_example'; # [string] The name that needs to be deleted + +eval { + my $result = $api->delete_user(username => $username); +}; +if ($@) { + warn "Exception when calling delete_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | username | string | The name that needs to be deleted + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +1; diff --git a/samples/client/petstore/perl/docs/Category.md b/samples/client/petstore/perl/docs/Category.md new file mode 100644 index 00000000000..78db6e0a75a --- /dev/null +++ b/samples/client/petstore/perl/docs/Category.md @@ -0,0 +1,14 @@ +# WWW::SwaggerClient::Object::Category + +## Import the module +```perl +use WWW::SwaggerClient::Object::Category; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**name** | **string** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/docs/InlineResponse200.md b/samples/client/petstore/perl/docs/InlineResponse200.md new file mode 100644 index 00000000000..bc8c03d1ccd --- /dev/null +++ b/samples/client/petstore/perl/docs/InlineResponse200.md @@ -0,0 +1,18 @@ +# WWW::SwaggerClient::Object::InlineResponse200 + +## Import the module +```perl +use WWW::SwaggerClient::Object::InlineResponse200; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | [**ARRAY[Tag]**](docs/Tag.md) | | [optional][default to null] +**id** | **int** | | [default to null] +**category** | **object** | | [optional][default to null] +**status** | **string** | pet status in the store | [optional][default to null] +**name** | **string** | | [optional][default to null] +**photo_urls** | **ARRAY[string]** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/docs/ObjectReturn.md b/samples/client/petstore/perl/docs/ObjectReturn.md new file mode 100644 index 00000000000..b240f82e740 --- /dev/null +++ b/samples/client/petstore/perl/docs/ObjectReturn.md @@ -0,0 +1,13 @@ +# WWW::SwaggerClient::Object::ObjectReturn + +## Import the module +```perl +use WWW::SwaggerClient::Object::ObjectReturn; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return** | **int** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/docs/Order.md b/samples/client/petstore/perl/docs/Order.md new file mode 100644 index 00000000000..a9b8d380c85 --- /dev/null +++ b/samples/client/petstore/perl/docs/Order.md @@ -0,0 +1,18 @@ +# WWW::SwaggerClient::Object::Order + +## Import the module +```perl +use WWW::SwaggerClient::Object::Order; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**pet_id** | **int** | | [optional][default to null] +**quantity** | **int** | | [optional][default to null] +**ship_date** | **DateTime** | | [optional][default to null] +**status** | **string** | Order Status | [optional][default to null] +**complete** | **boolean** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/docs/Pet.md b/samples/client/petstore/perl/docs/Pet.md new file mode 100644 index 00000000000..53c75040b4d --- /dev/null +++ b/samples/client/petstore/perl/docs/Pet.md @@ -0,0 +1,18 @@ +# WWW::SwaggerClient::Object::Pet + +## Import the module +```perl +use WWW::SwaggerClient::Object::Pet; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**category** | [**Category**](docs/Category.md) | | [optional][default to null] +**name** | **string** | | [default to null] +**photo_urls** | **ARRAY[string]** | | [default to null] +**tags** | [**ARRAY[Tag]**](docs/Tag.md) | | [optional][default to null] +**status** | **string** | pet status in the store | [optional][default to null] + + diff --git a/samples/client/petstore/perl/docs/PetApi.md b/samples/client/petstore/perl/docs/PetApi.md new file mode 100644 index 00000000000..0de7e161637 --- /dev/null +++ b/samples/client/petstore/perl/docs/PetApi.md @@ -0,0 +1,443 @@ +# WWW::SwaggerClient::PetApi + +- [update_pet](#update_pet): Update an existing pet +- [add_pet](#add_pet): Add a new pet to the store +- [find_pets_by_status](#find_pets_by_status): Finds Pets by status +- [find_pets_by_tags](#find_pets_by_tags): Finds Pets by tags +- [get_pet_by_id](#get_pet_by_id): Find pet by ID +- [update_pet_with_form](#update_pet_with_form): Updates a pet in the store with form data +- [delete_pet](#delete_pet): Deletes a pet +- [upload_file](#upload_file): uploads an image +- [get_pet_by_id_in_object](#get_pet_by_id_in_object): Fake endpoint to test inline arbitrary object return by 'Find pet by ID' +- [pet_pet_idtesting_byte_arraytrue_get](#pet_pet_idtesting_byte_arraytrue_get): Fake endpoint to test byte array return by 'Find pet by ID' +- [add_pet_using_byte_array](#add_pet_using_byte_array): Fake endpoint to test byte array in body parameter for adding a new pet to the store + +## **update_pet** + +Update an existing pet + + + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $body = new WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store + +eval { + my $result = $api->update_pet(body => $body); +}; +if ($@) { + warn "Exception when calling update_pet: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | Pet | Pet object that needs to be added to the store + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: application/json, application/xml +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **add_pet** + +Add a new pet to the store + + + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $body = new WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store + +eval { + my $result = $api->add_pet(body => $body); +}; +if ($@) { + warn "Exception when calling add_pet: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | Pet | Pet object that needs to be added to the store + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: application/json, application/xml +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **find_pets_by_status** + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $status = ; # [ARRAY[string]] Status values that need to be considered for query + +eval { + my $result = $api->find_pets_by_status(status => $status); +}; +if ($@) { + warn "Exception when calling find_pets_by_status: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | status | ARRAY[string] | Status values that need to be considered for query + +### Return type + +ARRAY[Pet] + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **find_pets_by_tags** + +Finds Pets by tags + +Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $tags = ; # [ARRAY[string]] Tags to filter by + +eval { + my $result = $api->find_pets_by_tags(tags => $tags); +}; +if ($@) { + warn "Exception when calling find_pets_by_tags: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | tags | ARRAY[string] | Tags to filter by + +### Return type + +ARRAY[Pet] + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **get_pet_by_id** + +Find pet by ID + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $pet_id = 789; # [int] ID of pet that needs to be fetched + +eval { + my $result = $api->get_pet_by_id(pet_id => $pet_id); +}; +if ($@) { + warn "Exception when calling get_pet_by_id: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | ID of pet that needs to be fetched + +### Return type + +Pet + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key petstore_auth + + +## **update_pet_with_form** + +Updates a pet in the store with form data + + + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $pet_id = 'pet_id_example'; # [string] ID of pet that needs to be updated +my $name = 'name_example'; # [string] Updated name of the pet +my $status = 'status_example'; # [string] Updated status of the pet + +eval { + my $result = $api->update_pet_with_form(pet_id => $pet_id, name => $name, status => $status); +}; +if ($@) { + warn "Exception when calling update_pet_with_form: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | string | ID of pet that needs to be updated + No | name | string | Updated name of the pet + No | status | string | Updated status of the pet + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: application/x-www-form-urlencoded +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **delete_pet** + +Deletes a pet + + + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $pet_id = 789; # [int] Pet id to delete +my $api_key = 'api_key_example'; # [string] + +eval { + my $result = $api->delete_pet(pet_id => $pet_id, api_key => $api_key); +}; +if ($@) { + warn "Exception when calling delete_pet: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | Pet id to delete + No | api_key | string | + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **upload_file** + +uploads an image + + + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $pet_id = 789; # [int] ID of pet to update +my $additional_metadata = 'additional_metadata_example'; # [string] Additional data to pass to server +my $file = '/path/to/file.txt'; # [File] file to upload + +eval { + my $result = $api->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file); +}; +if ($@) { + warn "Exception when calling upload_file: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | ID of pet to update + No | additional_metadata | string | Additional data to pass to server + No | file | File | file to upload + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: multipart/form-data +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +## **get_pet_by_id_in_object** + +Fake endpoint to test inline arbitrary object return by 'Find pet by ID' + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $pet_id = 789; # [int] ID of pet that needs to be fetched + +eval { + my $result = $api->get_pet_by_id_in_object(pet_id => $pet_id); +}; +if ($@) { + warn "Exception when calling get_pet_by_id_in_object: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | ID of pet that needs to be fetched + +### Return type + +InlineResponse200 + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key petstore_auth + + +## **pet_pet_idtesting_byte_arraytrue_get** + +Fake endpoint to test byte array return by 'Find pet by ID' + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $pet_id = 789; # [int] ID of pet that needs to be fetched + +eval { + my $result = $api->pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id); +}; +if ($@) { + warn "Exception when calling pet_pet_idtesting_byte_arraytrue_get: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | pet_id | int | ID of pet that needs to be fetched + +### Return type + +string + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key petstore_auth + + +## **add_pet_using_byte_array** + +Fake endpoint to test byte array in body parameter for adding a new pet to the store + + + +### Sample +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $body = new WWW::SwaggerClient::Object::string->new(); # [string] Pet object in the form of byte array + +eval { + my $result = $api->add_pet_using_byte_array(body => $body); +}; +if ($@) { + warn "Exception when calling add_pet_using_byte_array: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | string | Pet object in the form of byte array + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: application/json, application/xml +Accept: application/json, application/xml + +### Authentication scheme + +petstore_auth + + +1; diff --git a/samples/client/petstore/perl/docs/SpecialModelName.md b/samples/client/petstore/perl/docs/SpecialModelName.md new file mode 100644 index 00000000000..94b0986dc70 --- /dev/null +++ b/samples/client/petstore/perl/docs/SpecialModelName.md @@ -0,0 +1,13 @@ +# WWW::SwaggerClient::Object::SpecialModelName + +## Import the module +```perl +use WWW::SwaggerClient::Object::SpecialModelName; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**__special[property/name]** | **int** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md new file mode 100644 index 00000000000..4cc9d1ca737 --- /dev/null +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -0,0 +1,234 @@ +# WWW::SwaggerClient::StoreApi + +- [find_orders_by_status](#find_orders_by_status): Finds orders by status +- [get_inventory](#get_inventory): Returns pet inventories by status +- [get_inventory_in_object](#get_inventory_in_object): Fake endpoint to test arbitrary object return by 'Get inventory' +- [place_order](#place_order): Place an order for a pet +- [get_order_by_id](#get_order_by_id): Find purchase order by ID +- [delete_order](#delete_order): Delete purchase order by ID + +## **find_orders_by_status** + +Finds orders by status + +A single status value can be provided as a string + +### Sample +```perl +my $api = WWW::SwaggerClient::StoreApi->new(); +my $status = 'status_example'; # [string] Status value that needs to be considered for query + +eval { + my $result = $api->find_orders_by_status(status => $status); +}; +if ($@) { + warn "Exception when calling find_orders_by_status: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | status | string | Status value that needs to be considered for query + +### Return type + +ARRAY[Order] + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +test_api_client_id test_api_client_secret + + +## **get_inventory** + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Sample +```perl +my $api = WWW::SwaggerClient::StoreApi->new(); + +eval { + my $result = $api->get_inventory(); +}; +if ($@) { + warn "Exception when calling get_inventory: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + +### Return type + +HASH[string,int] + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key + + +## **get_inventory_in_object** + +Fake endpoint to test arbitrary object return by 'Get inventory' + +Returns an arbitrary object which is actually a map of status codes to quantities + +### Sample +```perl +my $api = WWW::SwaggerClient::StoreApi->new(); + +eval { + my $result = $api->get_inventory_in_object(); +}; +if ($@) { + warn "Exception when calling get_inventory_in_object: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + +### Return type + +object + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +api_key + + +## **place_order** + +Place an order for a pet + + + +### Sample +```perl +my $api = WWW::SwaggerClient::StoreApi->new(); +my $body = new WWW::SwaggerClient::Object::Order->new(); # [Order] order placed for purchasing the pet + +eval { + my $result = $api->place_order(body => $body); +}; +if ($@) { + warn "Exception when calling place_order: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | Order | order placed for purchasing the pet + +### Return type + +Order + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +test_api_client_id test_api_client_secret + + +## **get_order_by_id** + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Sample +```perl +my $api = WWW::SwaggerClient::StoreApi->new(); +my $order_id = 'order_id_example'; # [string] ID of pet that needs to be fetched + +eval { + my $result = $api->get_order_by_id(order_id => $order_id); +}; +if ($@) { + warn "Exception when calling get_order_by_id: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | order_id | string | ID of pet that needs to be fetched + +### Return type + +Order + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + +test_api_key_header test_api_key_query + + +## **delete_order** + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Sample +```perl +my $api = WWW::SwaggerClient::StoreApi->new(); +my $order_id = 'order_id_example'; # [string] ID of the order that needs to be deleted + +eval { + my $result = $api->delete_order(order_id => $order_id); +}; +if ($@) { + warn "Exception when calling delete_order: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | order_id | string | ID of the order that needs to be deleted + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +1; diff --git a/samples/client/petstore/perl/docs/Tag.md b/samples/client/petstore/perl/docs/Tag.md new file mode 100644 index 00000000000..c995d0cebf3 --- /dev/null +++ b/samples/client/petstore/perl/docs/Tag.md @@ -0,0 +1,14 @@ +# WWW::SwaggerClient::Object::Tag + +## Import the module +```perl +use WWW::SwaggerClient::Object::Tag; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**name** | **string** | | [optional][default to null] + + diff --git a/samples/client/petstore/perl/docs/User.md b/samples/client/petstore/perl/docs/User.md new file mode 100644 index 00000000000..52c8d2b84ca --- /dev/null +++ b/samples/client/petstore/perl/docs/User.md @@ -0,0 +1,20 @@ +# WWW::SwaggerClient::Object::User + +## Import the module +```perl +use WWW::SwaggerClient::Object::User; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional][default to null] +**username** | **string** | | [optional][default to null] +**first_name** | **string** | | [optional][default to null] +**last_name** | **string** | | [optional][default to null] +**email** | **string** | | [optional][default to null] +**password** | **string** | | [optional][default to null] +**phone** | **string** | | [optional][default to null] +**user_status** | **int** | User Status | [optional][default to null] + + diff --git a/samples/client/petstore/perl/docs/UserApi.md b/samples/client/petstore/perl/docs/UserApi.md new file mode 100644 index 00000000000..319359ff6bf --- /dev/null +++ b/samples/client/petstore/perl/docs/UserApi.md @@ -0,0 +1,318 @@ +# WWW::SwaggerClient::UserApi + +- [create_user](#create_user): Create user +- [create_users_with_array_input](#create_users_with_array_input): Creates list of users with given input array +- [create_users_with_list_input](#create_users_with_list_input): Creates list of users with given input array +- [login_user](#login_user): Logs user into the system +- [logout_user](#logout_user): Logs out current logged in user session +- [get_user_by_name](#get_user_by_name): Get user by user name +- [update_user](#update_user): Updated user +- [delete_user](#delete_user): Delete user + +## **create_user** + +Create user + +This can only be done by the logged in user. + +### Sample +```perl +my $api = WWW::SwaggerClient::UserApi->new(); +my $body = new WWW::SwaggerClient::Object::User->new(); # [User] Created user object + +eval { + my $result = $api->create_user(body => $body); +}; +if ($@) { + warn "Exception when calling create_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | User | Created user object + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **create_users_with_array_input** + +Creates list of users with given input array + + + +### Sample +```perl +my $api = WWW::SwaggerClient::UserApi->new(); +my $body = new WWW::SwaggerClient::Object::ARRAY[User]->new(); # [ARRAY[User]] List of user object + +eval { + my $result = $api->create_users_with_array_input(body => $body); +}; +if ($@) { + warn "Exception when calling create_users_with_array_input: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | ARRAY[User] | List of user object + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **create_users_with_list_input** + +Creates list of users with given input array + + + +### Sample +```perl +my $api = WWW::SwaggerClient::UserApi->new(); +my $body = new WWW::SwaggerClient::Object::ARRAY[User]->new(); # [ARRAY[User]] List of user object + +eval { + my $result = $api->create_users_with_list_input(body => $body); +}; +if ($@) { + warn "Exception when calling create_users_with_list_input: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | body | ARRAY[User] | List of user object + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **login_user** + +Logs user into the system + + + +### Sample +```perl +my $api = WWW::SwaggerClient::UserApi->new(); +my $username = 'username_example'; # [string] The user name for login +my $password = 'password_example'; # [string] The password for login in clear text + +eval { + my $result = $api->login_user(username => $username, password => $password); +}; +if ($@) { + warn "Exception when calling login_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + No | username | string | The user name for login + No | password | string | The password for login in clear text + +### Return type + +string + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **logout_user** + +Logs out current logged in user session + + + +### Sample +```perl +my $api = WWW::SwaggerClient::UserApi->new(); + +eval { + my $result = $api->logout_user(); +}; +if ($@) { + warn "Exception when calling logout_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **get_user_by_name** + +Get user by user name + + + +### Sample +```perl +my $api = WWW::SwaggerClient::UserApi->new(); +my $username = 'username_example'; # [string] The name that needs to be fetched. Use user1 for testing. + +eval { + my $result = $api->get_user_by_name(username => $username); +}; +if ($@) { + warn "Exception when calling get_user_by_name: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | username | string | The name that needs to be fetched. Use user1 for testing. + +### Return type + +User + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **update_user** + +Updated user + +This can only be done by the logged in user. + +### Sample +```perl +my $api = WWW::SwaggerClient::UserApi->new(); +my $username = 'username_example'; # [string] name that need to be deleted +my $body = new WWW::SwaggerClient::Object::User->new(); # [User] Updated user object + +eval { + my $result = $api->update_user(username => $username, body => $body); +}; +if ($@) { + warn "Exception when calling update_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | username | string | name that need to be deleted + No | body | User | Updated user object + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +## **delete_user** + +Delete user + +This can only be done by the logged in user. + +### Sample +```perl +my $api = WWW::SwaggerClient::UserApi->new(); +my $username = 'username_example'; # [string] The name that needs to be deleted + +eval { + my $result = $api->delete_user(username => $username); +}; +if ($@) { + warn "Exception when calling delete_user: $@\n"; +} +``` + +### Parameters +Required | Name | Type | Description +------------ | ------------- | ------------- | ------------- + Yes | username | string | The name that needs to be deleted + +### Return type + +void (empty response body) + +### HTTP headers + +Content-Type: Not defined +Accept: application/json, application/xml + +### Authentication scheme + + + + +1; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm index 98f45f53af0..3457ca16897 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm @@ -37,7 +37,7 @@ has version_info => ( is => 'ro', default => sub { { app_name => 'Swagger Petstore', app_version => '1.0.0', - generated_date => '2016-03-05T22:31:46.328+08:00', + generated_date => '2016-03-06T12:43:31.929+08:00', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', } }, documentation => 'Information about the application version and the codegen codebase version' @@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project: =over 4 -=item Build date: 2016-03-05T22:31:46.328+08:00 +=item Build date: 2016-03-06T12:43:31.929+08:00 =item Build package: class io.swagger.codegen.languages.PerlClientCodegen From 1b652dab5e77c8fec23e45cca809da6db3978d41 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 6 Mar 2016 14:28:52 +0800 Subject: [PATCH 4/7] fix MD in perl doc --- .../codegen/languages/PerlClientCodegen.java | 2 +- .../src/main/resources/perl/README.mustache | 4 +- .../src/main/resources/perl/api.mustache | 8 +- samples/client/petstore/perl/README.md | 54 +-- .../perl/deep_module_testdocs/Category.md | 14 - .../deep_module_testdocs/InlineResponse200.md | 18 - .../perl/deep_module_testdocs/ObjectReturn.md | 13 - .../perl/deep_module_testdocs/Order.md | 18 - .../petstore/perl/deep_module_testdocs/Pet.md | 18 - .../perl/deep_module_testdocs/PetApi.md | 443 ------------------ .../deep_module_testdocs/SpecialModelName.md | 13 - .../perl/deep_module_testdocs/StoreApi.md | 234 --------- .../petstore/perl/deep_module_testdocs/Tag.md | 14 - .../perl/deep_module_testdocs/User.md | 20 - .../perl/deep_module_testdocs/UserApi.md | 318 ------------- samples/client/petstore/perl/docs/Category.md | 4 +- .../petstore/perl/docs/InlineResponse200.md | 12 +- .../client/petstore/perl/docs/ObjectReturn.md | 2 +- samples/client/petstore/perl/docs/Order.md | 12 +- samples/client/petstore/perl/docs/Pet.md | 12 +- samples/client/petstore/perl/docs/PetApi.md | 258 +++++----- .../petstore/perl/docs/SpecialModelName.md | 2 +- samples/client/petstore/perl/docs/StoreApi.md | 132 ++++-- samples/client/petstore/perl/docs/Tag.md | 4 +- samples/client/petstore/perl/docs/User.md | 16 +- samples/client/petstore/perl/docs/UserApi.md | 164 ++++--- .../perl/lib/WWW/SwaggerClient/Role.pm | 4 +- 27 files changed, 401 insertions(+), 1412 deletions(-) delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/Category.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/InlineResponse200.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/ObjectReturn.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/Order.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/Pet.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/PetApi.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/SpecialModelName.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/StoreApi.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/Tag.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/User.md delete mode 100644 samples/client/petstore/perl/deep_module_testdocs/UserApi.md diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java index f53d7c1a1e1..b05512f4426 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java @@ -257,7 +257,7 @@ public String toDefaultValue(Property p) { } } - return "null"; + return null; } diff --git a/modules/swagger-codegen/src/main/resources/perl/README.mustache b/modules/swagger-codegen/src/main/resources/perl/README.mustache index cf59be85a57..d3214289e63 100644 --- a/modules/swagger-codegen/src/main/resources/perl/README.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/README.mustache @@ -220,11 +220,11 @@ Each of these calls returns a hashref with various useful pieces of information. # DOCUMENTATION FOR API ENDPOINTS -All URIs are relative to {{basePath}} +All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{classname}} | [{{nickname}}]({{apiDocPath}}{{classname}}.md#{{nickname}}) | {{httpMethod}} {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{nickname}}**]({{apiDocPath}}{{classname}}.md#{{nickname}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} # DOCUMENTATION FOR MODELS diff --git a/modules/swagger-codegen/src/main/resources/perl/api.mustache b/modules/swagger-codegen/src/main/resources/perl/api.mustache index dcebb0bb518..9b0920c30c9 100644 --- a/modules/swagger-codegen/src/main/resources/perl/api.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/api.mustache @@ -54,7 +54,7 @@ sub new { {{#operation}} # -# {{{nickname}}} +# {{{operationId}}} # # {{{summary}}} # @@ -70,7 +70,7 @@ sub new { }, {{/allParams}} }; - __PACKAGE__->method_documentation->{ {{nickname}} } = { + __PACKAGE__->method_documentation->{ {{operationId}} } = { summary => '{{summary}}', params => $params, returns => {{#returnType}}'{{{returnType}}}'{{/returnType}}{{^returnType}}undef{{/returnType}}, @@ -78,13 +78,13 @@ sub new { } # @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} # -sub {{nickname}} { +sub {{operationId}} { my ($self, %args) = @_; {{#allParams}}{{#required}} # verify the required parameter '{{paramName}}' is set unless (exists $args{'{{paramName}}'}) { - croak("Missing the required parameter '{{paramName}}' when calling {{nickname}}"); + croak("Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } {{/required}}{{/allParams}} diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 3044f17d76c..07d25457a2d 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore Automatically generated by the Perl Swagger Codegen project: -- Build date: 2016-03-06T12:43:31.929+08:00 +- Build date: 2016-03-06T14:25:02.405+08:00 - Build package: class io.swagger.codegen.languages.PerlClientCodegen - Codegen version: @@ -220,35 +220,35 @@ Each of these calls returns a hashref with various useful pieces of information. # DOCUMENTATION FOR API ENDPOINTS -All URIs are relative to http://petstore.swagger.io/v2 +All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -UserApi | [create_user](docs/UserApi.md#create_user) | POST /user | Create user -UserApi | [create_users_with_array_input](docs/UserApi.md#create_users_with_array_input) | POST /user/createWithArray | Creates list of users with given input array -UserApi | [create_users_with_list_input](docs/UserApi.md#create_users_with_list_input) | POST /user/createWithList | Creates list of users with given input array -UserApi | [login_user](docs/UserApi.md#login_user) | GET /user/login | Logs user into the system -UserApi | [logout_user](docs/UserApi.md#logout_user) | GET /user/logout | Logs out current logged in user session -UserApi | [get_user_by_name](docs/UserApi.md#get_user_by_name) | GET /user/{username} | Get user by user name -UserApi | [update_user](docs/UserApi.md#update_user) | PUT /user/{username} | Updated user -UserApi | [delete_user](docs/UserApi.md#delete_user) | DELETE /user/{username} | Delete user -PetApi | [update_pet](docs/PetApi.md#update_pet) | PUT /pet | Update an existing pet -PetApi | [add_pet](docs/PetApi.md#add_pet) | POST /pet | Add a new pet to the store -PetApi | [find_pets_by_status](docs/PetApi.md#find_pets_by_status) | GET /pet/findByStatus | Finds Pets by status -PetApi | [find_pets_by_tags](docs/PetApi.md#find_pets_by_tags) | GET /pet/findByTags | Finds Pets by tags -PetApi | [get_pet_by_id](docs/PetApi.md#get_pet_by_id) | GET /pet/{petId} | Find pet by ID -PetApi | [update_pet_with_form](docs/PetApi.md#update_pet_with_form) | POST /pet/{petId} | Updates a pet in the store with form data -PetApi | [delete_pet](docs/PetApi.md#delete_pet) | DELETE /pet/{petId} | Deletes a pet -PetApi | [upload_file](docs/PetApi.md#upload_file) | POST /pet/{petId}/uploadImage | uploads an image -PetApi | [get_pet_by_id_in_object](docs/PetApi.md#get_pet_by_id_in_object) | GET /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -PetApi | [pet_pet_idtesting_byte_arraytrue_get](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | GET /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' -PetApi | [add_pet_using_byte_array](docs/PetApi.md#add_pet_using_byte_array) | POST /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store -StoreApi | [find_orders_by_status](docs/StoreApi.md#find_orders_by_status) | GET /store/findByStatus | Finds orders by status -StoreApi | [get_inventory](docs/StoreApi.md#get_inventory) | GET /store/inventory | Returns pet inventories by status -StoreApi | [get_inventory_in_object](docs/StoreApi.md#get_inventory_in_object) | GET /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' -StoreApi | [place_order](docs/StoreApi.md#place_order) | POST /store/order | Place an order for a pet -StoreApi | [get_order_by_id](docs/StoreApi.md#get_order_by_id) | GET /store/order/{orderId} | Find purchase order by ID -StoreApi | [delete_order](docs/StoreApi.md#delete_order) | DELETE /store/order/{orderId} | Delete purchase order by ID +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**get_pet_by_id_in_object**](docs/PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' +*PetApi* | [**pet_pet_idtesting_byte_arraytrue_get**](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' +*PetApi* | [**add_pet_using_byte_array**](docs/PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store +*StoreApi* | [**find_orders_by_status**](docs/StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_inventory_in_object**](docs/StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID # DOCUMENTATION FOR MODELS diff --git a/samples/client/petstore/perl/deep_module_testdocs/Category.md b/samples/client/petstore/perl/deep_module_testdocs/Category.md deleted file mode 100644 index b1e3583fb3f..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/Category.md +++ /dev/null @@ -1,14 +0,0 @@ -# Something::Deep::Object::Category - -## Import the module -```perl -use Something::Deep::Object::Category; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**name** | **string** | | [optional][default to null] - - diff --git a/samples/client/petstore/perl/deep_module_testdocs/InlineResponse200.md b/samples/client/petstore/perl/deep_module_testdocs/InlineResponse200.md deleted file mode 100644 index 15521e3d323..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/InlineResponse200.md +++ /dev/null @@ -1,18 +0,0 @@ -# Something::Deep::Object::InlineResponse200 - -## Import the module -```perl -use Something::Deep::Object::InlineResponse200; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tags** | [**ARRAY[Tag]**](docs/Tag.md) | | [optional][default to null] -**id** | **int** | | [default to null] -**category** | **object** | | [optional][default to null] -**status** | **string** | pet status in the store | [optional][default to null] -**name** | **string** | | [optional][default to null] -**photo_urls** | **ARRAY[string]** | | [optional][default to null] - - diff --git a/samples/client/petstore/perl/deep_module_testdocs/ObjectReturn.md b/samples/client/petstore/perl/deep_module_testdocs/ObjectReturn.md deleted file mode 100644 index e1195f4f899..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/ObjectReturn.md +++ /dev/null @@ -1,13 +0,0 @@ -# Something::Deep::Object::ObjectReturn - -## Import the module -```perl -use Something::Deep::Object::ObjectReturn; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**return** | **int** | | [optional][default to null] - - diff --git a/samples/client/petstore/perl/deep_module_testdocs/Order.md b/samples/client/petstore/perl/deep_module_testdocs/Order.md deleted file mode 100644 index 930360b85d1..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/Order.md +++ /dev/null @@ -1,18 +0,0 @@ -# Something::Deep::Object::Order - -## Import the module -```perl -use Something::Deep::Object::Order; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**pet_id** | **int** | | [optional][default to null] -**quantity** | **int** | | [optional][default to null] -**ship_date** | **DateTime** | | [optional][default to null] -**status** | **string** | Order Status | [optional][default to null] -**complete** | **boolean** | | [optional][default to null] - - diff --git a/samples/client/petstore/perl/deep_module_testdocs/Pet.md b/samples/client/petstore/perl/deep_module_testdocs/Pet.md deleted file mode 100644 index f0b71169504..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/Pet.md +++ /dev/null @@ -1,18 +0,0 @@ -# Something::Deep::Object::Pet - -## Import the module -```perl -use Something::Deep::Object::Pet; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**category** | [**Category**](docs/Category.md) | | [optional][default to null] -**name** | **string** | | [default to null] -**photo_urls** | **ARRAY[string]** | | [default to null] -**tags** | [**ARRAY[Tag]**](docs/Tag.md) | | [optional][default to null] -**status** | **string** | pet status in the store | [optional][default to null] - - diff --git a/samples/client/petstore/perl/deep_module_testdocs/PetApi.md b/samples/client/petstore/perl/deep_module_testdocs/PetApi.md deleted file mode 100644 index fe44d5a2910..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/PetApi.md +++ /dev/null @@ -1,443 +0,0 @@ -# Something::Deep::PetApi - -- [update_pet](#update_pet): Update an existing pet -- [add_pet](#add_pet): Add a new pet to the store -- [find_pets_by_status](#find_pets_by_status): Finds Pets by status -- [find_pets_by_tags](#find_pets_by_tags): Finds Pets by tags -- [get_pet_by_id](#get_pet_by_id): Find pet by ID -- [update_pet_with_form](#update_pet_with_form): Updates a pet in the store with form data -- [delete_pet](#delete_pet): Deletes a pet -- [upload_file](#upload_file): uploads an image -- [get_pet_by_id_in_object](#get_pet_by_id_in_object): Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -- [pet_pet_idtesting_byte_arraytrue_get](#pet_pet_idtesting_byte_arraytrue_get): Fake endpoint to test byte array return by 'Find pet by ID' -- [add_pet_using_byte_array](#add_pet_using_byte_array): Fake endpoint to test byte array in body parameter for adding a new pet to the store - -## **update_pet** - -Update an existing pet - - - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $body = new Something::Deep::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store - -eval { - my $result = $api->update_pet(body => $body); -}; -if ($@) { - warn "Exception when calling update_pet: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | Pet | Pet object that needs to be added to the store - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: application/json, application/xml -Accept: application/json, application/xml - -### Authentication scheme - -petstore_auth - - -## **add_pet** - -Add a new pet to the store - - - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $body = new Something::Deep::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store - -eval { - my $result = $api->add_pet(body => $body); -}; -if ($@) { - warn "Exception when calling add_pet: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | Pet | Pet object that needs to be added to the store - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: application/json, application/xml -Accept: application/json, application/xml - -### Authentication scheme - -petstore_auth - - -## **find_pets_by_status** - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $status = ; # [ARRAY[string]] Status values that need to be considered for query - -eval { - my $result = $api->find_pets_by_status(status => $status); -}; -if ($@) { - warn "Exception when calling find_pets_by_status: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | status | ARRAY[string] | Status values that need to be considered for query - -### Return type - -ARRAY[Pet] - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -petstore_auth - - -## **find_pets_by_tags** - -Finds Pets by tags - -Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $tags = ; # [ARRAY[string]] Tags to filter by - -eval { - my $result = $api->find_pets_by_tags(tags => $tags); -}; -if ($@) { - warn "Exception when calling find_pets_by_tags: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | tags | ARRAY[string] | Tags to filter by - -### Return type - -ARRAY[Pet] - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -petstore_auth - - -## **get_pet_by_id** - -Find pet by ID - -Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $pet_id = 789; # [int] ID of pet that needs to be fetched - -eval { - my $result = $api->get_pet_by_id(pet_id => $pet_id); -}; -if ($@) { - warn "Exception when calling get_pet_by_id: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | ID of pet that needs to be fetched - -### Return type - -Pet - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -api_key petstore_auth - - -## **update_pet_with_form** - -Updates a pet in the store with form data - - - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $pet_id = 'pet_id_example'; # [string] ID of pet that needs to be updated -my $name = 'name_example'; # [string] Updated name of the pet -my $status = 'status_example'; # [string] Updated status of the pet - -eval { - my $result = $api->update_pet_with_form(pet_id => $pet_id, name => $name, status => $status); -}; -if ($@) { - warn "Exception when calling update_pet_with_form: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | string | ID of pet that needs to be updated - No | name | string | Updated name of the pet - No | status | string | Updated status of the pet - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: application/x-www-form-urlencoded -Accept: application/json, application/xml - -### Authentication scheme - -petstore_auth - - -## **delete_pet** - -Deletes a pet - - - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $pet_id = 789; # [int] Pet id to delete -my $api_key = 'api_key_example'; # [string] - -eval { - my $result = $api->delete_pet(pet_id => $pet_id, api_key => $api_key); -}; -if ($@) { - warn "Exception when calling delete_pet: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | Pet id to delete - No | api_key | string | - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -petstore_auth - - -## **upload_file** - -uploads an image - - - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $pet_id = 789; # [int] ID of pet to update -my $additional_metadata = 'additional_metadata_example'; # [string] Additional data to pass to server -my $file = '/path/to/file.txt'; # [File] file to upload - -eval { - my $result = $api->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file); -}; -if ($@) { - warn "Exception when calling upload_file: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | ID of pet to update - No | additional_metadata | string | Additional data to pass to server - No | file | File | file to upload - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: multipart/form-data -Accept: application/json, application/xml - -### Authentication scheme - -petstore_auth - - -## **get_pet_by_id_in_object** - -Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - -Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $pet_id = 789; # [int] ID of pet that needs to be fetched - -eval { - my $result = $api->get_pet_by_id_in_object(pet_id => $pet_id); -}; -if ($@) { - warn "Exception when calling get_pet_by_id_in_object: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | ID of pet that needs to be fetched - -### Return type - -InlineResponse200 - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -api_key petstore_auth - - -## **pet_pet_idtesting_byte_arraytrue_get** - -Fake endpoint to test byte array return by 'Find pet by ID' - -Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $pet_id = 789; # [int] ID of pet that needs to be fetched - -eval { - my $result = $api->pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id); -}; -if ($@) { - warn "Exception when calling pet_pet_idtesting_byte_arraytrue_get: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | ID of pet that needs to be fetched - -### Return type - -string - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -api_key petstore_auth - - -## **add_pet_using_byte_array** - -Fake endpoint to test byte array in body parameter for adding a new pet to the store - - - -### Sample -```perl -my $api = Something::Deep::PetApi->new(); -my $body = new Something::Deep::Object::string->new(); # [string] Pet object in the form of byte array - -eval { - my $result = $api->add_pet_using_byte_array(body => $body); -}; -if ($@) { - warn "Exception when calling add_pet_using_byte_array: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | string | Pet object in the form of byte array - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: application/json, application/xml -Accept: application/json, application/xml - -### Authentication scheme - -petstore_auth - - -1; diff --git a/samples/client/petstore/perl/deep_module_testdocs/SpecialModelName.md b/samples/client/petstore/perl/deep_module_testdocs/SpecialModelName.md deleted file mode 100644 index 03e33db3420..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/SpecialModelName.md +++ /dev/null @@ -1,13 +0,0 @@ -# Something::Deep::Object::SpecialModelName - -## Import the module -```perl -use Something::Deep::Object::SpecialModelName; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**__special[property/name]** | **int** | | [optional][default to null] - - diff --git a/samples/client/petstore/perl/deep_module_testdocs/StoreApi.md b/samples/client/petstore/perl/deep_module_testdocs/StoreApi.md deleted file mode 100644 index d79ad6f5b28..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/StoreApi.md +++ /dev/null @@ -1,234 +0,0 @@ -# Something::Deep::StoreApi - -- [find_orders_by_status](#find_orders_by_status): Finds orders by status -- [get_inventory](#get_inventory): Returns pet inventories by status -- [get_inventory_in_object](#get_inventory_in_object): Fake endpoint to test arbitrary object return by 'Get inventory' -- [place_order](#place_order): Place an order for a pet -- [get_order_by_id](#get_order_by_id): Find purchase order by ID -- [delete_order](#delete_order): Delete purchase order by ID - -## **find_orders_by_status** - -Finds orders by status - -A single status value can be provided as a string - -### Sample -```perl -my $api = Something::Deep::StoreApi->new(); -my $status = 'status_example'; # [string] Status value that needs to be considered for query - -eval { - my $result = $api->find_orders_by_status(status => $status); -}; -if ($@) { - warn "Exception when calling find_orders_by_status: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | status | string | Status value that needs to be considered for query - -### Return type - -ARRAY[Order] - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -test_api_client_id test_api_client_secret - - -## **get_inventory** - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Sample -```perl -my $api = Something::Deep::StoreApi->new(); - -eval { - my $result = $api->get_inventory(); -}; -if ($@) { - warn "Exception when calling get_inventory: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - -### Return type - -HASH[string,int] - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -api_key - - -## **get_inventory_in_object** - -Fake endpoint to test arbitrary object return by 'Get inventory' - -Returns an arbitrary object which is actually a map of status codes to quantities - -### Sample -```perl -my $api = Something::Deep::StoreApi->new(); - -eval { - my $result = $api->get_inventory_in_object(); -}; -if ($@) { - warn "Exception when calling get_inventory_in_object: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - -### Return type - -object - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -api_key - - -## **place_order** - -Place an order for a pet - - - -### Sample -```perl -my $api = Something::Deep::StoreApi->new(); -my $body = new Something::Deep::Object::Order->new(); # [Order] order placed for purchasing the pet - -eval { - my $result = $api->place_order(body => $body); -}; -if ($@) { - warn "Exception when calling place_order: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | Order | order placed for purchasing the pet - -### Return type - -Order - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -test_api_client_id test_api_client_secret - - -## **get_order_by_id** - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Sample -```perl -my $api = Something::Deep::StoreApi->new(); -my $order_id = 'order_id_example'; # [string] ID of pet that needs to be fetched - -eval { - my $result = $api->get_order_by_id(order_id => $order_id); -}; -if ($@) { - warn "Exception when calling get_order_by_id: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | order_id | string | ID of pet that needs to be fetched - -### Return type - -Order - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - -test_api_key_header test_api_key_query - - -## **delete_order** - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Sample -```perl -my $api = Something::Deep::StoreApi->new(); -my $order_id = 'order_id_example'; # [string] ID of the order that needs to be deleted - -eval { - my $result = $api->delete_order(order_id => $order_id); -}; -if ($@) { - warn "Exception when calling delete_order: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | order_id | string | ID of the order that needs to be deleted - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - - - - -1; diff --git a/samples/client/petstore/perl/deep_module_testdocs/Tag.md b/samples/client/petstore/perl/deep_module_testdocs/Tag.md deleted file mode 100644 index 7c140141216..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/Tag.md +++ /dev/null @@ -1,14 +0,0 @@ -# Something::Deep::Object::Tag - -## Import the module -```perl -use Something::Deep::Object::Tag; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**name** | **string** | | [optional][default to null] - - diff --git a/samples/client/petstore/perl/deep_module_testdocs/User.md b/samples/client/petstore/perl/deep_module_testdocs/User.md deleted file mode 100644 index 6b4eba222f4..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/User.md +++ /dev/null @@ -1,20 +0,0 @@ -# Something::Deep::Object::User - -## Import the module -```perl -use Something::Deep::Object::User; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**username** | **string** | | [optional][default to null] -**first_name** | **string** | | [optional][default to null] -**last_name** | **string** | | [optional][default to null] -**email** | **string** | | [optional][default to null] -**password** | **string** | | [optional][default to null] -**phone** | **string** | | [optional][default to null] -**user_status** | **int** | User Status | [optional][default to null] - - diff --git a/samples/client/petstore/perl/deep_module_testdocs/UserApi.md b/samples/client/petstore/perl/deep_module_testdocs/UserApi.md deleted file mode 100644 index a2ff0756586..00000000000 --- a/samples/client/petstore/perl/deep_module_testdocs/UserApi.md +++ /dev/null @@ -1,318 +0,0 @@ -# Something::Deep::UserApi - -- [create_user](#create_user): Create user -- [create_users_with_array_input](#create_users_with_array_input): Creates list of users with given input array -- [create_users_with_list_input](#create_users_with_list_input): Creates list of users with given input array -- [login_user](#login_user): Logs user into the system -- [logout_user](#logout_user): Logs out current logged in user session -- [get_user_by_name](#get_user_by_name): Get user by user name -- [update_user](#update_user): Updated user -- [delete_user](#delete_user): Delete user - -## **create_user** - -Create user - -This can only be done by the logged in user. - -### Sample -```perl -my $api = Something::Deep::UserApi->new(); -my $body = new Something::Deep::Object::User->new(); # [User] Created user object - -eval { - my $result = $api->create_user(body => $body); -}; -if ($@) { - warn "Exception when calling create_user: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | User | Created user object - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - - - - -## **create_users_with_array_input** - -Creates list of users with given input array - - - -### Sample -```perl -my $api = Something::Deep::UserApi->new(); -my $body = new Something::Deep::Object::ARRAY[User]->new(); # [ARRAY[User]] List of user object - -eval { - my $result = $api->create_users_with_array_input(body => $body); -}; -if ($@) { - warn "Exception when calling create_users_with_array_input: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | ARRAY[User] | List of user object - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - - - - -## **create_users_with_list_input** - -Creates list of users with given input array - - - -### Sample -```perl -my $api = Something::Deep::UserApi->new(); -my $body = new Something::Deep::Object::ARRAY[User]->new(); # [ARRAY[User]] List of user object - -eval { - my $result = $api->create_users_with_list_input(body => $body); -}; -if ($@) { - warn "Exception when calling create_users_with_list_input: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | ARRAY[User] | List of user object - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - - - - -## **login_user** - -Logs user into the system - - - -### Sample -```perl -my $api = Something::Deep::UserApi->new(); -my $username = 'username_example'; # [string] The user name for login -my $password = 'password_example'; # [string] The password for login in clear text - -eval { - my $result = $api->login_user(username => $username, password => $password); -}; -if ($@) { - warn "Exception when calling login_user: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | username | string | The user name for login - No | password | string | The password for login in clear text - -### Return type - -string - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - - - - -## **logout_user** - -Logs out current logged in user session - - - -### Sample -```perl -my $api = Something::Deep::UserApi->new(); - -eval { - my $result = $api->logout_user(); -}; -if ($@) { - warn "Exception when calling logout_user: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - - - - -## **get_user_by_name** - -Get user by user name - - - -### Sample -```perl -my $api = Something::Deep::UserApi->new(); -my $username = 'username_example'; # [string] The name that needs to be fetched. Use user1 for testing. - -eval { - my $result = $api->get_user_by_name(username => $username); -}; -if ($@) { - warn "Exception when calling get_user_by_name: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | username | string | The name that needs to be fetched. Use user1 for testing. - -### Return type - -User - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - - - - -## **update_user** - -Updated user - -This can only be done by the logged in user. - -### Sample -```perl -my $api = Something::Deep::UserApi->new(); -my $username = 'username_example'; # [string] name that need to be deleted -my $body = new Something::Deep::Object::User->new(); # [User] Updated user object - -eval { - my $result = $api->update_user(username => $username, body => $body); -}; -if ($@) { - warn "Exception when calling update_user: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | username | string | name that need to be deleted - No | body | User | Updated user object - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - - - - -## **delete_user** - -Delete user - -This can only be done by the logged in user. - -### Sample -```perl -my $api = Something::Deep::UserApi->new(); -my $username = 'username_example'; # [string] The name that needs to be deleted - -eval { - my $result = $api->delete_user(username => $username); -}; -if ($@) { - warn "Exception when calling delete_user: $@\n"; -} -``` - -### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | username | string | The name that needs to be deleted - -### Return type - -void (empty response body) - -### HTTP headers - -Content-Type: Not defined -Accept: application/json, application/xml - -### Authentication scheme - - - - -1; diff --git a/samples/client/petstore/perl/docs/Category.md b/samples/client/petstore/perl/docs/Category.md index 78db6e0a75a..ff26d61c18b 100644 --- a/samples/client/petstore/perl/docs/Category.md +++ b/samples/client/petstore/perl/docs/Category.md @@ -8,7 +8,7 @@ use WWW::SwaggerClient::Object::Category; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**name** | **string** | | [optional][default to null] +**id** | **int** | | [optional] +**name** | **string** | | [optional] diff --git a/samples/client/petstore/perl/docs/InlineResponse200.md b/samples/client/petstore/perl/docs/InlineResponse200.md index bc8c03d1ccd..a97179f7ddd 100644 --- a/samples/client/petstore/perl/docs/InlineResponse200.md +++ b/samples/client/petstore/perl/docs/InlineResponse200.md @@ -8,11 +8,11 @@ use WWW::SwaggerClient::Object::InlineResponse200; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**tags** | [**ARRAY[Tag]**](docs/Tag.md) | | [optional][default to null] -**id** | **int** | | [default to null] -**category** | **object** | | [optional][default to null] -**status** | **string** | pet status in the store | [optional][default to null] -**name** | **string** | | [optional][default to null] -**photo_urls** | **ARRAY[string]** | | [optional][default to null] +**tags** | [**ARRAY[Tag]**](Tag.md) | | [optional] +**id** | **int** | | +**category** | **object** | | [optional] +**status** | **string** | pet status in the store | [optional] +**name** | **string** | | [optional] +**photo_urls** | **ARRAY[string]** | | [optional] diff --git a/samples/client/petstore/perl/docs/ObjectReturn.md b/samples/client/petstore/perl/docs/ObjectReturn.md index b240f82e740..2bd4ff37640 100644 --- a/samples/client/petstore/perl/docs/ObjectReturn.md +++ b/samples/client/petstore/perl/docs/ObjectReturn.md @@ -8,6 +8,6 @@ use WWW::SwaggerClient::Object::ObjectReturn; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**return** | **int** | | [optional][default to null] +**return** | **int** | | [optional] diff --git a/samples/client/petstore/perl/docs/Order.md b/samples/client/petstore/perl/docs/Order.md index a9b8d380c85..3f519eabc94 100644 --- a/samples/client/petstore/perl/docs/Order.md +++ b/samples/client/petstore/perl/docs/Order.md @@ -8,11 +8,11 @@ use WWW::SwaggerClient::Object::Order; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**pet_id** | **int** | | [optional][default to null] -**quantity** | **int** | | [optional][default to null] -**ship_date** | **DateTime** | | [optional][default to null] -**status** | **string** | Order Status | [optional][default to null] -**complete** | **boolean** | | [optional][default to null] +**id** | **int** | | [optional] +**pet_id** | **int** | | [optional] +**quantity** | **int** | | [optional] +**ship_date** | **DateTime** | | [optional] +**status** | **string** | Order Status | [optional] +**complete** | **boolean** | | [optional] diff --git a/samples/client/petstore/perl/docs/Pet.md b/samples/client/petstore/perl/docs/Pet.md index 53c75040b4d..bc143f0cc26 100644 --- a/samples/client/petstore/perl/docs/Pet.md +++ b/samples/client/petstore/perl/docs/Pet.md @@ -8,11 +8,11 @@ use WWW::SwaggerClient::Object::Pet; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**category** | [**Category**](docs/Category.md) | | [optional][default to null] -**name** | **string** | | [default to null] -**photo_urls** | **ARRAY[string]** | | [default to null] -**tags** | [**ARRAY[Tag]**](docs/Tag.md) | | [optional][default to null] -**status** | **string** | pet status in the store | [optional][default to null] +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **string** | | +**photo_urls** | **ARRAY[string]** | | +**tags** | [**ARRAY[Tag]**](Tag.md) | | [optional] +**status** | **string** | pet status in the store | [optional] diff --git a/samples/client/petstore/perl/docs/PetApi.md b/samples/client/petstore/perl/docs/PetApi.md index 0de7e161637..6d34a53b5c1 100644 --- a/samples/client/petstore/perl/docs/PetApi.md +++ b/samples/client/petstore/perl/docs/PetApi.md @@ -1,18 +1,24 @@ # WWW::SwaggerClient::PetApi -- [update_pet](#update_pet): Update an existing pet -- [add_pet](#add_pet): Add a new pet to the store -- [find_pets_by_status](#find_pets_by_status): Finds Pets by status -- [find_pets_by_tags](#find_pets_by_tags): Finds Pets by tags -- [get_pet_by_id](#get_pet_by_id): Find pet by ID -- [update_pet_with_form](#update_pet_with_form): Updates a pet in the store with form data -- [delete_pet](#delete_pet): Deletes a pet -- [upload_file](#upload_file): uploads an image -- [get_pet_by_id_in_object](#get_pet_by_id_in_object): Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -- [pet_pet_idtesting_byte_arraytrue_get](#pet_pet_idtesting_byte_arraytrue_get): Fake endpoint to test byte array return by 'Find pet by ID' -- [add_pet_using_byte_array](#add_pet_using_byte_array): Fake endpoint to test byte array in body parameter for adding a new pet to the store - -## **update_pet** +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' +[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' +[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store + + +# **update_pet** +> update_pet(body => $body) Update an existing pet @@ -21,7 +27,7 @@ Update an existing pet ### Sample ```perl my $api = WWW::SwaggerClient::PetApi->new(); -my $body = new WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store +my $body = WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store eval { my $result = $api->update_pet(body => $body); @@ -32,9 +38,9 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | Pet | Pet object that needs to be added to the store +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](docs/.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -42,15 +48,19 @@ void (empty response body) ### HTTP headers -Content-Type: application/json, application/xml -Accept: application/json, application/xml + - **Content-Type**: application/json, application/xml + - **Accept**: application/json, application/xml ### Authentication scheme -petstore_auth +petstore_auth -## **add_pet** + + + +# **add_pet** +> add_pet(body => $body) Add a new pet to the store @@ -59,7 +69,7 @@ Add a new pet to the store ### Sample ```perl my $api = WWW::SwaggerClient::PetApi->new(); -my $body = new WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store +my $body = WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store eval { my $result = $api->add_pet(body => $body); @@ -70,9 +80,9 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | Pet | Pet object that needs to be added to the store +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](docs/.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -80,15 +90,19 @@ void (empty response body) ### HTTP headers -Content-Type: application/json, application/xml -Accept: application/json, application/xml + - **Content-Type**: application/json, application/xml + - **Accept**: application/json, application/xml ### Authentication scheme -petstore_auth +petstore_auth + + -## **find_pets_by_status** + +# **find_pets_by_status** +> find_pets_by_status(status => $status) Finds Pets by status @@ -97,7 +111,7 @@ Multiple status values can be provided with comma separated strings ### Sample ```perl my $api = WWW::SwaggerClient::PetApi->new(); -my $status = ; # [ARRAY[string]] Status values that need to be considered for query +my $status = (); # [ARRAY[string]] Status values that need to be considered for query eval { my $result = $api->find_pets_by_status(status => $status); @@ -108,25 +122,29 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | status | ARRAY[string] | Status values that need to be considered for query +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**ARRAY[string]**](docs/.md)| Status values that need to be considered for query | [optional] [default to available] ### Return type -ARRAY[Pet] +[**ARRAY[Pet]**](Pet.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -petstore_auth +petstore_auth + + + -## **find_pets_by_tags** +# **find_pets_by_tags** +> find_pets_by_tags(tags => $tags) Finds Pets by tags @@ -135,7 +153,7 @@ Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 ### Sample ```perl my $api = WWW::SwaggerClient::PetApi->new(); -my $tags = ; # [ARRAY[string]] Tags to filter by +my $tags = (); # [ARRAY[string]] Tags to filter by eval { my $result = $api->find_pets_by_tags(tags => $tags); @@ -146,25 +164,29 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | tags | ARRAY[string] | Tags to filter by +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**ARRAY[string]**](docs/.md)| Tags to filter by | [optional] ### Return type -ARRAY[Pet] +[**ARRAY[Pet]**](Pet.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -petstore_auth +petstore_auth -## **get_pet_by_id** + + + +# **get_pet_by_id** +> get_pet_by_id(pet_id => $pet_id) Find pet by ID @@ -184,25 +206,29 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | ID of pet that needs to be fetched +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | [**int**](docs/.md)| ID of pet that needs to be fetched | ### Return type -Pet +[**Pet**](Pet.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -api_key petstore_auth +api_keypetstore_auth + -## **update_pet_with_form** + + +# **update_pet_with_form** +> update_pet_with_form(pet_id => $pet_id, name => $name, status => $status) Updates a pet in the store with form data @@ -224,11 +250,11 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | string | ID of pet that needs to be updated - No | name | string | Updated name of the pet - No | status | string | Updated status of the pet +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | [**string**](docs/.md)| ID of pet that needs to be updated | + **name** | [**string**](docs/.md)| Updated name of the pet | [optional] + **status** | [**string**](docs/.md)| Updated status of the pet | [optional] ### Return type @@ -236,15 +262,19 @@ void (empty response body) ### HTTP headers -Content-Type: application/x-www-form-urlencoded -Accept: application/json, application/xml + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json, application/xml ### Authentication scheme -petstore_auth +petstore_auth + + -## **delete_pet** + +# **delete_pet** +> delete_pet(pet_id => $pet_id, api_key => $api_key) Deletes a pet @@ -265,10 +295,10 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | Pet id to delete - No | api_key | string | +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | [**int**](docs/.md)| Pet id to delete | + **api_key** | [**string**](docs/.md)| | [optional] ### Return type @@ -276,15 +306,19 @@ void (empty response body) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -petstore_auth +petstore_auth + + + -## **upload_file** +# **upload_file** +> upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file) uploads an image @@ -306,11 +340,11 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | ID of pet to update - No | additional_metadata | string | Additional data to pass to server - No | file | File | file to upload +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | [**int**](docs/.md)| ID of pet to update | + **additional_metadata** | [**string**](docs/.md)| Additional data to pass to server | [optional] + **file** | [**File**](docs/.md)| file to upload | [optional] ### Return type @@ -318,15 +352,19 @@ void (empty response body) ### HTTP headers -Content-Type: multipart/form-data -Accept: application/json, application/xml + - **Content-Type**: multipart/form-data + - **Accept**: application/json, application/xml ### Authentication scheme -petstore_auth +petstore_auth -## **get_pet_by_id_in_object** + + + +# **get_pet_by_id_in_object** +> get_pet_by_id_in_object(pet_id => $pet_id) Fake endpoint to test inline arbitrary object return by 'Find pet by ID' @@ -346,25 +384,29 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | ID of pet that needs to be fetched +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | [**int**](docs/.md)| ID of pet that needs to be fetched | ### Return type -InlineResponse200 +[**InlineResponse200**](InlineResponse200.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -api_key petstore_auth +api_keypetstore_auth + -## **pet_pet_idtesting_byte_arraytrue_get** + + +# **pet_pet_idtesting_byte_arraytrue_get** +> pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id) Fake endpoint to test byte array return by 'Find pet by ID' @@ -384,25 +426,29 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | pet_id | int | ID of pet that needs to be fetched +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | [**int**](docs/.md)| ID of pet that needs to be fetched | ### Return type -string +[**string**](string.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -api_key petstore_auth +api_keypetstore_auth + + -## **add_pet_using_byte_array** + +# **add_pet_using_byte_array** +> add_pet_using_byte_array(body => $body) Fake endpoint to test byte array in body parameter for adding a new pet to the store @@ -411,7 +457,7 @@ Fake endpoint to test byte array in body parameter for adding a new pet to the s ### Sample ```perl my $api = WWW::SwaggerClient::PetApi->new(); -my $body = new WWW::SwaggerClient::Object::string->new(); # [string] Pet object in the form of byte array +my $body = WWW::SwaggerClient::Object::string->new(); # [string] Pet object in the form of byte array eval { my $result = $api->add_pet_using_byte_array(body => $body); @@ -422,9 +468,9 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | string | Pet object in the form of byte array +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**string**](docs/.md)| Pet object in the form of byte array | [optional] ### Return type @@ -432,12 +478,14 @@ void (empty response body) ### HTTP headers -Content-Type: application/json, application/xml -Accept: application/json, application/xml + - **Content-Type**: application/json, application/xml + - **Accept**: application/json, application/xml ### Authentication scheme -petstore_auth +petstore_auth + + + -1; diff --git a/samples/client/petstore/perl/docs/SpecialModelName.md b/samples/client/petstore/perl/docs/SpecialModelName.md index 94b0986dc70..13ac1ac2c98 100644 --- a/samples/client/petstore/perl/docs/SpecialModelName.md +++ b/samples/client/petstore/perl/docs/SpecialModelName.md @@ -8,6 +8,6 @@ use WWW::SwaggerClient::Object::SpecialModelName; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**__special[property/name]** | **int** | | [optional][default to null] +**__special[property/name]** | **int** | | [optional] diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index 4cc9d1ca737..4ec81cd9b62 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -1,13 +1,19 @@ # WWW::SwaggerClient::StoreApi -- [find_orders_by_status](#find_orders_by_status): Finds orders by status -- [get_inventory](#get_inventory): Returns pet inventories by status -- [get_inventory_in_object](#get_inventory_in_object): Fake endpoint to test arbitrary object return by 'Get inventory' -- [place_order](#place_order): Place an order for a pet -- [get_order_by_id](#get_order_by_id): Find purchase order by ID -- [delete_order](#delete_order): Delete purchase order by ID +All URIs are relative to *http://petstore.swagger.io/v2* -## **find_orders_by_status** +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID + + +# **find_orders_by_status** +> find_orders_by_status(status => $status) Finds orders by status @@ -27,25 +33,29 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | status | string | Status value that needs to be considered for query +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**string**](docs/.md)| Status value that needs to be considered for query | [optional] [default to placed] ### Return type -ARRAY[Order] +[**ARRAY[Order]**](Order.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -test_api_client_id test_api_client_secret +test_api_client_idtest_api_client_secret + + + -## **get_inventory** +# **get_inventory** +> get_inventory() Returns pet inventories by status @@ -64,24 +74,28 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- ### Return type -HASH[string,int] +[**HASH[string,int]**](HASH.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -api_key +api_key -## **get_inventory_in_object** + + + +# **get_inventory_in_object** +> get_inventory_in_object() Fake endpoint to test arbitrary object return by 'Get inventory' @@ -100,24 +114,28 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- ### Return type -object +[**object**](object.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -api_key +api_key + + -## **place_order** + +# **place_order** +> place_order(body => $body) Place an order for a pet @@ -126,7 +144,7 @@ Place an order for a pet ### Sample ```perl my $api = WWW::SwaggerClient::StoreApi->new(); -my $body = new WWW::SwaggerClient::Object::Order->new(); # [Order] order placed for purchasing the pet +my $body = WWW::SwaggerClient::Object::Order->new(); # [Order] order placed for purchasing the pet eval { my $result = $api->place_order(body => $body); @@ -137,25 +155,29 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | Order | order placed for purchasing the pet +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](docs/.md)| order placed for purchasing the pet | [optional] ### Return type -Order +[**Order**](Order.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -test_api_client_id test_api_client_secret +test_api_client_idtest_api_client_secret + + -## **get_order_by_id** + +# **get_order_by_id** +> get_order_by_id(order_id => $order_id) Find purchase order by ID @@ -175,25 +197,29 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | order_id | string | ID of pet that needs to be fetched +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | [**string**](docs/.md)| ID of pet that needs to be fetched | ### Return type -Order +[**Order**](Order.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme -test_api_key_header test_api_key_query +test_api_key_headertest_api_key_query + -## **delete_order** + + +# **delete_order** +> delete_order(order_id => $order_id) Delete purchase order by ID @@ -213,9 +239,9 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | order_id | string | ID of the order that needs to be deleted +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | [**string**](docs/.md)| ID of the order that needs to be deleted | ### Return type @@ -223,12 +249,14 @@ void (empty response body) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme +No authentiation required + + -1; diff --git a/samples/client/petstore/perl/docs/Tag.md b/samples/client/petstore/perl/docs/Tag.md index c995d0cebf3..b97e36a7ca4 100644 --- a/samples/client/petstore/perl/docs/Tag.md +++ b/samples/client/petstore/perl/docs/Tag.md @@ -8,7 +8,7 @@ use WWW::SwaggerClient::Object::Tag; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**name** | **string** | | [optional][default to null] +**id** | **int** | | [optional] +**name** | **string** | | [optional] diff --git a/samples/client/petstore/perl/docs/User.md b/samples/client/petstore/perl/docs/User.md index 52c8d2b84ca..35c5c4ef91d 100644 --- a/samples/client/petstore/perl/docs/User.md +++ b/samples/client/petstore/perl/docs/User.md @@ -8,13 +8,13 @@ use WWW::SwaggerClient::Object::User; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional][default to null] -**username** | **string** | | [optional][default to null] -**first_name** | **string** | | [optional][default to null] -**last_name** | **string** | | [optional][default to null] -**email** | **string** | | [optional][default to null] -**password** | **string** | | [optional][default to null] -**phone** | **string** | | [optional][default to null] -**user_status** | **int** | User Status | [optional][default to null] +**id** | **int** | | [optional] +**username** | **string** | | [optional] +**first_name** | **string** | | [optional] +**last_name** | **string** | | [optional] +**email** | **string** | | [optional] +**password** | **string** | | [optional] +**phone** | **string** | | [optional] +**user_status** | **int** | User Status | [optional] diff --git a/samples/client/petstore/perl/docs/UserApi.md b/samples/client/petstore/perl/docs/UserApi.md index 319359ff6bf..98ec34cc0a0 100644 --- a/samples/client/petstore/perl/docs/UserApi.md +++ b/samples/client/petstore/perl/docs/UserApi.md @@ -1,15 +1,21 @@ # WWW::SwaggerClient::UserApi -- [create_user](#create_user): Create user -- [create_users_with_array_input](#create_users_with_array_input): Creates list of users with given input array -- [create_users_with_list_input](#create_users_with_list_input): Creates list of users with given input array -- [login_user](#login_user): Logs user into the system -- [logout_user](#logout_user): Logs out current logged in user session -- [get_user_by_name](#get_user_by_name): Get user by user name -- [update_user](#update_user): Updated user -- [delete_user](#delete_user): Delete user +All URIs are relative to *http://petstore.swagger.io/v2* -## **create_user** +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user + + +# **create_user** +> create_user(body => $body) Create user @@ -18,7 +24,7 @@ This can only be done by the logged in user. ### Sample ```perl my $api = WWW::SwaggerClient::UserApi->new(); -my $body = new WWW::SwaggerClient::Object::User->new(); # [User] Created user object +my $body = WWW::SwaggerClient::Object::User->new(); # [User] Created user object eval { my $result = $api->create_user(body => $body); @@ -29,9 +35,9 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | User | Created user object +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](docs/.md)| Created user object | [optional] ### Return type @@ -39,15 +45,19 @@ void (empty response body) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme +No authentiation required + -## **create_users_with_array_input** + +# **create_users_with_array_input** +> create_users_with_array_input(body => $body) Creates list of users with given input array @@ -56,7 +66,7 @@ Creates list of users with given input array ### Sample ```perl my $api = WWW::SwaggerClient::UserApi->new(); -my $body = new WWW::SwaggerClient::Object::ARRAY[User]->new(); # [ARRAY[User]] List of user object +my $body = (WWW::SwaggerClient::Object::ARRAY[User]->new()); # [ARRAY[User]] List of user object eval { my $result = $api->create_users_with_array_input(body => $body); @@ -67,9 +77,9 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | ARRAY[User] | List of user object +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ARRAY[User]**](docs/.md)| List of user object | [optional] ### Return type @@ -77,15 +87,19 @@ void (empty response body) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme +No authentiation required + -## **create_users_with_list_input** + +# **create_users_with_list_input** +> create_users_with_list_input(body => $body) Creates list of users with given input array @@ -94,7 +108,7 @@ Creates list of users with given input array ### Sample ```perl my $api = WWW::SwaggerClient::UserApi->new(); -my $body = new WWW::SwaggerClient::Object::ARRAY[User]->new(); # [ARRAY[User]] List of user object +my $body = (WWW::SwaggerClient::Object::ARRAY[User]->new()); # [ARRAY[User]] List of user object eval { my $result = $api->create_users_with_list_input(body => $body); @@ -105,9 +119,9 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | body | ARRAY[User] | List of user object +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ARRAY[User]**](docs/.md)| List of user object | [optional] ### Return type @@ -115,15 +129,19 @@ void (empty response body) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme +No authentiation required + -## **login_user** + +# **login_user** +> login_user(username => $username, password => $password) Logs user into the system @@ -144,26 +162,30 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - No | username | string | The user name for login - No | password | string | The password for login in clear text +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | [**string**](docs/.md)| The user name for login | [optional] + **password** | [**string**](docs/.md)| The password for login in clear text | [optional] ### Return type -string +[**string**](string.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme +No authentiation required + -## **logout_user** + +# **logout_user** +> logout_user() Logs out current logged in user session @@ -182,8 +204,8 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- ### Return type @@ -191,15 +213,19 @@ void (empty response body) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme +No authentiation required + + -## **get_user_by_name** +# **get_user_by_name** +> get_user_by_name(username => $username) Get user by user name @@ -219,25 +245,29 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | username | string | The name that needs to be fetched. Use user1 for testing. +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | [**string**](docs/.md)| The name that needs to be fetched. Use user1 for testing. | ### Return type -User +[**User**](User.md) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme +No authentiation required + + -## **update_user** +# **update_user** +> update_user(username => $username, body => $body) Updated user @@ -247,7 +277,7 @@ This can only be done by the logged in user. ```perl my $api = WWW::SwaggerClient::UserApi->new(); my $username = 'username_example'; # [string] name that need to be deleted -my $body = new WWW::SwaggerClient::Object::User->new(); # [User] Updated user object +my $body = WWW::SwaggerClient::Object::User->new(); # [User] Updated user object eval { my $result = $api->update_user(username => $username, body => $body); @@ -258,10 +288,10 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | username | string | name that need to be deleted - No | body | User | Updated user object +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | [**string**](docs/.md)| name that need to be deleted | + **body** | [**User**](docs/.md)| Updated user object | [optional] ### Return type @@ -269,15 +299,19 @@ void (empty response body) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme +No authentiation required -## **delete_user** + + +# **delete_user** +> delete_user(username => $username) Delete user @@ -297,9 +331,9 @@ if ($@) { ``` ### Parameters -Required | Name | Type | Description ------------- | ------------- | ------------- | ------------- - Yes | username | string | The name that needs to be deleted +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | [**string**](docs/.md)| The name that needs to be deleted | ### Return type @@ -307,12 +341,14 @@ void (empty response body) ### HTTP headers -Content-Type: Not defined -Accept: application/json, application/xml + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml ### Authentication scheme +No authentiation required + + -1; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm index 3457ca16897..88a3a36e9e0 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm @@ -37,7 +37,7 @@ has version_info => ( is => 'ro', default => sub { { app_name => 'Swagger Petstore', app_version => '1.0.0', - generated_date => '2016-03-06T12:43:31.929+08:00', + generated_date => '2016-03-06T14:25:02.405+08:00', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', } }, documentation => 'Information about the application version and the codegen codebase version' @@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project: =over 4 -=item Build date: 2016-03-06T12:43:31.929+08:00 +=item Build date: 2016-03-06T14:25:02.405+08:00 =item Build package: class io.swagger.codegen.languages.PerlClientCodegen From 4ec8003ab50cc6e64a0e3d12ccc32dbd95efc8e2 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 6 Mar 2016 15:38:50 +0800 Subject: [PATCH 5/7] add isPrimitiveType,baseType to parameter --- .../io/swagger/codegen/AbstractGenerator.java | 1 + .../io/swagger/codegen/CodegenParameter.java | 2 +- .../io/swagger/codegen/DefaultCodegen.java | 23 +++++++++++++ samples/client/petstore/perl/README.md | 2 +- samples/client/petstore/perl/docs/PetApi.md | 32 +++++++++---------- samples/client/petstore/perl/docs/StoreApi.md | 8 ++--- samples/client/petstore/perl/docs/UserApi.md | 18 +++++------ .../perl/lib/WWW/SwaggerClient/Role.pm | 4 +-- 8 files changed, 57 insertions(+), 33 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/AbstractGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/AbstractGenerator.java index cadd7a1d85f..1d92c923c5c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/AbstractGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/AbstractGenerator.java @@ -69,6 +69,7 @@ public Reader getTemplateReader(String name) { * * @param config Codegen config * @param templateFile Template file + * @return String Full template file path */ public String getFullTemplateFile(CodegenConfig config, String templateFile) { String library = config.getLibrary(); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java index a1b299f818c..d386b4c4dca 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java @@ -8,7 +8,7 @@ public class CodegenParameter { public Boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, hasMore, isContainer, - secondaryParam, isCollectionFormatMulti; + secondaryParam, isCollectionFormatMulti, isPrimitiveType; public String baseName, paramName, dataType, datatypeWithEnum, collectionFormat, description, baseType, defaultValue; public String example; // example value (x-example) public String jsonSchema; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 6f4987669bb..001de63baea 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -1499,6 +1499,14 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation } } } + + // set isPrimitiveType and baseType for allParams + /*if (languageSpecificPrimitives.contains(p.baseType)) { + p.isPrimitiveType = true; + p.baseType = getSwaggerType(p); + }*/ + + allParams.add(p); if (param instanceof QueryParameter) { p.isQueryParam = new Boolean(true); @@ -1770,7 +1778,9 @@ public CodegenParameter fromParameter(Parameter param, Set imports) { prop.setRequired(bp.getRequired()); CodegenProperty cp = fromProperty("property", prop); if (cp != null) { + p.baseType = cp.baseType; p.dataType = cp.datatype; + p.isPrimitiveType = cp.isPrimitiveType; p.isBinary = cp.datatype.toLowerCase().startsWith("byte"); } @@ -1790,6 +1800,8 @@ public CodegenParameter fromParameter(Parameter param, Set imports) { } imports.add(cp.baseType); p.dataType = cp.datatype; + p.baseType = cp.complexType; + p.isPrimitiveType = cp.isPrimitiveType; p.isContainer = true; p.isListContainer = true; @@ -1810,6 +1822,7 @@ public CodegenParameter fromParameter(Parameter param, Set imports) { name = getTypeDeclaration(name); } p.dataType = name; + p.baseType = name; } } p.paramName = toParamName(bp.getName()); @@ -2456,24 +2469,34 @@ public void setParameterBooleanFlagWithCodegenProperty(CodegenParameter paramete if (Boolean.TRUE.equals(property.isString)) { parameter.isString = true; + parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isBoolean)) { parameter.isBoolean = true; + parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isLong)) { parameter.isLong = true; + parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isInteger)) { parameter.isInteger = true; + parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isDouble)) { parameter.isDouble = true; + parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isFloat)) { parameter.isFloat = true; + parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isByteArray)) { parameter.isByteArray = true; + parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isBinary)) { parameter.isByteArray = true; + parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isDate)) { parameter.isDate = true; + parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isDateTime)) { parameter.isDateTime = true; + parameter.isPrimitiveType = true; } else { LOGGER.debug("Property type is not primitive: " + property.datatype); } diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 07d25457a2d..3833861dfc6 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore Automatically generated by the Perl Swagger Codegen project: -- Build date: 2016-03-06T14:25:02.405+08:00 +- Build date: 2016-03-06T15:35:17.711+08:00 - Build package: class io.swagger.codegen.languages.PerlClientCodegen - Codegen version: diff --git a/samples/client/petstore/perl/docs/PetApi.md b/samples/client/petstore/perl/docs/PetApi.md index 6d34a53b5c1..a40ed16c882 100644 --- a/samples/client/petstore/perl/docs/PetApi.md +++ b/samples/client/petstore/perl/docs/PetApi.md @@ -40,7 +40,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](docs/.md)| Pet object that needs to be added to the store | [optional] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -82,7 +82,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](docs/.md)| Pet object that needs to be added to the store | [optional] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -124,7 +124,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**ARRAY[string]**](docs/.md)| Status values that need to be considered for query | [optional] [default to available] + **status** | [**ARRAY[string]**](string.md)| Status values that need to be considered for query | [optional] [default to available] ### Return type @@ -166,7 +166,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**ARRAY[string]**](docs/.md)| Tags to filter by | [optional] + **tags** | [**ARRAY[string]**](string.md)| Tags to filter by | [optional] ### Return type @@ -208,7 +208,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | [**int**](docs/.md)| ID of pet that needs to be fetched | + **pet_id** | **int**| ID of pet that needs to be fetched | ### Return type @@ -252,9 +252,9 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | [**string**](docs/.md)| ID of pet that needs to be updated | - **name** | [**string**](docs/.md)| Updated name of the pet | [optional] - **status** | [**string**](docs/.md)| Updated status of the pet | [optional] + **pet_id** | **string**| ID of pet that needs to be updated | + **name** | **string**| Updated name of the pet | [optional] + **status** | **string**| Updated status of the pet | [optional] ### Return type @@ -297,8 +297,8 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | [**int**](docs/.md)| Pet id to delete | - **api_key** | [**string**](docs/.md)| | [optional] + **pet_id** | **int**| Pet id to delete | + **api_key** | **string**| | [optional] ### Return type @@ -342,9 +342,9 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | [**int**](docs/.md)| ID of pet to update | - **additional_metadata** | [**string**](docs/.md)| Additional data to pass to server | [optional] - **file** | [**File**](docs/.md)| file to upload | [optional] + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **string**| Additional data to pass to server | [optional] + **file** | [**File**](.md)| file to upload | [optional] ### Return type @@ -386,7 +386,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | [**int**](docs/.md)| ID of pet that needs to be fetched | + **pet_id** | **int**| ID of pet that needs to be fetched | ### Return type @@ -428,7 +428,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | [**int**](docs/.md)| ID of pet that needs to be fetched | + **pet_id** | **int**| ID of pet that needs to be fetched | ### Return type @@ -470,7 +470,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**string**](docs/.md)| Pet object in the form of byte array | [optional] + **body** | **string**| Pet object in the form of byte array | [optional] ### Return type diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index 4ec81cd9b62..32326780dd2 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -35,7 +35,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**string**](docs/.md)| Status value that needs to be considered for query | [optional] [default to placed] + **status** | **string**| Status value that needs to be considered for query | [optional] [default to placed] ### Return type @@ -157,7 +157,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](docs/.md)| order placed for purchasing the pet | [optional] + **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional] ### Return type @@ -199,7 +199,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | [**string**](docs/.md)| ID of pet that needs to be fetched | + **order_id** | **string**| ID of pet that needs to be fetched | ### Return type @@ -241,7 +241,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | [**string**](docs/.md)| ID of the order that needs to be deleted | + **order_id** | **string**| ID of the order that needs to be deleted | ### Return type diff --git a/samples/client/petstore/perl/docs/UserApi.md b/samples/client/petstore/perl/docs/UserApi.md index 98ec34cc0a0..33f8a7332c5 100644 --- a/samples/client/petstore/perl/docs/UserApi.md +++ b/samples/client/petstore/perl/docs/UserApi.md @@ -37,7 +37,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](docs/.md)| Created user object | [optional] + **body** | [**User**](User.md)| Created user object | [optional] ### Return type @@ -79,7 +79,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ARRAY[User]**](docs/.md)| List of user object | [optional] + **body** | [**ARRAY[User]**](User.md)| List of user object | [optional] ### Return type @@ -121,7 +121,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ARRAY[User]**](docs/.md)| List of user object | [optional] + **body** | [**ARRAY[User]**](User.md)| List of user object | [optional] ### Return type @@ -164,8 +164,8 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | [**string**](docs/.md)| The user name for login | [optional] - **password** | [**string**](docs/.md)| The password for login in clear text | [optional] + **username** | **string**| The user name for login | [optional] + **password** | **string**| The password for login in clear text | [optional] ### Return type @@ -247,7 +247,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | [**string**](docs/.md)| The name that needs to be fetched. Use user1 for testing. | + **username** | **string**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -290,8 +290,8 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | [**string**](docs/.md)| name that need to be deleted | - **body** | [**User**](docs/.md)| Updated user object | [optional] + **username** | **string**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | [optional] ### Return type @@ -333,7 +333,7 @@ if ($@) { ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | [**string**](docs/.md)| The name that needs to be deleted | + **username** | **string**| The name that needs to be deleted | ### Return type diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm index 88a3a36e9e0..0e709d87a59 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm @@ -37,7 +37,7 @@ has version_info => ( is => 'ro', default => sub { { app_name => 'Swagger Petstore', app_version => '1.0.0', - generated_date => '2016-03-06T14:25:02.405+08:00', + generated_date => '2016-03-06T15:35:17.711+08:00', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', } }, documentation => 'Information about the application version and the codegen codebase version' @@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project: =over 4 -=item Build date: 2016-03-06T14:25:02.405+08:00 +=item Build date: 2016-03-06T15:35:17.711+08:00 =item Build package: class io.swagger.codegen.languages.PerlClientCodegen From 9eecccb4184244cee093fc2a8d825f1d87289a2a Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 6 Mar 2016 15:52:47 +0800 Subject: [PATCH 6/7] fix java docstring --- .../src/main/java/io/swagger/codegen/DefaultCodegen.java | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 001de63baea..4ab37381d72 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -656,7 +656,6 @@ public String toInstantiationType(Property p) { * Return the example value of the parameter. * * @param p Swagger property object - * @return string presentation of the example value of the property */ public void setParameterExampleValue(CodegenParameter p) { From 9c7316d77ae6ede74f9b8f33622bacff4154f5bf Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 8 Mar 2016 16:55:17 +0800 Subject: [PATCH 7/7] fix return type in perl doc --- samples/client/petstore/perl/README.md | 4 +- samples/client/petstore/perl/docs/PetApi.md | 46 +++++++++---------- samples/client/petstore/perl/docs/StoreApi.md | 28 +++++------ samples/client/petstore/perl/docs/UserApi.md | 34 +++++++------- .../perl/lib/WWW/SwaggerClient/Role.pm | 4 +- 5 files changed, 58 insertions(+), 58 deletions(-) diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 3833861dfc6..3a10c7a5652 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore Automatically generated by the Perl Swagger Codegen project: -- Build date: 2016-03-06T15:35:17.711+08:00 +- Build date: 2016-03-08T16:48:08.361+08:00 - Build package: class io.swagger.codegen.languages.PerlClientCodegen - Codegen version: @@ -256,7 +256,7 @@ Class | Method | HTTP request | Description - [WWW::SwaggerClient::Object::Category](docs/Category.md) - [WWW::SwaggerClient::Object::Pet](docs/Pet.md) - [WWW::SwaggerClient::Object::Tag](docs/Tag.md) - - [WWW::SwaggerClient::Object::ObjectReturn](docs/ObjectReturn.md) + - [WWW::SwaggerClient::Object::ModelReturn](docs/ModelReturn.md) - [WWW::SwaggerClient::Object::Order](docs/Order.md) - [WWW::SwaggerClient::Object::SpecialModelName](docs/SpecialModelName.md) - [WWW::SwaggerClient::Object::InlineResponse200](docs/InlineResponse200.md) diff --git a/samples/client/petstore/perl/docs/PetApi.md b/samples/client/petstore/perl/docs/PetApi.md index a40ed16c882..677b4d390e8 100644 --- a/samples/client/petstore/perl/docs/PetApi.md +++ b/samples/client/petstore/perl/docs/PetApi.md @@ -24,13 +24,13 @@ Update an existing pet -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $body = WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store eval { - my $result = $api->update_pet(body => $body); + $api->update_pet(body => $body); }; if ($@) { warn "Exception when calling update_pet: $@\n"; @@ -66,13 +66,13 @@ Add a new pet to the store -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $body = WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store eval { - my $result = $api->add_pet(body => $body); + $api->add_pet(body => $body); }; if ($@) { warn "Exception when calling add_pet: $@\n"; @@ -102,13 +102,13 @@ petstore_auth # **find_pets_by_status** -> find_pets_by_status(status => $status) +> ARRAY[Pet] find_pets_by_status(status => $status) Finds Pets by status Multiple status values can be provided with comma separated strings -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $status = (); # [ARRAY[string]] Status values that need to be considered for query @@ -144,13 +144,13 @@ petstore_auth # **find_pets_by_tags** -> find_pets_by_tags(tags => $tags) +> ARRAY[Pet] find_pets_by_tags(tags => $tags) Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $tags = (); # [ARRAY[string]] Tags to filter by @@ -186,13 +186,13 @@ petstore_auth # **get_pet_by_id** -> get_pet_by_id(pet_id => $pet_id) +> Pet get_pet_by_id(pet_id => $pet_id) Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # [int] ID of pet that needs to be fetched @@ -234,7 +234,7 @@ Updates a pet in the store with form data -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $pet_id = 'pet_id_example'; # [string] ID of pet that needs to be updated @@ -242,7 +242,7 @@ my $name = 'name_example'; # [string] Updated name of the pet my $status = 'status_example'; # [string] Updated status of the pet eval { - my $result = $api->update_pet_with_form(pet_id => $pet_id, name => $name, status => $status); + $api->update_pet_with_form(pet_id => $pet_id, name => $name, status => $status); }; if ($@) { warn "Exception when calling update_pet_with_form: $@\n"; @@ -280,14 +280,14 @@ Deletes a pet -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # [int] Pet id to delete my $api_key = 'api_key_example'; # [string] eval { - my $result = $api->delete_pet(pet_id => $pet_id, api_key => $api_key); + $api->delete_pet(pet_id => $pet_id, api_key => $api_key); }; if ($@) { warn "Exception when calling delete_pet: $@\n"; @@ -324,7 +324,7 @@ uploads an image -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # [int] ID of pet to update @@ -332,7 +332,7 @@ my $additional_metadata = 'additional_metadata_example'; # [string] Additional d my $file = '/path/to/file.txt'; # [File] file to upload eval { - my $result = $api->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file); + $api->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file); }; if ($@) { warn "Exception when calling upload_file: $@\n"; @@ -364,13 +364,13 @@ petstore_auth # **get_pet_by_id_in_object** -> get_pet_by_id_in_object(pet_id => $pet_id) +> InlineResponse200 get_pet_by_id_in_object(pet_id => $pet_id) Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # [int] ID of pet that needs to be fetched @@ -406,13 +406,13 @@ api_keypetstore_auth # **pet_pet_idtesting_byte_arraytrue_get** -> pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id) +> string pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id) Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $pet_id = 789; # [int] ID of pet that needs to be fetched @@ -432,7 +432,7 @@ Name | Type | Description | Notes ### Return type -[**string**](string.md) +**string** ### HTTP headers @@ -454,13 +454,13 @@ Fake endpoint to test byte array in body parameter for adding a new pet to the s -### Sample +### Example ```perl my $api = WWW::SwaggerClient::PetApi->new(); my $body = WWW::SwaggerClient::Object::string->new(); # [string] Pet object in the form of byte array eval { - my $result = $api->add_pet_using_byte_array(body => $body); + $api->add_pet_using_byte_array(body => $body); }; if ($@) { warn "Exception when calling add_pet_using_byte_array: $@\n"; diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index 32326780dd2..fb004bce30f 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -13,13 +13,13 @@ Method | HTTP request | Description # **find_orders_by_status** -> find_orders_by_status(status => $status) +> ARRAY[Order] find_orders_by_status(status => $status) Finds orders by status A single status value can be provided as a string -### Sample +### Example ```perl my $api = WWW::SwaggerClient::StoreApi->new(); my $status = 'status_example'; # [string] Status value that needs to be considered for query @@ -55,13 +55,13 @@ test_api_client_idtest_api_client_secret # **get_inventory** -> get_inventory() +> HASH[string,int] get_inventory() Returns pet inventories by status Returns a map of status codes to quantities -### Sample +### Example ```perl my $api = WWW::SwaggerClient::StoreApi->new(); @@ -79,7 +79,7 @@ Name | Type | Description | Notes ### Return type -[**HASH[string,int]**](HASH.md) +**HASH[string,int]** ### HTTP headers @@ -95,13 +95,13 @@ api_key # **get_inventory_in_object** -> get_inventory_in_object() +> object get_inventory_in_object() Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities -### Sample +### Example ```perl my $api = WWW::SwaggerClient::StoreApi->new(); @@ -119,7 +119,7 @@ Name | Type | Description | Notes ### Return type -[**object**](object.md) +**object** ### HTTP headers @@ -135,13 +135,13 @@ api_key # **place_order** -> place_order(body => $body) +> Order place_order(body => $body) Place an order for a pet -### Sample +### Example ```perl my $api = WWW::SwaggerClient::StoreApi->new(); my $body = WWW::SwaggerClient::Object::Order->new(); # [Order] order placed for purchasing the pet @@ -177,13 +177,13 @@ test_api_client_idtest_api_client_secret # **get_order_by_id** -> get_order_by_id(order_id => $order_id) +> Order get_order_by_id(order_id => $order_id) Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -### Sample +### Example ```perl my $api = WWW::SwaggerClient::StoreApi->new(); my $order_id = 'order_id_example'; # [string] ID of pet that needs to be fetched @@ -225,13 +225,13 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -### Sample +### Example ```perl my $api = WWW::SwaggerClient::StoreApi->new(); my $order_id = 'order_id_example'; # [string] ID of the order that needs to be deleted eval { - my $result = $api->delete_order(order_id => $order_id); + $api->delete_order(order_id => $order_id); }; if ($@) { warn "Exception when calling delete_order: $@\n"; diff --git a/samples/client/petstore/perl/docs/UserApi.md b/samples/client/petstore/perl/docs/UserApi.md index 33f8a7332c5..e60e51cfb2d 100644 --- a/samples/client/petstore/perl/docs/UserApi.md +++ b/samples/client/petstore/perl/docs/UserApi.md @@ -21,13 +21,13 @@ Create user This can only be done by the logged in user. -### Sample +### Example ```perl my $api = WWW::SwaggerClient::UserApi->new(); my $body = WWW::SwaggerClient::Object::User->new(); # [User] Created user object eval { - my $result = $api->create_user(body => $body); + $api->create_user(body => $body); }; if ($@) { warn "Exception when calling create_user: $@\n"; @@ -63,13 +63,13 @@ Creates list of users with given input array -### Sample +### Example ```perl my $api = WWW::SwaggerClient::UserApi->new(); my $body = (WWW::SwaggerClient::Object::ARRAY[User]->new()); # [ARRAY[User]] List of user object eval { - my $result = $api->create_users_with_array_input(body => $body); + $api->create_users_with_array_input(body => $body); }; if ($@) { warn "Exception when calling create_users_with_array_input: $@\n"; @@ -105,13 +105,13 @@ Creates list of users with given input array -### Sample +### Example ```perl my $api = WWW::SwaggerClient::UserApi->new(); my $body = (WWW::SwaggerClient::Object::ARRAY[User]->new()); # [ARRAY[User]] List of user object eval { - my $result = $api->create_users_with_list_input(body => $body); + $api->create_users_with_list_input(body => $body); }; if ($@) { warn "Exception when calling create_users_with_list_input: $@\n"; @@ -141,13 +141,13 @@ No authentiation required # **login_user** -> login_user(username => $username, password => $password) +> string login_user(username => $username, password => $password) Logs user into the system -### Sample +### Example ```perl my $api = WWW::SwaggerClient::UserApi->new(); my $username = 'username_example'; # [string] The user name for login @@ -169,7 +169,7 @@ Name | Type | Description | Notes ### Return type -[**string**](string.md) +**string** ### HTTP headers @@ -191,12 +191,12 @@ Logs out current logged in user session -### Sample +### Example ```perl my $api = WWW::SwaggerClient::UserApi->new(); eval { - my $result = $api->logout_user(); + $api->logout_user(); }; if ($@) { warn "Exception when calling logout_user: $@\n"; @@ -225,13 +225,13 @@ No authentiation required # **get_user_by_name** -> get_user_by_name(username => $username) +> User get_user_by_name(username => $username) Get user by user name -### Sample +### Example ```perl my $api = WWW::SwaggerClient::UserApi->new(); my $username = 'username_example'; # [string] The name that needs to be fetched. Use user1 for testing. @@ -273,14 +273,14 @@ Updated user This can only be done by the logged in user. -### Sample +### Example ```perl my $api = WWW::SwaggerClient::UserApi->new(); my $username = 'username_example'; # [string] name that need to be deleted my $body = WWW::SwaggerClient::Object::User->new(); # [User] Updated user object eval { - my $result = $api->update_user(username => $username, body => $body); + $api->update_user(username => $username, body => $body); }; if ($@) { warn "Exception when calling update_user: $@\n"; @@ -317,13 +317,13 @@ Delete user This can only be done by the logged in user. -### Sample +### Example ```perl my $api = WWW::SwaggerClient::UserApi->new(); my $username = 'username_example'; # [string] The name that needs to be deleted eval { - my $result = $api->delete_user(username => $username); + $api->delete_user(username => $username); }; if ($@) { warn "Exception when calling delete_user: $@\n"; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm index 0e709d87a59..d0e21454fc3 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm @@ -37,7 +37,7 @@ has version_info => ( is => 'ro', default => sub { { app_name => 'Swagger Petstore', app_version => '1.0.0', - generated_date => '2016-03-06T15:35:17.711+08:00', + generated_date => '2016-03-08T16:48:08.361+08:00', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', } }, documentation => 'Information about the application version and the codegen codebase version' @@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project: =over 4 -=item Build date: 2016-03-06T15:35:17.711+08:00 +=item Build date: 2016-03-08T16:48:08.361+08:00 =item Build package: class io.swagger.codegen.languages.PerlClientCodegen