Skip to content

Commit

Permalink
Correctly include toteutustyyppi
Browse files Browse the repository at this point in the history
Toteutustyyppi was not serialized in JSON response when creating/updating
a koulutus.

Need to update Jackson to a newer version, because there was a bug with previous version
related to @JsonTypeInfo serialization.

See more: FasterXML/jackson-databind#528
  • Loading branch information
alexGofore committed Feb 16, 2016
1 parent 5e45792 commit dd2483d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tarjonta-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.2.3</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.2.3</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.2.3</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeId;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;
Expand All @@ -38,7 +37,7 @@
* @author jwilen
*/
@ApiModel(value = "Koulutuksien yleiset tiedot sisältävä rajapintaolio")
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "toteutustyyppi")
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "toteutustyyppi", include = JsonTypeInfo.As.EXISTING_PROPERTY)
@JsonSubTypes({
@Type(value = AmmattitutkintoV1RDTO.class, name = "AMMATTITUTKINTO"),
@Type(value = ErikoisammattitutkintoV1RDTO.class, name = "ERIKOISAMMATTITUTKINTO"),
Expand All @@ -63,7 +62,6 @@
public abstract class KoulutusV1RDTO extends KoulutusmoduuliStandardRelationV1RDTO {

@ApiModelProperty(value = "Koulutuksen toteutuksen tarkasti yksiloiva enumeraatio", required = true)
@JsonTypeId
private ToteutustyyppiEnum toteutustyyppi;

@ApiModelProperty(value = "Koulutusmoduulin karkeasti yksilöivä enumeraatio", required = true)
Expand Down
6 changes: 3 additions & 3 deletions tarjonta-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -529,17 +529,17 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.2.3</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.2.3</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.2.3</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
Expand Down

0 comments on commit dd2483d

Please sign in to comment.