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

Updated Proposed change to the model attribute #38

Open
wants to merge 1 commit into
base: template-proposal
Choose a base branch
from
Open
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
10 changes: 8 additions & 2 deletions proposals/uber-templates-mca.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,21 @@ The +url+ property MAY contain a URI Template. Client applications MUST treat th
----

=== Change the +model+ Property
The +model+ property only describes at payload (not a URL). If a client application sees a +model+ property, the client MUST use that as a guide for creating a payload. The +model+ still uses RFC570 (URI Template).
The +model+ property defines expected field names contained in a payload of the default type x-www-form-urlencoded by listing the valid names to include into the request body. If a client application sees a +model+ property, the client MUST use that as a guide for creating a payload. The +model+ no longer uses RFC570 (URI Template), but is only a list of names.

If a +model+ property is present, a possible template MUST NOT contain a body property.

If the mime type of the request is not x-www-form-urlencoded but +sending+ defines other structured data formats, there SHOULD be templates available for all mimetypes defined by the +sending+ property.

In the XML variant the list of field names appears as a space-separated list. In the JSON variant the list of media-type identifiers appears as an array.

.The +model+ property is applies only to the body
----
<!-- this UBER message... -->
<uber version="1.0">
<data rel="item"
url="http://example.org/1"
model="{givenname,familyname,hatsize}"
model="givenname familyname hatsize}"
action="idempotent">
<data name="givenName">Mike</data>
<data name="familyName">Amundsen</data>
Expand Down