Skip to content
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ insert_final_newline = true
indent_style = space
indent_size = 4

[*.{yml,yaml,sh,json}]
[*.{yml,yaml,sh,json,md}]
indent_size = 2
76 changes: 76 additions & 0 deletions json-utils/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>de.sonallux.spotify</groupId>
<artifactId>spotify-web-api-parent</artifactId>
<version>2021.10.17</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>json-utils</artifactId>
<version>2021.10.17</version>
<packaging>jar</packaging>

<name>json-utils</name>
<description>Utility functions for working with JSON and YAML</description>
<url>https://github.com/sonallux/spotify-web-api</url>

<properties>
<jsonpath.version>2.6.0</jsonpath.version>

<moditect.module.name>de.sonallux.spotify.json</moditect.module.name>
</properties>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${jsonpath.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito-junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

public class PatchException extends Exception {
public PatchException(String message) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.JsonNode;
Expand All @@ -22,7 +22,7 @@
@JsonSubTypes.Type(name = "test", value = TestOperation.class)
})
@AllArgsConstructor(access = AccessLevel.PROTECTED)
abstract class PatchOperation {
public abstract class PatchOperation {

protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
8 changes: 8 additions & 0 deletions json-utils/src/moditect/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module de.sonallux.json {
requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;
requires com.jayway.jsonpath;
requires static lombok;

exports de.sonallux.json;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.core.type.TypeReference;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -38,7 +38,7 @@ static Stream<Arguments> testOperationThrowsError() {

@ParameterizedTest
@MethodSource
void testOperationThrowsError(OperationTestData.FailureTestCase<AddOperation> testCase) throws Exception {
void testOperationThrowsError(OperationTestData.FailureTestCase<AddOperation> testCase) {
assertPatchThrowsError(testCase);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.core.type.TypeReference;
import org.junit.jupiter.api.BeforeAll;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.databind.JsonNode;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.core.type.TypeReference;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -38,7 +38,7 @@ static Stream<Arguments> testOperationThrowsError() {

@ParameterizedTest
@MethodSource
void testOperationThrowsError(OperationTestData.FailureTestCase<PutOperation> testCase) throws Exception {
void testOperationThrowsError(OperationTestData.FailureTestCase<PutOperation> testCase) {
assertPatchThrowsError(testCase);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.core.type.TypeReference;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -37,7 +37,7 @@ static Stream<Arguments> testOperationThrowsError() {

@ParameterizedTest
@MethodSource
void testOperationThrowsError(OperationTestData.FailureTestCase<RenameOperation> testCase) throws Exception {
void testOperationThrowsError(OperationTestData.FailureTestCase<RenameOperation> testCase) {
assertPatchThrowsError(testCase);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.core.type.TypeReference;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -38,7 +38,7 @@ static Stream<Arguments> testOperationThrowsError() {

@ParameterizedTest
@MethodSource
void testOperationThrowsError(OperationTestData.FailureTestCase<SetOperation> testCase) throws Exception {
void testOperationThrowsError(OperationTestData.FailureTestCase<SetOperation> testCase) {
assertPatchThrowsError(testCase);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.sonallux.spotify.parser.patching;
package de.sonallux.json.patching;

import com.fasterxml.jackson.core.type.TypeReference;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -38,7 +38,7 @@ static Stream<Arguments> testOperationThrowsError() {

@ParameterizedTest
@MethodSource
void testOperationThrowsError(OperationTestData.FailureTestCase<TestOperation> testCase) throws Exception {
void testOperationThrowsError(OperationTestData.FailureTestCase<TestOperation> testCase) {
assertPatchThrowsError(testCase);
}

Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<module>spotify-web-api-core</module>
<module>spotify-web-api-generator-open-api</module>
<module>spotify-web-api-parser</module>
<module>json-utils</module>
</modules>

<licenses>
Expand Down
15 changes: 5 additions & 10 deletions spotify-web-api-parser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

<properties>
<jsoup.version>1.14.3</jsoup.version>
<jsonpath.version>2.6.0</jsonpath.version>

<moditect.module.name>de.sonallux.spotify.parser</moditect.module.name>
</properties>
Expand All @@ -32,6 +31,11 @@
<artifactId>spotify-web-api-core</artifactId>
<version>2021.10.17</version>
</dependency>
<dependency>
<groupId>de.sonallux.spotify</groupId>
<artifactId>json-utils</artifactId>
<version>2021.10.17</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
Expand All @@ -41,15 +45,6 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${jsonpath.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import de.sonallux.spotify.core.Yaml;
import de.sonallux.spotify.core.model.SpotifyWebApi;
import de.sonallux.spotify.parser.patching.Patch;
import de.sonallux.spotify.parser.patching.PatchException;
import de.sonallux.json.patching.Patch;
import de.sonallux.json.patching.PatchException;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
Expand Down
1 change: 1 addition & 0 deletions spotify-web-api-parser/src/moditect/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
requires org.slf4j;
requires org.jsoup;
requires de.sonallux.spotify.core;
requires de.sonallux.json;
requires static lombok;

exports de.sonallux.spotify.parser;
Expand Down