Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split up smithy-aws-traits package for more granular versioning #322

Merged
merged 2 commits into from
Mar 24, 2020
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: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
rootProject.name = "smithy"
include(":smithy-aws-iam-traits")
include(":smithy-aws-traits")
include(":smithy-aws-apigateway-traits")
include(":smithy-aws-apigateway-openapi")
include(":smithy-aws-protocol-tests")
include(":smithy-cli")
Expand Down
4 changes: 1 addition & 3 deletions smithy-aws-apigateway-openapi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ extra["displayName"] = "Smithy :: Amazon API Gateway OpenAPI Support"
extra["moduleName"] = "software.amazon.smithy.aws.apigateway.openapi"

dependencies {
api(project(":smithy-model"))
api(project(":smithy-utils"))
api(project(":smithy-openapi"))
api(project(":smithy-aws-traits"))
api(project(":smithy-aws-apigateway-traits"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package software.amazon.smithy.aws.apigateway.openapi;

import java.util.logging.Logger;
import software.amazon.smithy.aws.traits.apigateway.ApiKeySourceTrait;
import software.amazon.smithy.aws.apigateway.traits.ApiKeySourceTrait;
import software.amazon.smithy.model.traits.Trait;
import software.amazon.smithy.openapi.fromsmithy.Context;
import software.amazon.smithy.openapi.fromsmithy.OpenApiMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import software.amazon.smithy.aws.traits.apigateway.AuthorizerDefinition;
import software.amazon.smithy.aws.traits.apigateway.AuthorizerIndex;
import software.amazon.smithy.aws.traits.apigateway.AuthorizerTrait;
import software.amazon.smithy.aws.traits.apigateway.AuthorizersTrait;
import software.amazon.smithy.aws.apigateway.traits.AuthorizerDefinition;
import software.amazon.smithy.aws.apigateway.traits.AuthorizerIndex;
import software.amazon.smithy.aws.apigateway.traits.AuthorizerTrait;
import software.amazon.smithy.aws.apigateway.traits.AuthorizersTrait;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.model.node.ObjectNode;
import software.amazon.smithy.model.shapes.ServiceShape;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import java.util.TreeSet;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import software.amazon.smithy.aws.traits.apigateway.IntegrationResponse;
import software.amazon.smithy.aws.traits.apigateway.MockIntegrationTrait;
import software.amazon.smithy.aws.apigateway.traits.IntegrationResponse;
import software.amazon.smithy.aws.apigateway.traits.MockIntegrationTrait;
import software.amazon.smithy.jsonschema.Schema;
import software.amazon.smithy.model.node.ObjectNode;
import software.amazon.smithy.model.traits.CorsTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import java.util.Set;
import java.util.TreeSet;
import java.util.logging.Logger;
import software.amazon.smithy.aws.traits.apigateway.IntegrationTrait;
import software.amazon.smithy.aws.traits.apigateway.IntegrationTraitIndex;
import software.amazon.smithy.aws.traits.apigateway.MockIntegrationTrait;
import software.amazon.smithy.aws.apigateway.traits.IntegrationTrait;
import software.amazon.smithy.aws.apigateway.traits.IntegrationTraitIndex;
import software.amazon.smithy.aws.apigateway.traits.MockIntegrationTrait;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.model.node.ObjectNode;
import software.amazon.smithy.model.shapes.OperationShape;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import software.amazon.smithy.aws.traits.apigateway.RequestValidatorTrait;
import software.amazon.smithy.aws.apigateway.traits.RequestValidatorTrait;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.model.node.ObjectNode;
import software.amazon.smithy.model.shapes.OperationShape;
Expand Down
4 changes: 4 additions & 0 deletions smithy-aws-apigateway-traits/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Smithy AWS API Gateway traits

See the [Smithy specification](https://awslabs.github.io/smithy/spec/)
for details on how these traits are used.
22 changes: 22 additions & 0 deletions smithy-aws-apigateway-traits/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

description = "This module provides Smithy traits and validators for API Gateway."
extra["displayName"] = "Smithy :: AWS :: API Gateway Traits"
extra["moduleName"] = "software.amazon.smithy.aws.apigateway.traits"

dependencies {
api(project(":smithy-aws-traits"))
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import software.amazon.smithy.model.FromSourceLocation;
import software.amazon.smithy.model.SourceLocation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import java.util.List;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import software.amazon.smithy.model.SourceLocation;
import software.amazon.smithy.model.shapes.ShapeId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import java.util.Comparator;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import java.util.HashMap;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import software.amazon.smithy.model.FromSourceLocation;
import software.amazon.smithy.model.SourceLocation;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
software.amazon.smithy.aws.apigateway.traits.AuthorizerTrait$Provider
software.amazon.smithy.aws.apigateway.traits.AuthorizersTrait$Provider
software.amazon.smithy.aws.apigateway.traits.RequestValidatorTrait$Provider
software.amazon.smithy.aws.apigateway.traits.ApiKeySourceTrait$Provider
software.amazon.smithy.aws.apigateway.traits.IntegrationTrait$Provider
software.amazon.smithy.aws.apigateway.traits.MockIntegrationTrait$Provider
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
software.amazon.smithy.aws.apigateway.traits.AuthorizersTraitValidator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aws.apigateway.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,13 +13,12 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import org.junit.jupiter.api.Test;
import software.amazon.smithy.aws.traits.TestRunnerTest;
import software.amazon.smithy.model.Model;
import software.amazon.smithy.model.shapes.ShapeId;

Expand Down Expand Up @@ -47,7 +46,7 @@ public void loadsValidTrait() {
public void loadsTraitFromModel() {
Model model = Model.assembler()
.discoverModels(getClass().getClassLoader())
.addImport(TestRunnerTest.class.getResource("errorfiles/apigateway/valid-integration.json"))
.addImport(TestRunnerTest.class.getResource("errorfiles/valid-integration.json"))
.assemble()
.unwrap();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package software.amazon.smithy.aws.traits.apigateway;
package software.amazon.smithy.aws.apigateway.traits;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package software.amazon.smithy.aws.apigateway.traits;

import java.util.concurrent.Callable;
import java.util.stream.Stream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import software.amazon.smithy.model.validation.testrunner.SmithyTestCase;
import software.amazon.smithy.model.validation.testrunner.SmithyTestSuite;

public class TestRunnerTest {
@ParameterizedTest(name = "{0}")
@MethodSource("source")
public void testRunner(String filename, Callable<SmithyTestCase.Result> callable) throws Exception {
callable.call();
}

public static Stream<?> source() {
return SmithyTestSuite.defaultParameterizedTestSource(TestRunnerTest.class);
}
}
Loading