Skip to content

Commit f285c92

Browse files
committed
Replace jackson-core with vendored minimal-json
This commit removes our dependency on jackson-core and replaces it with a vendored and slightly modified version of minimal-json. Reducing dependencies on popular projects like Jackson make it easier to use Smithy in large, heterogenous environments like large corporate build systems. minimal-json is vendored into smithy-model to allow Nodes to be parsed and serialized from JSON documents. The major change that was added to minimal-json was to allow skipping over optional "//" line comments.
1 parent 19b9408 commit f285c92

File tree

21 files changed

+1638
-331
lines changed

21 files changed

+1638
-331
lines changed

NOTICE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ THIRD PARTY COMPONENTS
77

88
This software includes third party software subject to the following copyrights.
99

10+
minimal-json
11+
Copyright (c) 2013, 2014 EclipseSource
12+
https://github.com/ralfstx/minimal-json/blob/master/LICENSE
13+
14+
1015
Apache Commons Text
1116
Copyright 2014-2018 The Apache Software Foundation
1217

config/checkstyle/suppressions.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
1919
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
2020
<suppressions>
21+
<!-- Ignore "vendored" internal classes that have a different copyright. -->
22+
<suppress checks="RegexpHeader" files="internal/*"/>
23+
2124
<suppress checks="EqualsHashCode" files="shapes/*"/>
2225
<suppress checks="InnerAssignment" files="StringUtils"/>
2326
<suppress checks="TypeName" files="AwsJson1_0Trait.java|AwsJson1_1Trait.java"/>

smithy-build/src/test/java/software/amazon/smithy/build/FileManifestTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void writesJsonFiles() throws IOException {
8888

8989
assertThat(Files.isDirectory(outputDirectory.resolve("foo")), is(true));
9090
assertThat(Files.isRegularFile(outputDirectory.resolve("foo/file.json")), is(true));
91-
assertThat(new String(Files.readAllBytes(outputDirectory.resolve("foo/file.json"))), equalTo("{ }\n"));
91+
assertThat(new String(Files.readAllBytes(outputDirectory.resolve("foo/file.json"))), equalTo("{}\n"));
9292
}
9393

9494
@Test

smithy-build/src/test/java/software/amazon/smithy/build/model/SmithyBuildConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void throwsWithCorrectSyntaxErrorMessage() {
5050
SmithyBuildConfig.load(Paths.get(getResourcePath("bad-syntax.json")));
5151
});
5252

53-
assertThat(thrown.getMessage(), containsString("Error parsing file"));
53+
assertThat(thrown.getMessage(), containsString("Error parsing"));
5454
}
5555

5656
@Test

smithy-model/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ extra["moduleName"] = "software.amazon.smithy.model"
2020

2121
dependencies {
2222
api(project(":smithy-utils"))
23-
implementation("com.fasterxml.jackson.core:jackson-core:2.9.8")
2423
}

smithy-model/src/main/java/software/amazon/smithy/model/node/DefaultNodeFactory.java

Lines changed: 0 additions & 143 deletions
This file was deleted.

smithy-model/src/main/java/software/amazon/smithy/model/node/DefaultNodeWriter.java

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)