-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1087 from disneystreaming/namespace-keywords
escape keywords in namespaces
- Loading branch information
Showing
10 changed files
with
78 additions
and
5 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
15 changes: 15 additions & 0 deletions
15
modules/bootstrapped/src/generated/smithy4s/example/_package/MyPackageString.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,15 @@ | ||
package smithy4s.example._package | ||
|
||
import smithy4s.Hints | ||
import smithy4s.Newtype | ||
import smithy4s.Schema | ||
import smithy4s.ShapeId | ||
import smithy4s.schema.Schema.bijection | ||
import smithy4s.schema.Schema.string | ||
|
||
object MyPackageString extends Newtype[String] { | ||
val id: ShapeId = ShapeId("smithy4s.example.package", "MyPackageString") | ||
val hints: Hints = Hints.empty | ||
val underlyingSchema: Schema[String] = string.withId(id).addHints(hints) | ||
implicit val schema: Schema[MyPackageString] = bijection(underlyingSchema, asBijection) | ||
} |
7 changes: 7 additions & 0 deletions
7
modules/bootstrapped/src/generated/smithy4s/example/_package/package.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,7 @@ | ||
package smithy4s.example | ||
|
||
package object _package { | ||
|
||
type MyPackageString = smithy4s.example._package.MyPackageString.Type | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...s/bootstrapped/src/generated/smithy4s/example/collision/TestReservedNamespaceImport.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,21 @@ | ||
package smithy4s.example.collision | ||
|
||
import smithy4s.Hints | ||
import smithy4s.Schema | ||
import smithy4s.ShapeId | ||
import smithy4s.ShapeTag | ||
import smithy4s.example._package.MyPackageString | ||
import smithy4s.schema.Schema.struct | ||
|
||
final case class TestReservedNamespaceImport(_package: Option[MyPackageString] = None) | ||
object TestReservedNamespaceImport extends ShapeTag.Companion[TestReservedNamespaceImport] { | ||
val id: ShapeId = ShapeId("smithy4s.example.collision", "TestReservedNamespaceImport") | ||
|
||
val hints: Hints = Hints.empty | ||
|
||
implicit val schema: Schema[TestReservedNamespaceImport] = struct( | ||
MyPackageString.schema.optional[TestReservedNamespaceImport]("package", _._package), | ||
){ | ||
TestReservedNamespaceImport.apply | ||
}.withId(id).addHints(hints) | ||
} |
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,10 @@ | ||
import React from 'react'; | ||
import SearchBar from '@theme-original/SearchBar'; | ||
|
||
export default function SearchBarWrapper(props) { | ||
return ( | ||
<> | ||
<SearchBar {...props} /> | ||
</> | ||
); | ||
} |
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,5 @@ | ||
$version: "2.0" | ||
|
||
namespace smithy4s.example.package | ||
|
||
string MyPackageString |
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