GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Include Nonnull annotation from Jakarta Annotations for required items · swagger-api/swagger-core@67626df

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • modules/swagger-core/src
    • main/java/io/swagger/v3/core/jackson
      • ModelResolver.java
    • test/java/io/swagger/v3/core
      • oas/models
        • BeanValidationsModel.java
      • resolving
        • BeanValidatorTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java‎

Copy file name to clipboardExpand all lines: modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ protected boolean applyBeanValidatorAnnotations(Schema property, Annotation[] an
17411741

17421742
if (parent != null &&
17431743
Arrays.stream(annotations).anyMatch(
1744-
annotation -> annotation.annotationType().getSimpleName().equals("NonNull"))) {
1744+
annotation -> annotation.annotationType().getSimpleName().equalsIgnoreCase("NonNull"))) {
17451745
modified = updateRequiredItem(parent, property.getName()) || modified;
17461746

17471747
}
Collapse file

‎modules/swagger-core/src/test/java/io/swagger/v3/core/oas/models/BeanValidationsModel.java‎

Copy file name to clipboardExpand all lines: modules/swagger-core/src/test/java/io/swagger/v3/core/oas/models/BeanValidationsModel.java
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.swagger.v3.core.oas.models;
22

3+
import javax.annotation.Nonnull;
34
import javax.validation.constraints.DecimalMax;
45
import javax.validation.constraints.DecimalMin;
56
import javax.validation.constraints.Email;
@@ -20,6 +21,7 @@ public class BeanValidationsModel {
2021
protected Integer age;
2122

2223
@Pattern(regexp = "(?![-._])[-._a-zA-Z0-9]{3,32}")
24+
@Nonnull
2325
protected String username;
2426

2527
@Size(min = 6, max = 20)
Collapse file

‎modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/BeanValidatorTest.java‎

Copy file name to clipboardExpand all lines: modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/BeanValidatorTest.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public void readBeanValidatorTest() {
2525
final Map<String, Schema> properties = model.getProperties();
2626

2727
assertTrue(model.getRequired().contains("id"));
28+
assertTrue(model.getRequired().contains("username"));
2829

2930
final StringSchema username = (StringSchema) properties.get("username");
3031
assertEquals((String) username.getPattern(), "(?![-._])[-._a-zA-Z0-9]{3,32}");

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.