Copy to ClipboardCopied!Toggle word wrapToggle overflow
Here we have setup two security definitions
OAuth2 - with implicit authorization with the provided url
Api Key - using an api key that comes from HTTP header named myHeader
Then you need to specify on the rest operations which security to use by referring to their key (petstore_auth or api_key).
.get("/{id}/{date}").description("Find user by id and date").outType(User.class)
.security("api_key")
...
.put().description("Updates or create a user").type(User.class)
.security("petstore_auth", "write:pets,read:pets")
.get("/{id}/{date}").description("Find user by id and date").outType(User.class)
.security("api_key")
...
.put().description("Updates or create a user").type(User.class)
.security("petstore_auth", "write:pets,read:pets")
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Here the get operation is using the Api Key security and the put operation is using OAuth security with permitted scopes of read and write pets.