Skip to content

Commit 954dbb0

Browse files
committed
Include prelude in spec
Include the prelude in the spec by pulling in the prelude that's used in the reference implementation. Closes #489
1 parent 5f07c7f commit 954dbb0

File tree

2 files changed

+429
-350
lines changed

2 files changed

+429
-350
lines changed

docs/source-2.0/spec/model.rst

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,67 +1250,18 @@ Prelude
12501250

12511251
All Smithy models automatically include a *prelude*. The prelude defines
12521252
various simple shapes and every trait defined in the core specification.
1253-
When using the :ref:`IDL <idl>`, shapes defined in the prelude can be
1254-
referenced from within any namespace using a relative shape ID.
1253+
When using the :ref:`IDL <idl>`, shapes defined in the prelude that are not
1254+
marked with the :ref:`private-trait` can be referenced from within any
1255+
namespace using a relative shape ID.
12551256

1256-
.. code-block:: smithy
1257-
:caption: Public prelude shapes
1257+
.. literalinclude:: ../../../smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy
1258+
:language: smithy
1259+
:caption: Smithy Prelude
12581260
:name: prelude-shapes
12591261

1260-
$version: "2"
1261-
namespace smithy.api
1262-
1263-
string String
1264-
1265-
blob Blob
1266-
1267-
bigInteger BigInteger
1268-
1269-
bigDecimal BigDecimal
1270-
1271-
timestamp Timestamp
1272-
1273-
document Document
1274-
1275-
boolean Boolean
1276-
1277-
byte Byte
1278-
1279-
short Short
1280-
1281-
integer Integer
1282-
1283-
long Long
1284-
1285-
float Float
1286-
1287-
double Double
1288-
1289-
/// The single unit type shape, similar to Void and None in other
1290-
/// languages, used to represent no meaningful value.
1291-
@unitType
1292-
structure Unit {}
1293-
1294-
@default(false)
1295-
boolean PrimitiveBoolean
1296-
1297-
@default(0)
1298-
byte PrimitiveByte
1299-
1300-
@default(0)
1301-
short PrimitiveShort
1302-
1303-
@default(0)
1304-
integer PrimitiveInteger
1305-
1306-
@default(0)
1307-
long PrimitiveLong
1308-
1309-
@default(0)
1310-
float PrimitiveFloat
1262+
.. note::
13111263

1312-
@default(0)
1313-
double PrimitiveDouble
1264+
Private shapes defined in the prelude are subject to change at any time.
13141265

13151266

13161267
.. _unit-type:

0 commit comments

Comments
 (0)