Skip to content

Commit

Permalink
fix: add required metadata attributes when retrieving survey unit met…
Browse files Browse the repository at this point in the history
…adata (#253)
  • Loading branch information
davdarras authored Jun 18, 2024
1 parent af58eb6 commit 611f53f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<description>Modules for queen back-office</description>

<properties>
<revision>4.3.9</revision>
<revision>4.3.10</revision>
<changelist></changelist>
<java.version>21</java.version>
<maven.compiler.source>21</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package fr.insee.queen.application.surveyunit.dto.output;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

@Schema(name = "Logo")
public record LogoDto(
@NotNull
String url,
@NotNull
String label
) {
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package fr.insee.queen.application.surveyunit.dto.output;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.util.List;

@Schema(name = "Logos")
public record LogoDtos(
@NotNull
LogoDto main,
List<LogoDto> secondaries
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ public record MetadataDto(
String label,
String objectives
) {
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package fr.insee.queen.application.surveyunit.dto.output;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

@Schema(name = "MetadataVariable")
public record MetadataVariableDto(
@NotNull
String name,
// TODO: Bug with openapi 3.1 and springdoc. Uncomment this when problem solved
// https://github.com/springdoc/springdoc-openapi/issues/2608
//@Schema(description = "Variable value", oneOf = {String.class, Boolean.class})
@NotNull
Object value
) {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.insee.queen.application.surveyunit.dto.output;

import com.fasterxml.jackson.annotation.JsonValue;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NonNull;

Expand All @@ -12,6 +13,7 @@ public enum QuestionnaireContextDto {
BUSINESS("business");

@JsonValue
@NotNull
private final String label;

QuestionnaireContextDto(String label) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@
import fr.insee.queen.application.web.validation.json.SchemaType;
import fr.insee.queen.domain.surveyunit.model.SurveyUnitMetadata;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.util.List;

@Schema(name = "SurveyUnitMetadata")
@JsonInclude(JsonInclude.Include.NON_NULL)
public record SurveyUnitMetadataDto(
@NotNull
QuestionnaireContextDto context,
@Schema(ref = SchemaType.Names.PERSONALIZATION)
ArrayNode personalization,
@NotNull
String label,
@NotNull
String objectives,
List<MetadataVariableDto> variables,
LogoDtos logos
Expand Down

0 comments on commit 611f53f

Please sign in to comment.