Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore all the unknow fields #337

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed
- Bug when adding visualization layers to an empty layer list [#331](https://github.com/IN-CORE/incore-services/issues/331)
- Bug when posting additional fields which need to be ignored [#338](https://github.com/IN-CORE/incore-services/issues/338)

## [1.27.1] - 2024-11-01
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
Expand All @@ -29,8 +28,6 @@ public static Type fromString(String mappingType) {
private Type type = Type.fragility;
private String mappingType;

public Date date = new Date();

public String name;
public String hazardType;
public String inventoryType;
Expand Down Expand Up @@ -70,14 +67,6 @@ public void setType(Type type) {
this.type = type;
}

public void setDate(Date date) {
this.date = date;
}

public Date getDate() {
return date;
}

public void setName(String name) {
this.name = name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
* This is from NCSA's DataWolf
*/

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import dev.morphia.annotations.Embedded;

@Embedded
@JsonIgnoreProperties(ignoreUnknown = true)
public class FileDescriptor {
public static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import dev.morphia.annotations.Embedded;

@Embedded
@JsonIgnoreProperties(ignoreUnknown = true)
public class Layer {
private String workspace = "incore";
private String layerId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@

package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import dev.morphia.annotations.Embedded;

import java.util.HashMap;
import java.util.Map;

@Embedded
@JsonIgnoreProperties(ignoreUnknown = true)
public class Mapping {
public final Map<String, String> legacyEntry = new HashMap<>();
public final Map<String, String> entry = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@

package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.morphia.annotations.Embedded;

@Embedded
@JsonIgnoreProperties(ignoreUnknown = true)
public class MappingEntryKey {
public String name;
public String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@

package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import dev.morphia.annotations.Embedded;

@Embedded
@JsonIgnoreProperties(ignoreUnknown = true)
public class MappingEntryKeyConfig {
public String unit;
public String type;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import dev.morphia.annotations.Embedded;

@Embedded
@JsonIgnoreProperties(ignoreUnknown = true)
public class NetworkData {
private String dataType;
private String fileName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import dev.morphia.annotations.Embedded;

@Embedded
@JsonIgnoreProperties(ignoreUnknown = true)
public class NetworkDataset {
private NetworkData link;
private NetworkData node;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import dev.morphia.annotations.Entity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import dev.morphia.annotations.Embedded;
import edu.illinois.ncsa.incore.common.data.models.jackson.JsonDateSerializer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import dev.morphia.annotations.Embedded;

@Embedded
@JsonIgnoreProperties(ignoreUnknown = true)
public class WorkflowCreator {
public String id;
public boolean deleted;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package edu.illinois.ncsa.incore.service.project.models;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import edu.illinois.ncsa.incore.common.data.models.jackson.JsonDateSerializer;

import java.util.Date;
import java.util.List;
Expand All @@ -23,8 +24,7 @@ public enum Type {
public String title;
public String description;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "UTC")
public Date created;
public Date created = new Date();

public WorkflowCreator creator;
public List<String> contributors;
Expand All @@ -41,6 +41,7 @@ public void setType(WorkflowResource.Type type) {
this.type = type;
}

@JsonSerialize(using = JsonDateSerializer.class)
public Date getCreated() {
return created;
}
Expand Down
Loading