-
Notifications
You must be signed in to change notification settings - Fork 6
Implement Typed Documents and TypeRegistry #282
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: decaf
Are you sure you want to change the base?
Conversation
module Smithy | ||
module Schema | ||
# A Smithy document type, representing typed or untyped data from Smithy data model. | ||
# ## Document types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could add more details (e.g. code examples) but I might punt that to the Smithy-Ruby Wiki instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in-code examples/documentation are preferred but it doesn't have to be done this moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea - I'd agree examples and more detail would be better as in code documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add them now - since information is very fresh in my head.
Description: Implementation for Typed Documents and TypeRegistry. Currently only supports JSON documents.
Customer Experience
Customer can instantiate a Document by using standard Ruby objects as its foundation:
Customers can instantiate a Document with a runtime shape and its schema:
When a runtime shape is used to create a Document, we capture the absolute shape id from its schema.
Customers can reconstruct the runtime shape of a document by using
as_typed
method with a shape schema:Customers can use the TypeRegistry to find schema based on shape id:
Remaining ToDos
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.