Skip to content

Conversation

@SentryMan
Copy link
Collaborator

  • change @OpenAPIResponse to work on classes
  • if defined on a class all the routes in the class will have the definition added to the openapi
  • make interface-level roles inheritable.

Now instead of doing:

public class MyController {

  @OpenAPIResponse(
    responseCode = "403",
    description = "Insufficient rights to this resource."
  )
  @Get("/some-authenticated-route")
  public Object getObject(...) { ... }

  @OpenAPIResponse(
    responseCode = "403",
    description = "Insufficient rights to this resource."
  )
  @Get("/another-authenticated-route")
  public Object getObject2(...) { ... }
}

We can do this:

  @OpenAPIResponse(
    responseCode = "403",
    description = "Insufficient rights to this resource."
  )
public class MyController {

  @Get("/some-authenticated-route")
  public Object getObject(...) { ... }

  @Get("/another-authenticated-route")
  public Object getObject2(...) { ... }
}

@rbygrave rbygrave added this to the 1.26 milestone Feb 6, 2023
@rbygrave rbygrave merged commit 24825b2 into avaje:master Feb 6, 2023
@SentryMan SentryMan deleted the inherit-roles branch February 6, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants