Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

RFC: Swagger-codegen for Perl

by wing328 (Initiate)
on May 15, 2015 at 06:17 UTC ( [id://1126733]=perlmeditation: print w/replies, xml ) Need Help??

Hi all,

https://github.com/swagger-api/swagger-codegen contains a template-driven engine to generate client code in different languages by parsing your Swagger Resource Declaration. Recently I've added the Perl template. To test the code generation, please perform the following (assuming you've the dependencies installed):

git clone https://github.com/swagger-api/swagger-codegen.git git checkout develop_2.0 git checkout mvn clean && ./bin/perl-petstore.sh

If you do not want to install the dependencies and just want to get a peek at the auto-generated Perl SDK, please go to the directory samples/client/petstore/perl to have a look at the Perl SDK for Petstore http://petstore.swagger.io (please make sure you're in the develop_2.0 branch)

The Perl SDK is not perfect and I would appreciate your time to test and review, and share with me your feedback.

(ideally I would like to post this at "Meditations" but I couldn't find a way to post there)

Best,
wing328
http://github.com/wing328

Replies are listed 'Best First'.
Re: RFC: Swagger-codegen for Perl
by TGI (Parson) on May 26, 2015 at 06:39 UTC

    I am thrilled to see Swagger and Perl working together.

    After the most superficial review, one thing stands out. The APIClient.mustache file uses the best-avoided Switch module.

    There are a number of ways to write the code without switch. I recommend either chaining if () {} elsif () {} or using a hash as a dispatch table.

    I'll try to get a more in depth look, and see if I have any other comments.


    TGI says moo

      Thanks TGI. I'll revise the code to avoid using Switch
        Submitted https://github.com/swagger-api/swagger-codegen/pull/799 to avoid using Switch and make API client more pluggable
      another easy criticism, comments instead of pod
        yes, i want to use pod but didn't have cycle to do it :( if you've time, would be nice if you can submit a PR to update the comment
Re: RFC: Swagger-codegen for Perl
by Anonymous Monk on May 15, 2015 at 07:26 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://1126733]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found