Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include prelude in spec #1913

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 8 additions & 57 deletions docs/source-2.0/spec/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1250,67 +1250,18 @@ Prelude

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

.. code-block:: smithy
:caption: Public prelude shapes
.. literalinclude:: ../../../smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy
:language: smithy
:caption: Smithy Prelude
:name: prelude-shapes

$version: "2"
namespace smithy.api

string String

blob Blob

bigInteger BigInteger

bigDecimal BigDecimal

timestamp Timestamp

document Document

boolean Boolean

byte Byte

short Short

integer Integer

long Long

float Float

double Double

/// The single unit type shape, similar to Void and None in other
/// languages, used to represent no meaningful value.
@unitType
structure Unit {}

@default(false)
boolean PrimitiveBoolean

@default(0)
byte PrimitiveByte

@default(0)
short PrimitiveShort

@default(0)
integer PrimitiveInteger

@default(0)
long PrimitiveLong

@default(0)
float PrimitiveFloat
.. note::

@default(0)
double PrimitiveDouble
Private shapes defined in the prelude are subject to change at any time.


.. _unit-type:
Expand Down
Loading