From d6d5c64c32a6e928a2e2d5ed0169319190c4f919 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 10 Nov 2026 16:53:36 +0200 Subject: [PATCH 1/2] Fixed REST API documentation of fields that can be null Fields that the server sends as null were documented as required, so generated clients (Dart in particular) failed to parse such responses. They are now NOT_REQUIRED. Bean validation on save is unchanged. swagger-core skips @NotNull for a property with @Schema(requiredMode = NOT_REQUIRED), but still adds the ones with @NotBlank / @NotEmpty to 'required'; SwaggerConfiguration now removes them. --- .../server/config/SwaggerConfiguration.java | 43 +++++++++++++++++++ .../server/common/data/ShortEntityView.java | 2 +- .../common/data/agent/AgentApplication.java | 2 +- .../DashboardReportConfig.java | 4 +- .../server/common/data/edge/Edge.java | 2 +- .../data/objects/AttributesEntityView.java | 6 +-- .../data/objects/TelemetryEntityView.java | 2 +- .../data/permission/GroupPermission.java | 2 +- .../server/common/data/report/Report.java | 1 + .../components/ReportComponent.java | 2 +- .../common/data/rule/RuleChainMetaData.java | 6 +-- .../account/BackupCodeTwoFaAccountConfig.java | 1 + .../mfa/account/SmsTwoFaAccountConfig.java | 1 + 13 files changed, 60 insertions(+), 14 deletions(-) diff --git a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java index 397461a26f..34419db6fe 100644 --- a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java +++ b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java @@ -112,6 +112,7 @@ public class SwaggerConfiguration { // Keyed by the schema name that swagger-core generates (see resolveSchemaName). private final Map> schemaPropertyOrders = new ConcurrentHashMap<>(); private final Map> schemaOwnProps = new ConcurrentHashMap<>(); + private final Map> schemaNotRequiredProps = new ConcurrentHashMap<>(); // Tracks schema name → fully-qualified class names to detect collisions. private final Map> schemaNameToClasses = new ConcurrentHashMap<>(); @@ -386,6 +387,10 @@ public class SwaggerConfiguration { if (!ownProps.isEmpty()) { schemaOwnProps.put(schemaName, ownProps); } + Set notRequiredProps = computeNotRequiredPropNames(beanDesc); + if (!notRequiredProps.isEmpty()) { + schemaNotRequiredProps.put(schemaName, notRequiredProps); + } } catch (Exception e) { log.debug("Failed to resolve property order for {}: {}", cls.getName(), e.getMessage()); } @@ -573,6 +578,13 @@ public class SwaggerConfiguration { deduplicateAllOfProperties(schema, schemas, ownProps); }); + // Honour an explicit @Schema(requiredMode = NOT_REQUIRED): swagger-core skips @NotNull + // for such properties, but still adds the ones with @NotBlank / @NotEmpty to 'required'. + schemas.forEach((schemaName, schema) -> { + Set notRequiredProps = schemaNotRequiredProps.getOrDefault(schemaName, Set.of()); + removeRequiredProperties(schema, notRequiredProps); + }); + // Reorder properties for all component schemas. This runs after all // schemas are finalized so it covers schemas the ModelConverter only // saw as a $ref (e.g. interface-based discriminator types like EntityId). @@ -1157,6 +1169,37 @@ public class SwaggerConfiguration { return own; } + private static Set computeNotRequiredPropNames(com.fasterxml.jackson.databind.BeanDescription beanDesc) { + Set notRequired = new LinkedHashSet<>(); + for (var prop : beanDesc.findProperties()) { + var member = prop.getPrimaryMember(); + if (member == null) continue; + var schemaAnnotation = member.getAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); + if (schemaAnnotation != null && schemaAnnotation.requiredMode() == io.swagger.v3.oas.annotations.media.Schema.RequiredMode.NOT_REQUIRED) { + notRequired.add(prop.getName()); + } + } + return notRequired; + } + + private static void removeRequiredProperties(Schema schema, Set notRequiredProps) { + if (notRequiredProps.isEmpty()) { + return; + } + List schemas = new ArrayList<>(); + schemas.add(schema); + if (schema.getAllOf() != null) { + schemas.addAll(schema.getAllOf()); + } + for (Schema s : schemas) { + if (s.getRequired() != null && s.getRequired().stream().anyMatch(notRequiredProps::contains)) { + List required = new ArrayList<>(s.getRequired()); + required.removeAll(notRequiredProps); + s.setRequired(required.isEmpty() ? null : required); + } + } + } + @SuppressWarnings("unchecked") private static void reorderSchemaProperties(Schema schema, List propOrder) { if (schema.getProperties() != null && schema.getProperties().size() > 1) { diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/ShortEntityView.java b/common/data/src/main/java/org/thingsboard/server/common/data/ShortEntityView.java index d77ef72e96..217e5b2f77 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/ShortEntityView.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/ShortEntityView.java @@ -47,7 +47,7 @@ public class ShortEntityView implements HasId, HasName { this.properties.put(name, value); } - @Schema(description = "Name of the entity", requiredMode = Schema.RequiredMode.REQUIRED, accessMode = Schema.AccessMode.READ_ONLY) + @Schema(description = "Name of the entity", requiredMode = Schema.RequiredMode.NOT_REQUIRED, accessMode = Schema.AccessMode.READ_ONLY) @Override @JsonProperty(access = JsonProperty.Access.READ_ONLY) public String getName() { diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/agent/AgentApplication.java b/common/data/src/main/java/org/thingsboard/server/common/data/agent/AgentApplication.java index 6e85bd55fa..abde33104d 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/agent/AgentApplication.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/agent/AgentApplication.java @@ -126,7 +126,7 @@ public class AgentApplication extends BaseData implements Ha return config; } - @Schema(description = "Template version this application is based on", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "Template version this application is based on", requiredMode = Schema.RequiredMode.NOT_REQUIRED) public String getTemplateVersion() { return templateVersion; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/dashboardreport/DashboardReportConfig.java b/common/data/src/main/java/org/thingsboard/server/common/data/dashboardreport/DashboardReportConfig.java index 7e558d04bc..ab9e917b53 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/dashboardreport/DashboardReportConfig.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/dashboardreport/DashboardReportConfig.java @@ -21,13 +21,13 @@ public class DashboardReportConfig { boolean useDashboardTimewindow; @Schema(description = "Specific dashboard timewindow that will be used during dashboard report generation.") JsonNode timewindow; - @Schema(description = "If set, timewindow configured in the target dashboard will be used during dashboard report generation.", example = "report-%d{yyyy-MM-dd_HH:mm:ss}", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "If set, timewindow configured in the target dashboard will be used during dashboard report generation.", example = "report-%d{yyyy-MM-dd_HH:mm:ss}", requiredMode = Schema.RequiredMode.NOT_REQUIRED) String namePattern; @Schema(description = "Dashboard report file type, can be PDF | PNG | JPEG.", example = "pdf") String type; @Schema(description = "If set, credentials of user created this dashboard report configuration will be used to open dashboard UI during dashboard report generation.", example = "true") boolean useCurrentUserCredentials; - @Schema(description = "A string value representing the user id.", example = "784f394c-42b6-435a-983c-b7beff2784f9", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "A string value representing the user id.", example = "784f394c-42b6-435a-983c-b7beff2784f9", requiredMode = Schema.RequiredMode.NOT_REQUIRED) String userId; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/edge/Edge.java b/common/data/src/main/java/org/thingsboard/server/common/data/edge/Edge.java index 3105f6a881..6447aef178 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/edge/Edge.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/edge/Edge.java @@ -155,7 +155,7 @@ public class Edge extends BaseDataWithAdditionalInfo return this.secret; } - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Edge license key obtained from license portal", example = "AgcnI24Z06XC&m6Sxsdgf") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Edge license key obtained from license portal", example = "AgcnI24Z06XC&m6Sxsdgf") public String getEdgeLicenseKey() { return this.edgeLicenseKey; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/objects/AttributesEntityView.java b/common/data/src/main/java/org/thingsboard/server/common/data/objects/AttributesEntityView.java index 207f2dc5d7..920c1f7b7d 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/objects/AttributesEntityView.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/objects/AttributesEntityView.java @@ -18,11 +18,11 @@ import java.util.List; @NoArgsConstructor public class AttributesEntityView implements Serializable { - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of client-side attribute keys to expose", example = "[\"currentConfiguration\"]") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of client-side attribute keys to expose", example = "[\"currentConfiguration\"]") private List cs = new ArrayList<>(); - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of server-side attribute keys to expose", example = "[\"model\"]") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of server-side attribute keys to expose", example = "[\"model\"]") private List ss = new ArrayList<>(); - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of shared attribute keys to expose", example = "[\"targetConfiguration\"]") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of shared attribute keys to expose", example = "[\"targetConfiguration\"]") private List sh = new ArrayList<>(); public AttributesEntityView(List cs, diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/objects/TelemetryEntityView.java b/common/data/src/main/java/org/thingsboard/server/common/data/objects/TelemetryEntityView.java index cebd335437..79ac34251f 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/objects/TelemetryEntityView.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/objects/TelemetryEntityView.java @@ -18,7 +18,7 @@ import java.util.List; @NoArgsConstructor public class TelemetryEntityView implements Serializable { - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of time-series data keys to expose", example = "[\"temperature\", \"humidity\"]") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of time-series data keys to expose", example = "[\"temperature\", \"humidity\"]") private List timeseries; @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with attributes to expose") private AttributesEntityView attributes; diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/permission/GroupPermission.java b/common/data/src/main/java/org/thingsboard/server/common/data/permission/GroupPermission.java index 2968492322..332cc3024f 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/permission/GroupPermission.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/permission/GroupPermission.java @@ -84,7 +84,7 @@ public class GroupPermission extends BaseData implements HasN private TenantId tenantId; @Schema(description = "JSON object with the User Group Id. Represents the user group that will have permissions to perform operations against the corresponding entity group.", - requiredMode = Schema.RequiredMode.REQUIRED) + requiredMode = Schema.RequiredMode.NOT_REQUIRED) private EntityGroupId userGroupId; @Schema(description = "JSON object with the Role Id. Represents the set of permissions. " + "The role type (GENERIC or GROUP) determines whether 'entityGroupId' is required.", diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/report/Report.java b/common/data/src/main/java/org/thingsboard/server/common/data/report/Report.java index 8d0d32e3ec..e84cb29d3b 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/report/Report.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/report/Report.java @@ -32,6 +32,7 @@ public class Report extends BaseData implements HasName, TenantEntity, @NotNull private TenantId tenantId; private CustomerId customerId; + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) @NotNull private ReportTemplateId templateId; @NotNull diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/report/configuration/components/ReportComponent.java b/common/data/src/main/java/org/thingsboard/server/common/data/report/configuration/components/ReportComponent.java index 824b5e2fb2..be2b97586a 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/report/configuration/components/ReportComponent.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/report/configuration/components/ReportComponent.java @@ -56,7 +56,7 @@ public interface ReportComponent extends Serializable { @Schema(requiredMode = Schema.RequiredMode.REQUIRED) ReportComponentType getType(); - @Schema(requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) ReportComponentSubType getSubType(); } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainMetaData.java b/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainMetaData.java index 7e4fb74839..6bb4efeb97 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainMetaData.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainMetaData.java @@ -24,16 +24,16 @@ public class RuleChainMetaData implements HasVersion { @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Version of the Rule Chain") private Long version; - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Index of the first rule node in the 'nodes' list") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Index of the first rule node in the 'nodes' list") private Integer firstNodeIndex; @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of rule node JSON objects") private List nodes; - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of JSON objects that represent connections between rule nodes") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of JSON objects that represent connections between rule nodes") private List connections; - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of JSON objects that represent connections between rule nodes and other rule chains.") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of JSON objects that represent connections between rule nodes and other rule chains.") private List ruleChainConnections; @JsonInclude(JsonInclude.Include.NON_EMPTY) diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/model/mfa/account/BackupCodeTwoFaAccountConfig.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/model/mfa/account/BackupCodeTwoFaAccountConfig.java index 79d4c35428..76b3c5d510 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/security/model/mfa/account/BackupCodeTwoFaAccountConfig.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/model/mfa/account/BackupCodeTwoFaAccountConfig.java @@ -16,6 +16,7 @@ import java.util.Set; @EqualsAndHashCode(callSuper = true) public class BackupCodeTwoFaAccountConfig extends TwoFaAccountConfig { + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) @NotEmpty private Set codes; diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/model/mfa/account/SmsTwoFaAccountConfig.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/model/mfa/account/SmsTwoFaAccountConfig.java index 5ff3715fde..23c50beb70 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/security/model/mfa/account/SmsTwoFaAccountConfig.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/model/mfa/account/SmsTwoFaAccountConfig.java @@ -14,6 +14,7 @@ import org.thingsboard.server.common.data.security.model.mfa.provider.TwoFaProvi @Data public class SmsTwoFaAccountConfig extends OtpBasedTwoFaAccountConfig { + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) @NotBlank @Pattern(regexp = "^\\+[1-9]\\d{1,14}$", message = "is not of E.164 format") private String phoneNumber; From 637e682e3427a40c4d4c279dbb5c94a8af360bae Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 10 Nov 2026 17:42:12 +0200 Subject: [PATCH 2/2] Added test for removing NOT_REQUIRED properties from OpenAPI required Also fixed the description of DashboardReportConfig.namePattern. --- .../server/config/SwaggerConfiguration.java | 16 +++-- .../config/SwaggerConfigurationTest.java | 65 +++++++++++++++++++ .../DashboardReportConfig.java | 2 +- 3 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 application/src/test/java/org/thingsboard/server/config/SwaggerConfigurationTest.java diff --git a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java index 34419db6fe..b3e79c092d 100644 --- a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java +++ b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java @@ -578,12 +578,7 @@ public class SwaggerConfiguration { deduplicateAllOfProperties(schema, schemas, ownProps); }); - // Honour an explicit @Schema(requiredMode = NOT_REQUIRED): swagger-core skips @NotNull - // for such properties, but still adds the ones with @NotBlank / @NotEmpty to 'required'. - schemas.forEach((schemaName, schema) -> { - Set notRequiredProps = schemaNotRequiredProps.getOrDefault(schemaName, Set.of()); - removeRequiredProperties(schema, notRequiredProps); - }); + removeNotRequiredProperties(schemas); // Reorder properties for all component schemas. This runs after all // schemas are finalized so it covers schemas the ModelConverter only @@ -1169,6 +1164,15 @@ public class SwaggerConfiguration { return own; } + // Honour an explicit @Schema(requiredMode = NOT_REQUIRED): swagger-core skips @NotNull + // for such properties, but still adds the ones with @NotBlank / @NotEmpty to 'required'. + void removeNotRequiredProperties(Map schemas) { + schemas.forEach((schemaName, schema) -> { + Set notRequiredProps = schemaNotRequiredProps.getOrDefault(schemaName, Set.of()); + removeRequiredProperties(schema, notRequiredProps); + }); + } + private static Set computeNotRequiredPropNames(com.fasterxml.jackson.databind.BeanDescription beanDesc) { Set notRequired = new LinkedHashSet<>(); for (var prop : beanDesc.findProperties()) { diff --git a/application/src/test/java/org/thingsboard/server/config/SwaggerConfigurationTest.java b/application/src/test/java/org/thingsboard/server/config/SwaggerConfigurationTest.java new file mode 100644 index 0000000000..859d361849 --- /dev/null +++ b/application/src/test/java/org/thingsboard/server/config/SwaggerConfigurationTest.java @@ -0,0 +1,65 @@ +// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: BUSL-1.1 +package org.thingsboard.server.config; + +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverters; +import io.swagger.v3.oas.models.media.Schema; +import org.junit.jupiter.api.Test; +import org.thingsboard.server.common.data.edge.EdgeInfo; +import org.thingsboard.server.common.data.report.Report; +import org.thingsboard.server.common.data.rule.RuleChainMetaData; +import org.thingsboard.server.common.data.security.model.mfa.account.TwoFaAccountConfig; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import static org.assertj.core.api.Assertions.assertThat; + +public class SwaggerConfigurationTest { + + @Test + public void testNotRequiredPropertiesAreRemovedFromRequired() { + SwaggerConfiguration config = new SwaggerConfiguration(); + // Local instance: the converter is not registered in the global ModelConverters singleton. + ModelConverters converters = new ModelConverters(true); + converters.addConverter(config.mapAwareConverter()); + + Map schemas = new HashMap<>(); + // Resolving the polymorphic parent produces the subtypes as allOf schemas. + for (Class cls : new Class[]{TwoFaAccountConfig.class, RuleChainMetaData.class, EdgeInfo.class, Report.class}) { + schemas.putAll(converters.readAll(new AnnotatedType(cls))); + } + + config.removeNotRequiredProperties(schemas); + + // @NotBlank / @NotEmpty + @Schema(requiredMode = NOT_REQUIRED) + assertThat(requiredOf(schemas.get("SmsTwoFaAccountConfig"))).doesNotContain("phoneNumber"); + assertThat(requiredOf(schemas.get("BackupCodeTwoFaAccountConfig"))).doesNotContain("codes"); + // @NotNull + @Schema(requiredMode = NOT_REQUIRED) + assertThat(requiredOf(schemas.get("Report"))).doesNotContain("templateId").contains("name"); + assertThat(requiredOf(schemas.get("RuleChainMetaData"))) + .doesNotContain("firstNodeIndex", "connections", "ruleChainConnections") + .contains("nodes"); + assertThat(requiredOf(schemas.get("EdgeInfo"))).doesNotContain("edgeLicenseKey").contains("name"); + } + + private static Set requiredOf(Schema schema) { + assertThat(schema).isNotNull(); + Set required = new HashSet<>(); + if (schema.getRequired() != null) { + required.addAll(schema.getRequired()); + } + if (schema.getAllOf() != null) { + for (Schema part : schema.getAllOf()) { + if (part.getRequired() != null) { + required.addAll(part.getRequired()); + } + } + } + return required; + } + +} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/dashboardreport/DashboardReportConfig.java b/common/data/src/main/java/org/thingsboard/server/common/data/dashboardreport/DashboardReportConfig.java index ab9e917b53..baba266328 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/dashboardreport/DashboardReportConfig.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/dashboardreport/DashboardReportConfig.java @@ -21,7 +21,7 @@ public class DashboardReportConfig { boolean useDashboardTimewindow; @Schema(description = "Specific dashboard timewindow that will be used during dashboard report generation.") JsonNode timewindow; - @Schema(description = "If set, timewindow configured in the target dashboard will be used during dashboard report generation.", example = "report-%d{yyyy-MM-dd_HH:mm:ss}", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Pattern of the generated report file name. '%d{}' is replaced with the report generation time formatted in the report timezone. If not set, 'report-%d{yyyy-MM-dd_HH:mm:ss}' is used.", example = "report-%d{yyyy-MM-dd_HH:mm:ss}", requiredMode = Schema.RequiredMode.NOT_REQUIRED) String namePattern; @Schema(description = "Dashboard report file type, can be PDF | PNG | JPEG.", example = "pdf") String type;