Skip to content

Commit

Permalink
Fix ordering of json structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaar, Bjørn-Andre committed Jan 15, 2024
1 parent 75c9e6e commit bd880ec
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.util.List;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.springframework.hateoas.Link;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
Expand All @@ -17,6 +18,7 @@
import no.ssb.klass.api.controllers.ClassificationController;

@JacksonXmlRootElement(localName = "classificationFamily")
@JsonPropertyOrder({"name", "classifications", "links"})
public class ClassificationFamilyResource extends KlassResource {
private final String name;
private final List<ClassificationSummaryResource> classifications;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package no.ssb.klass.api.dto.hal;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
Expand All @@ -18,6 +19,9 @@
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;

@JacksonXmlRootElement(localName = "classification")
@JsonPropertyOrder({"name", "classificationType", "lastModified", "description", "primaryLanguage","copyrighted",
"includeShortName", "includeNotes", "contactPerson", "owningSection", "statisticalUnits", "versions",
"links"})
public class ClassificationResource extends ClassificationSummaryResource {
private final String description;
private final String primaryLanguage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
Expand All @@ -14,6 +15,9 @@
import no.ssb.klass.api.util.CustomLocalDateSerializer;

@JacksonXmlRootElement(localName = "classificationVariant")
@JsonPropertyOrder({"name", "contactPerson", "owningSection", "lastModified", "published", "validFrom", "validTo",
"introduction", "contactPerson", "owningSection", "correspondenceTables", "changelogs", "levels",
"classificationItems", "links"})
public class ClassificationVariantResource extends ClassificationVariantSummaryResource {
private final LocalDate validFrom;
private final LocalDate validTo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;
import java.util.stream.Collectors;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
Expand All @@ -15,6 +16,10 @@
import no.ssb.klass.core.util.AlphaNumericalComparator;

@JacksonXmlRootElement(localName = "classificationVersion")
@JsonPropertyOrder({"name", "validFrom", "validTo", "lastModified", "published", "introduction", "contactPerson",
"owningSection", "legalBase", "publications", "derivedFrom", "correspondenceTables", "classificationVariants",
"changelogs", "levels", "classificationItems", "links"})

public class ClassificationVersionResource extends ClassificationVersionSummaryResource {
private final String introduction;
private final ContactPersonResource contactPerson;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
Expand All @@ -10,6 +11,8 @@
import no.ssb.klass.core.model.Language;

@JacksonXmlRootElement(localName = "correspondenceTable")
@JsonPropertyOrder({"name", "contactPerson", "owningSection", "source", "sourceId", "target", "targetId", "changeTable",
"lastModified", "published", "links"})
public class CorrespondenceTableResource extends CorrespondenceTableSummaryResource {
private final String description;
private final List<ChangelogResource> changelogs;
Expand Down

0 comments on commit bd880ec

Please sign in to comment.