question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom operation filters

See original GitHub issue

Is your feature request related to a problem? Please describe. We have little library for api versioning that generates custom RequestCondition depending on special annotation. So we can write controllers like this:

@RestController
public class Controller {
    @Versioner(till = 0)
    @GetMapping("/test")
    public String old() {
        return "old";
    }

    @Versioner(from = 1)
    @GetMapping("/test")
    public Integer other() {
        return 123;
    }
}

Then GET /v0/test returns "old" and GET /v1/test returns 123

Now we need openapi to produce 2 groups: group v0 with GET /test endpoint that produces String and group v1 with GET /test endpoint that produces Integer

Describe the solution you’d like Something like addCustomFilter in GroupedOpenApi.Builder where I can use handlerMethod.getMethodAnnotation(Versioner.class) to determine, if this method should be displayed in this group

Describe alternatives you’ve considered

  • I have tried to filter paths in OpenApiCustomiser, but when it is called, there is already only one endpoint because the others have been overwritten here due to identical operationPath (/test)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelkrogcommented, Jul 30, 2021

@romash1408 Did you find a solution for this?

I have been trying for 2 days now to make springdoc filter out the right controllers for the specific (version) groups but havent succeeded yet. It always seem to have merged methods from multiple versioned controllers into the same operations before I can get to them with OpenApiCustomizer because they have the same path and signature.

1reaction
romash1408commented, Jan 20, 2021

@Hidden annotation don’t let me filter operation only in certain groups. I need to select operations for group depending on my custom annotation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DevExtreme - JavaScript Filter Builder Custom Operations
Configures custom filter operations. ... Specifies a function that returns a filter expression for this custom operation.
Read more >
Using custom filters to filter events - BMC Documentation
To perform operations on custom filters · From the Events action menu, select View Saved Filters . The list of saved custom filters...
Read more >
Creating a custom filter control | Dynamics 365 for Finance ...
Filtering forms in Dynamics 365 for Finance and Operations is implemented in a ... In this recipe, we will learn how to add...
Read more >
Custom Filters - WCF - Microsoft Learn
Custom filters allow you to define matching logic that cannot be accomplished using the system-provided message filters.
Read more >
Creating a custom filter control - Dynamics 365 for ... - O'Reilly
Creating a custom filter control Filtering forms in Dynamics 365 for Finance and Operations is implemented in a variety of ways.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found