Skip to content

Commit

Permalink
Replace jackson-core with vendored minimal-json
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mtdowling committed Mar 25, 2020
1 parent 19b9408 commit f285c92
Show file tree
Hide file tree
Showing 21 changed files with 1,638 additions and 331 deletions.
5 changes: 5 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ THIRD PARTY COMPONENTS

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

minimal-json
Copyright (c) 2013, 2014 EclipseSource
https://github.com/ralfstx/minimal-json/blob/master/LICENSE


Apache Commons Text
Copyright 2014-2018 The Apache Software Foundation

Expand Down
3 changes: 3 additions & 0 deletions config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<!-- Ignore "vendored" internal classes that have a different copyright. -->
<suppress checks="RegexpHeader" files="internal/*"/>

<suppress checks="EqualsHashCode" files="shapes/*"/>
<suppress checks="InnerAssignment" files="StringUtils"/>
<suppress checks="TypeName" files="AwsJson1_0Trait.java|AwsJson1_1Trait.java"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void writesJsonFiles() throws IOException {

assertThat(Files.isDirectory(outputDirectory.resolve("foo")), is(true));
assertThat(Files.isRegularFile(outputDirectory.resolve("foo/file.json")), is(true));
assertThat(new String(Files.readAllBytes(outputDirectory.resolve("foo/file.json"))), equalTo("{ }\n"));
assertThat(new String(Files.readAllBytes(outputDirectory.resolve("foo/file.json"))), equalTo("{}\n"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void throwsWithCorrectSyntaxErrorMessage() {
SmithyBuildConfig.load(Paths.get(getResourcePath("bad-syntax.json")));
});

assertThat(thrown.getMessage(), containsString("Error parsing file"));
assertThat(thrown.getMessage(), containsString("Error parsing"));
}

@Test
Expand Down
1 change: 0 additions & 1 deletion smithy-model/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ extra["moduleName"] = "software.amazon.smithy.model"

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

This file was deleted.

This file was deleted.

Loading

0 comments on commit f285c92

Please sign in to comment.