khrt / Raisin

Raisin - a REST API micro framework for Perl 🐫 🐪
61 stars 30 forks source link

Missing SecurityDefinitionsObject on Raisin::Plugin::Swagger #20

Closed 7ojo closed 7 years ago

7ojo commented 7 years ago

Hello,

I see no documentation about security object definition, but I see there are some commented lines on the code:

    my %spec = (
        swagger  => '2.0',
        info     => _info_object($app),
        host     => $req->env->{HTTP_HOST},
        basePath => $base_path,
        schemes  => [$req->scheme],
        consumes => \@content_types,
        produces => \@content_types,
        paths    => _paths_object($routes), #R
        definitions => _definitions_object($routes),
        #parameters => undef,
        #responses => undef,
        #securityDefinitions => undef,
        #security => undef,
        tags => _tags_object($self->app),
        #externalDocs => '', # TODO
    );

So is there some plans adding support or thoughts about security definitions on OpenAPI spec?

Personally I'll be needing api_key, but trying to figure it out how to implement it with Raisin :) Code examples on authentication also are very welcome.

Loving this simplicity of Raisin 👍 Little of coding and you have working REST api

Best regards, Jarkko

khrt commented 7 years ago

Going to be added in the next release. Thanks for the report.

khrt commented 7 years ago

Please check the POD https://metacpan.org/pod/release/RTKH/Raisin-0.69/lib/Raisin/Plugin/Swagger.pm#SECURITY