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.

@Parameter 'required' property is always ignored

See original GitHub issue

Code example:

@GetMapping(produces = [MediaType.APPLICATION_JSON_VALUE])
    fun getOrders(
        @RequestLimit @Parameter(name = "limit", required = false) limit: Int?,
        @RequestOffset @Parameter(required = false) offset: Int,
        @HeaderUserId userId: UUID,
        @HeaderVisitorId visitorId: UUID
    )

But always parameter marks as ‘required’ in ui and json schema

Снимок экрана 2019-12-11 в 14 54 35

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
bnasslahsencommented, May 14, 2020

Hi @little-fish,

For Pageable, are you declaring using ?

  • @ParameterObject Pageable pageable
1reaction
glockbendercommented, Dec 12, 2019

@springdoc Its really correct behaviour. But why @Parameter annotation data ignored? As i understood, swagger-annotations used for implicit declaration or overriding default parser behaviour. If this concept ignored, the usefulness of this library tends to zero. As you see in my code snippet, used my own parameter annotations. This an important case to override default request parameter handling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring 2nd RequestParam always ignored [closed]
I have a HTTP Get Method, in which I'd like to pass two request parameters. While the first parameter is passed perfectly fine,...
Read more >
Using Optional and Nullable Properties in API Requests
Learn how optional and nullable properties can be used flexibly in combinations in each parameter of your API requests made from a SDK....
Read more >
Set Configuration Parameters for Model Hierarchies
Configuration parameter values can be different in top models and referenced models.
Read more >
Parameters - Snowflake Documentation
All the parameters have default values, which can be set and then overridden at different levels depending on the parameter type (Account, Session,...
Read more >
Analysis parameters - SonarQube Documentation
gitignore , will automatically be ignored by analysis too. Set this property to true to disable that feature. SCM exclusions are always disabled...
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