Skip to content

Commit

Permalink
Merge pull request #95 from ConsumerDataStandardsAustralia/feature/94…
Browse files Browse the repository at this point in the history
…-do-not-serialise-null-fields

#94 fix a couple of issues
  • Loading branch information
fyang1024 authored Dec 5, 2019
2 parents 9e85795 + 129e561 commit 8603e85
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package au.org.consumerdatastandards.holder;

import com.fasterxml.jackson.databind.Module;

import au.org.consumerdatastandards.holder.util.SwaggerJacksonModuleRegistrar;

import com.fasterxml.jackson.databind.Module;
import org.h2.server.web.WebServlet;
import org.openapitools.jackson.nullable.JsonNullableModule;
import org.springframework.boot.CommandLineRunner;
Expand All @@ -16,9 +14,6 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.http.MediaType;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;

/**
Expand All @@ -33,8 +28,7 @@
"au.org.consumerdatastandards.holder.service",
"au.org.consumerdatastandards.holder.util",
})
@EnableWebSecurity
public class HolderApplication extends WebSecurityConfigurerAdapter implements CommandLineRunner {
public class HolderApplication implements CommandLineRunner {

public static void main(String[] args) {
new SpringApplication(HolderApplication.class).run(args);
Expand All @@ -47,11 +41,6 @@ public void run(String... arg0) {
}
}

@Override
protected void configure(HttpSecurity http) throws Exception {
http.anonymous().and().authorizeRequests().antMatchers("/").permitAll();
}

class ExitException extends RuntimeException implements ExitCodeGenerator {
private static final long serialVersionUID = 1L;

Expand Down
1 change: 1 addition & 0 deletions data-holder/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ spring.datasource.username=sa
spring.datasource.password=passw0rd
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
spring.jackson.default-property-inclusion=non_null

# MTLS settings
server.ssl.trust-store=keystore/truststore.jks
Expand Down
2 changes: 1 addition & 1 deletion data-holder/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</rollingPolicy>
</appender>

<root level="DEBUG">
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ public static ObjectMapper createObjectMapper() {
.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true)
.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true)
.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL);
.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL)
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
}

private static boolean isValueSpecified(Object relatedPropertyValue, String[] values) {
Expand Down

0 comments on commit 8603e85

Please sign in to comment.