Skip to content

Commit

Permalink
Add Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-adam committed Apr 4, 2024
1 parent 5def87a commit b153a67
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/kotlin/pl/writeonly/omnibus/config/Config.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package pl.writeonly.omnibus.config

import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.databind.ObjectMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Configuration

@Configuration
class Config {

@Autowired
private lateinit var objectMapper: ObjectMapper

fun customizeObjectMapper() {
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL)
}
}
1 change: 1 addition & 0 deletions src/main/resources/data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO post(id, title, content) VALUES (1, 'Test post 1', 'Content1');
5 changes: 5 additions & 0 deletions src/main/resources/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE post (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(400) NOT NULL,
content VARCHAR(2000) NULL
);

0 comments on commit b153a67

Please sign in to comment.