Validation discrepancy between classpath model and imported model
See original GitHub issueWhen using the smithy-gradle-plugin
to build/validate a model, if that model is pulled in via the classpath by existing in a model/
directory, then the validation errors for that model are different than if that model is explicitly imported via the smithy-build.json
file.
Here’s an example minimal model that should produce a DANGER
error (it doesn’t like teapots, unless something changes due to #1386):
$version: "1.0"
namespace aws.protocoltests.misc
use aws.protocols#restJson1
use smithy.test#httpRequestTests
use smithy.test#httpResponseTests
@restJson1
service MiscService {
operations: [ResponseCodeRequiredOperation],
}
@http(method: "GET", uri: "/responseCodeRequiredOperation", code: 418)
operation ResponseCodeRequiredOperation {
input: EmptyStructure,
output: ResponseCodeRequiredOutput,
}
structure EmptyStructure {}
@output
structure ResponseCodeRequiredOutput {
@required
@httpResponseCode
responseCode: Integer,
}
This model, if pulled in by existing in the models/
directory, emits a WARN
due to the IDL version being 1, but does not emit the DANGER
message. If instead, it is placed outside the models/
directory and referenced directly from the imports
section of smithy-build.json
, then the DANGER
message is emitted and the build fails.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Correct the classpath of your application so that it contains ...
I tried removing some dependencies but that didn't help. import javax.persistence.*; import java.util.Date; import javax.validation.constraints.
Read more >Chapter 2. Validation step by step - Red Hat on GitHub
In this section we show how to annotate an object model with these annotations. We have to differentiate between three different type of...
Read more >How the JVM Locates, Loads, and Runs Libraries - Oracle Blogs
A better practice is to resolve the confusion at its root and figure out why there are multiple classes with the same name...
Read more >24. Externalized Configuration - Spring
Spring Boot allows you to externalize your configuration so you can work with the same application code in different environments. You can use...
Read more >Upgrading your build from Gradle 6.x to the latest
Alternatively, you could run gradle help --warning-mode=all to see the ... projects imported into Eclipse include the compile and runtime classpath for ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok thanks for checking. One thing that I did see when trying to repro this is that the output was weird and interleaving text across threads (due to the use of PrintStream instead of PrintWriter). This PR will fix that https://github.com/awslabs/smithy/pull/1525. I’ll go ahead and resolve this, but let me know if you ever see it again.
I’m not able to repro this anymore in smithy-rs with Smithy 1.26.2.