Browse Source

Merge pull request #15655 from dashevchenko/arraySchemaImpr

[OpenApi] Fixed openapi descriptions for arrays
pull/15669/head
Viacheslav Klimov 4 months ago
committed by GitHub
parent
commit
ec834819b3
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      common/data/src/main/java/org/thingsboard/server/common/data/ai/dto/TbUserMessage.java
  2. 12
      common/data/src/main/java/org/thingsboard/server/common/data/query/AvailableEntityKeys.java
  3. 14
      common/data/src/main/java/org/thingsboard/server/common/data/query/AvailableEntityKeysV2.java
  4. 3
      common/data/src/main/java/org/thingsboard/server/common/data/sync/ie/WidgetsBundleExportData.java

10
common/data/src/main/java/org/thingsboard/server/common/data/ai/dto/TbUserMessage.java

@ -25,12 +25,10 @@ import java.util.List;
public record TbUserMessage(
@NotEmpty
@Valid
@ArraySchema(
arraySchema = @Schema(
requiredMode = Schema.RequiredMode.REQUIRED,
description = "A list of content parts that make up the complete user prompt"
),
schema = @Schema(ref = "#/components/schemas/TbContent")
@Schema(
requiredMode = Schema.RequiredMode.REQUIRED,
description = "A list of content parts that make up the complete user prompt"
)
@ArraySchema(schema = @Schema(ref = "#/components/schemas/TbContent"))
List<TbContent> contents
) {}

12
common/data/src/main/java/org/thingsboard/server/common/data/query/AvailableEntityKeys.java

@ -37,17 +37,21 @@ public record AvailableEntityKeys(
)
Set<EntityType> entityTypes,
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(
requiredMode = Schema.RequiredMode.REQUIRED,
description = "List of unique time series key names available on the matched entities."
)
@ArraySchema(
arraySchema = @Schema(description = "List of unique time series key names available on the matched entities."),
schema = @Schema(implementation = String.class, example = "temperature"),
uniqueItems = true
)
List<String> timeseries,
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(
requiredMode = Schema.RequiredMode.REQUIRED,
description = "List of unique attribute key names available on the matched entities."
)
@ArraySchema(
arraySchema = @Schema(description = "List of unique attribute key names available on the matched entities."),
schema = @Schema(implementation = String.class, example = "serialNumber"),
uniqueItems = true
)

14
common/data/src/main/java/org/thingsboard/server/common/data/query/AvailableEntityKeysV2.java

@ -41,15 +41,13 @@ public record AvailableEntityKeysV2(
)
Set<EntityType> entityTypes,
@ArraySchema(
arraySchema = @Schema(
description = """
List of unique time series keys available on the matched entities, sorted alphabetically.
Omitted when timeseries keys were not requested.""",
nullable = true
),
schema = @Schema(implementation = KeyInfo.class)
@Schema(
description = """
List of unique time series keys available on the matched entities, sorted alphabetically.
Omitted when timeseries keys were not requested.""",
nullable = true
)
@ArraySchema(schema = @Schema(implementation = KeyInfo.class))
@Nullable List<KeyInfo> timeseries,
@Schema(

3
common/data/src/main/java/org/thingsboard/server/common/data/sync/ie/WidgetsBundleExportData.java

@ -36,7 +36,8 @@ public class WidgetsBundleExportData extends EntityExportData<WidgetsBundle> {
@Override
public EntityType getEntityType() { return EntityType.WIDGETS_BUNDLE; }
@ArraySchema(arraySchema = @Schema(description = "List of widgets in the bundle"), schema = @Schema(implementation = JsonNode.class))
@Schema(description = "List of widgets in the bundle")
@ArraySchema(schema = @Schema(implementation = JsonNode.class))
@JsonProperty(index = 3)
private List<ObjectNode> widgets;

Loading…
Cancel
Save