Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support schema.requiredMode on ParameterObject #2200

Closed
uc4w6c opened this issue Apr 8, 2023 · 0 comments
Closed

Support schema.requiredMode on ParameterObject #2200

uc4w6c opened this issue Apr 8, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@uc4w6c
Copy link
Collaborator

uc4w6c commented Apr 8, 2023

If you ❤️ this project consider becoming a sponsor.
If you already use the springdoc-openapi, please do not forget adding a github star to this repository.

Is your feature request related to a problem? Please describe.

I want to use schema.requiredMode on ParameterObject too.

example

  @GetMapping
  public String index(@ParameterObject Request request) {
    return null;
  }

  record Request(
      @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
      String id
  ) {}

current

"parameters": [
	{
		"name": "id",
		"in": "query",
		"required": false,
		"schema": {
			"type": "string"
		}
	}
],

expected

"parameters": [
	{
		"name": "id",
		"in": "query",
		"required": true,
		"schema": {
			"type": "string"
		}
	}
],

Describe the solution you'd like

Same as above

Describe alternatives you've considered

  • A clear and concise description of any alternative solutions or features you've
    considered.

Additional context

  • Add any other context or screenshots about the feature request here.
uc4w6c added a commit to uc4w6c/springdoc-openapi that referenced this issue Apr 8, 2023
uc4w6c added a commit to uc4w6c/springdoc-openapi that referenced this issue Apr 8, 2023
@bnasslahsen bnasslahsen added the enhancement New feature or request label Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants