Skip to content

Commit

Permalink
fix several readme examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisjkl committed Feb 1, 2024
1 parent 57110d3 commit face63d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1298,11 +1298,9 @@ structure Testing {

Proto:
```proto
import "google/protobuf/wrappers.proto";
message Testing {
google.protobuf.StringValue myString = 1;
google.protobuf.Int32Value myInt = 2;
string myString = 1;
int32 myInt = 2;
}
```

Expand Down Expand Up @@ -1476,8 +1474,6 @@ structure TestInput {

Proto:
```proto
import "google/protobuf/wrappers.proto";
service FooService {
rpc Test(foo.TestInput) returns (foo.Test200);
}
Expand All @@ -1487,7 +1483,7 @@ message InputBody {
}
message OutputBody {
google.protobuf.Int32Value sNum = 1;
int32 sNum = 1;
}
message Test200 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ object SmithyToProtoCompiler {
/** Transforms a smithy model into a list of protobuf files.
*/
def compile(smithyModel: Model): List[RenderedProtoFile] = {
val compiler = new internals.Compiler(smithyModel, allShapes = false)
compile(smithyModel, allShapes = false)
}

def compile(
smithyModel: Model,
allShapes: Boolean
): List[RenderedProtoFile] = {
val compiler = new internals.Compiler(smithyModel, allShapes)
compiler
.compile()
.map { compileOutput =>
Expand Down
2 changes: 1 addition & 1 deletion modules/readme-validator/src/Validator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ object Validator {
.unwrap()

val rendered = SmithyToProtoCompiler
.compile(inputModel)
.compile(inputModel, allShapes = true)
.filter(_.path.contains(namespace))
.map(_.contents)
.sorted
Expand Down

0 comments on commit face63d

Please sign in to comment.