z0mt3c / hapi-swaggered

Yet another hapi plugin providing swagger compliant API specifications based on routes and joi schemas to be used with swagger-ui.
MIT License
82 stars 38 forks source link

Implement Security Requirement Object #17

Open grabbou opened 9 years ago

grabbou commented 9 years ago

As per spec https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#securityRequirementObject

Would be quite nice to set that up by default by getting scope array parameter that's sometimes set in config.auth of a given route, especially when being used with hapi-auth-jwt or any token-based auth scheme.

What you think?

grabbou commented 9 years ago

If not, then let's just figure out how to expose scopes nicely without violating swagger specification. Currently, in order to have scopes nicely exposed, I need to tweak the route description by prepending it with toString of the scopes array.

So Gets list of all users becomes [users:read] Gets list of all users

z0mt3c commented 9 years ago

Should wait for https://github.com/swagger-api/swagger-ui/issues/1108

stjohnjohnson commented 8 years ago

Looks like https://github.com/swagger-api/swagger-ui/pull/2014 is merged. Is anyone already working on this?