z0mt3c / hapi-swaggered-ui

An easy swagger-ui drop-in plugin for hapi (to be used with hapi-swaggered).
39 stars 31 forks source link

authorization not working on 3.0.1 #127

Closed richardlay closed 6 years ago

richardlay commented 6 years ago

Using the options below, the authorization fields don't appear on the swagger page. It used to for v2.x

            {
                plugin: require("hapi-swaggered-ui"),
                options: {
                    title: "medipass",
                    path: "/docs/partner",
                    authorization: {
                        field: "x-appid",
                        scope: "header",
                        placeholder: "Enter your application ID here"
                    },
                    auth: {
                        mode: "required",
                        strategies: ["apiDocs"]
                    },
                    swaggerOptions: {
                        validatorUrl: false
                    }
                }
            }
z0mt3c commented 6 years ago

on 3 security is not part of swaggered-ui... it now has to be specified through the swagger-schema (hapi-swaggered)

richardlay commented 6 years ago

Hi @z0mt3c, I was actually referring to the authorization option (not auth). Before I was able to set a header using this feature. Is this no longer available?

z0mt3c commented 6 years ago

Jup, latest swagger-ui expects the authorization to be part of the json.

richardlay commented 6 years ago

OK. So the authorization option on this library no longer does anything? If so, would be nice to remove from the documentation.

Just to be clear, what I want to achieve is to set a global header that will be passed to every API call.