Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 436b1b4

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 436b1b4

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

‎jsonschema-hyperschema.xml‎

Lines changed: 46 additions & 1 deletion
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:someone@example.com{?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)

AltStyle によって変換されたページ (->オリジナル) /