Skip to content

Commit e06c358

Browse files
committed
Add non-http "method": "post" LDO example
Add an example showing how a non-HTTP URI scheme can be used, showing a form for constructing an email with two different representations, as well as requiring a subject.
1 parent d3c75a8 commit e06c358

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

jsonschema-hyperschema.xml

+46-1
Original file line numberDiff line numberDiff line change
@@ -918,9 +918,54 @@ GET /foo/
918918
]]>
919919
</artwork>
920920
</figure>
921-
921+
</t>
922+
<t>
922923
If the method is "post", "application/json" is the default media type.
923924
</t>
925+
<t>
926+
As noted under <xref target="method">method</xref>, these fields
927+
are not restricted to HTTP URIs.
928+
929+
<figure>
930+
<preamble>
931+
For example, this link indicates that if you want to
932+
send an email to the author of the context resource,
933+
your client needs to ask for both a plain text
934+
and an HTML representation.
935+
</preamble>
936+
<artwork>
937+
<![CDATA[{
938+
"links": [{
939+
"encType": "multipart/alternative; boundary=abc123",
940+
"method": "post",
941+
"rel": "author",
942+
"href": "mailto:[email protected]{?subject}",
943+
"hrefSchema": {
944+
"type": "object",
945+
"properties": {
946+
"subject": { "type": "string" }
947+
},
948+
"required": ["subject"]
949+
},
950+
"schema": {
951+
"type": "array",
952+
"items": [
953+
{
954+
"type": "string",
955+
"media": { "type": "text/plain; charset=utf8" }
956+
},
957+
{
958+
"type": "string",
959+
"media": { "type": "text/html" }
960+
}
961+
],
962+
"minItems": 2
963+
}
964+
}]
965+
}]]>
966+
</artwork>
967+
</figure>
968+
</t>
924969
</section>
925970

926971
<section title="schema" anchor="schema">

0 commit comments

Comments
 (0)