Comments (3)
Hi @YeJiaL, According to best practices, it is recommended to define all possible query parameters for a particular endpoint at the same level. To do this, you can use the @RequestParam annotation with the name attribute set to the name of the query parameter and required attribute set to false for each parameter.
By doing this, the Swagger UI will automatically detect the query parameters and generate the user interface accordingly.
@GetMapping(path = "items")
@ApiOperation(value = "Find items by name or description", response = ItemSearchResponse.class)
public ResponseEntity<?> searchItemsByName(@RequestParam("name", required=false) String name, @RequestParam("description", required=false) String description) {
// add checks for the case when query params were not sent in the api call
// you can use Objects.isNull(name)
}
from springfox.
@geetnsh2k1 when i use @GetMapping(params="key1=value1") on method ,and set enableUrlTemplating true, when i open the swagger UI ,i cannot test the urlMethod from the UI,becasuse the method has the additional param like xxx) .
jsut like picture show ,it has namespaceid)=""
from springfox.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from springfox.
Related Issues (20)
- how to fix the problem? HOT 1
- Type javax.servlet.http.HttpServletRequest not present HOT 4
- Swagger ui updated to from 2.8.0 to 3.0.0 .But previous endpoints not working HOT 1
- springfox.documentation.swagger2.web.WebMvcBasePathAndHostnameTransformationFilter imports javax.servlet.http.HttpServletRequest HOT 2
- Unable to infer base url. HOT 1
- Is this project still alive? or is there any plan to release a new version HOT 3
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
- Bump Swagger UI Dependency to latest
- springfox-swagger-ui/-boot-starter not found
- WebMvcRequestHandlerProvider should not use @Component HOT 1
- How to add common headers using spring fox 3
- swagger2+nginx reports 404 problem when accessing swagger
- When there are 20,000 controllers, the startup time exceeds two hours.
- Can we use springfox with springboot 3.1.4?? Or any version of springfox is compatible with springboot 3.1.4 HOT 2
- Any springfox version compatible with springboot 3???? HOT 4
- Swagger UI not Showing Map<String, Object> myField ?
- Description of ResponseHeader is blank
- The launch is just around the corner HOT 3
- Need similar way for Open API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from springfox.