-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix rendering of schemas for structures of arity > 22 * Create camel case names from enum values when they don't have names * Add logic to render enum names in worst case scenario Adds logic to create a correct Scala name for enum values, when the values of the enumeration are purely symbolic.
- Loading branch information
Showing
11 changed files
with
227 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2021 Disney Streaming | ||
* | ||
* Licensed under the Tomorrow Open Source Technology License, Version 1.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://disneystreaming.github.io/TOST-1.0.txt | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License 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. | ||
*/ | ||
|
||
package smithy4s | ||
|
||
import weaver._ | ||
|
||
object BigStructSmokeSpec extends FunSuite { | ||
|
||
test("Big structures do have a schema") { | ||
val expected = | ||
"struct23(a1: int, a2: int, a3: int, a4: int, a5: int, a6: int, a7: int, a8: int, a9: int, a10: int, a11: int, a12: int, a13: int, a14: int, a15: int, a16: int, a17: int, a18: int, a19: int, a20: int, a21: int, a22: int, a23: int)" | ||
val schemaRepr = smithy4s.example.BigStruct.schema.compile(SchematicRepr) | ||
expect(schemaRepr == expected) | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
modules/core/test/src/smithy4s/EnumWithSymbolsSmokeSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2021 Disney Streaming | ||
* | ||
* Licensed under the Tomorrow Open Source Technology License, Version 1.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://disneystreaming.github.io/TOST-1.0.txt | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License 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. | ||
*/ | ||
|
||
package smithy4s | ||
|
||
import weaver._ | ||
|
||
object EnumWithSymbolsSmokeSpec extends FunSuite { | ||
|
||
test( | ||
"Camel case names are issued from enum values when they don't have names" | ||
) { | ||
val values = smithy4s.example.EnumWithSymbols.values | ||
val expected = List( | ||
smithy4s.example.EnumWithSymbols.FooFooFoo, | ||
smithy4s.example.EnumWithSymbols.BarBarBar, | ||
smithy4s.example.EnumWithSymbols.Value2 | ||
) | ||
expect(values == expected) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
namespace smithy4s.example | ||
|
||
service EmptyService { | ||
version: "1.0" | ||
} | ||
|
||
structure BigStruct{ | ||
@required | ||
a1: Integer, | ||
@required | ||
a2: Integer, | ||
@required | ||
a3: Integer, | ||
@required | ||
a4: Integer, | ||
@required | ||
a5: Integer, | ||
@required | ||
a6: Integer, | ||
@required | ||
a7: Integer, | ||
@required | ||
a8: Integer, | ||
@required | ||
a9: Integer, | ||
@required | ||
a10: Integer, | ||
@required | ||
a11: Integer, | ||
@required | ||
a12: Integer, | ||
@required | ||
a13: Integer, | ||
@required | ||
a14: Integer, | ||
@required | ||
a15: Integer, | ||
@required | ||
a16: Integer, | ||
@required | ||
a17: Integer, | ||
@required | ||
a18: Integer, | ||
@required | ||
a19: Integer, | ||
@required | ||
a20: Integer, | ||
@required | ||
a21: Integer, | ||
@required | ||
a22: Integer, | ||
@required | ||
a23: Integer | ||
} | ||
|
||
@enum([ | ||
{value: "foo:foo:foo"}, | ||
{value: "bar:bar:bar"}, | ||
{value: "_"}, | ||
]) | ||
string EnumWithSymbols |