Skip to content

Commit e42e74d

Browse files
committed
Auto-generated documentation from 50fe66f
1 parent 73e789c commit e42e74d

18 files changed

+1166
-26
lines changed

api/JsonApiDotNetCore.Configuration.ApplicationBuilderExtensions.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
8585

8686

8787
<h1 id="JsonApiDotNetCore_Configuration_ApplicationBuilderExtensions" data-uid="JsonApiDotNetCore.Configuration.ApplicationBuilderExtensions" class="text-break">
88-
Class ApplicationBuilderExtensions <a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs/#L7"><i class="bi bi-code-slash"></i></a>
88+
Class ApplicationBuilderExtensions <a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs/#L8"><i class="bi bi-code-slash"></i></a>
8989
</h1>
9090

9191
<div class="facts text-secondary">
@@ -152,7 +152,7 @@ <h2 class="section" id="methods">Methods
152152

153153
<h3 id="JsonApiDotNetCore_Configuration_ApplicationBuilderExtensions_UseJsonApi_Microsoft_AspNetCore_Builder_IApplicationBuilder_" data-uid="JsonApiDotNetCore.Configuration.ApplicationBuilderExtensions.UseJsonApi(Microsoft.AspNetCore.Builder.IApplicationBuilder)">
154154
UseJsonApi(IApplicationBuilder)
155-
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs/#L23"><i class="bi bi-code-slash"></i></a>
155+
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs/#L24"><i class="bi bi-code-slash"></i></a>
156156
</h3>
157157

158158
<div class="markdown level1 summary"><p>Registers the JsonApiDotNetCore middleware.</p>
@@ -191,7 +191,7 @@ <h4 class="section" id="JsonApiDotNetCore_Configuration_ApplicationBuilderExtens
191191
</article>
192192

193193
<div class="contribution d-print-none">
194-
<a href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs/#L7" class="edit-link">Edit this page</a>
194+
<a href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs/#L8" class="edit-link">Edit this page</a>
195195
</div>
196196

197197

api/JsonApiDotNetCore.Diagnostics.CodeTimingSessionManager.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h2 class="section" id="methods">Methods
223223

224224
<h3 id="JsonApiDotNetCore_Diagnostics_CodeTimingSessionManager_Capture_JsonApiDotNetCore_Diagnostics_ICodeTimerSession_" data-uid="JsonApiDotNetCore.Diagnostics.CodeTimingSessionManager.Capture(JsonApiDotNetCore.Diagnostics.ICodeTimerSession)">
225225
Capture(ICodeTimerSession)
226-
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Diagnostics/CodeTimingSessionManager.cs/#L63"><i class="bi bi-code-slash"></i></a>
226+
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Diagnostics/CodeTimingSessionManager.cs/#L69"><i class="bi bi-code-slash"></i></a>
227227
</h3>
228228

229229
<div class="markdown level1 summary"></div>

api/JsonApiDotNetCore.Serialization.Objects.JsonApiObject.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
8585

8686

8787
<h1 id="JsonApiDotNetCore_Serialization_Objects_JsonApiObject" data-uid="JsonApiDotNetCore.Serialization.Objects.JsonApiObject" class="text-break">
88-
Class JsonApiObject <a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs/#L9"><i class="bi bi-code-slash"></i></a>
88+
Class JsonApiObject <a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonapiObject.cs/#L9"><i class="bi bi-code-slash"></i></a>
8989
</h1>
9090

9191
<div class="facts text-secondary">
@@ -151,7 +151,7 @@ <h2 class="section" id="properties">Properties
151151

152152
<h3 id="JsonApiDotNetCore_Serialization_Objects_JsonApiObject_Ext" data-uid="JsonApiDotNetCore.Serialization.Objects.JsonApiObject.Ext">
153153
Ext
154-
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs/#L16"><i class="bi bi-code-slash"></i></a>
154+
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonapiObject.cs/#L16"><i class="bi bi-code-slash"></i></a>
155155
</h3>
156156

157157
<div class="markdown level1 summary"></div>
@@ -184,7 +184,7 @@ <h4 class="section">Property Value</h4>
184184

185185
<h3 id="JsonApiDotNetCore_Serialization_Objects_JsonApiObject_Meta" data-uid="JsonApiDotNetCore.Serialization.Objects.JsonApiObject.Meta">
186186
Meta
187-
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs/#L24"><i class="bi bi-code-slash"></i></a>
187+
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonapiObject.cs/#L24"><i class="bi bi-code-slash"></i></a>
188188
</h3>
189189

190190
<div class="markdown level1 summary"></div>
@@ -217,7 +217,7 @@ <h4 class="section">Property Value</h4>
217217

218218
<h3 id="JsonApiDotNetCore_Serialization_Objects_JsonApiObject_Profile" data-uid="JsonApiDotNetCore.Serialization.Objects.JsonApiObject.Profile">
219219
Profile
220-
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs/#L20"><i class="bi bi-code-slash"></i></a>
220+
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonapiObject.cs/#L20"><i class="bi bi-code-slash"></i></a>
221221
</h3>
222222

223223
<div class="markdown level1 summary"></div>
@@ -250,7 +250,7 @@ <h4 class="section">Property Value</h4>
250250

251251
<h3 id="JsonApiDotNetCore_Serialization_Objects_JsonApiObject_Version" data-uid="JsonApiDotNetCore.Serialization.Objects.JsonApiObject.Version">
252252
Version
253-
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs/#L12"><i class="bi bi-code-slash"></i></a>
253+
<a class="header-action link-secondary" title="View source" href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonapiObject.cs/#L12"><i class="bi bi-code-slash"></i></a>
254254
</h3>
255255

256256
<div class="markdown level1 summary"></div>
@@ -283,7 +283,7 @@ <h4 class="section">Property Value</h4>
283283
</article>
284284

285285
<div class="contribution d-print-none">
286-
<a href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs/#L9" class="edit-link">Edit this page</a>
286+
<a href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Objects/JsonapiObject.cs/#L9" class="edit-link">Edit this page</a>
287287
</div>
288288

289289

ext/openapi/index.html

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSON:API Extension for OpenAPI </title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta name="title" content="JSON:API Extension for OpenAPI ">
8+
9+
10+
<link rel="icon" href="../../favicon.ico">
11+
<link rel="stylesheet" href="../../public/docfx.min.css">
12+
<link rel="stylesheet" href="../../public/main.css">
13+
<meta name="docfx:navrel" content="../../toc.html">
14+
<meta name="docfx:tocrel" content="../../toc.html">
15+
16+
17+
18+
19+
<meta name="docfx:docurl" content="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/docs/ext/openapi/index.md/#L1">
20+
<meta name="loc:inThisArticle" content="In this article">
21+
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
22+
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
23+
<meta name="loc:tocFilter" content="Filter by title">
24+
<meta name="loc:nextArticle" content="Next">
25+
<meta name="loc:prevArticle" content="Previous">
26+
<meta name="loc:themeLight" content="Light">
27+
<meta name="loc:themeDark" content="Dark">
28+
<meta name="loc:themeAuto" content="Auto">
29+
<meta name="loc:changeTheme" content="Change theme">
30+
<meta name="loc:copy" content="Copy">
31+
<meta name="loc:downloadPdf" content="Download PDF">
32+
33+
<script type="module" src="./../../public/docfx.min.js"></script>
34+
35+
<script>
36+
const theme = localStorage.getItem('theme') || 'auto'
37+
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
38+
</script>
39+
40+
</head>
41+
42+
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
43+
<header class="bg-body border-bottom">
44+
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
45+
<div class="container-xxl flex-nowrap">
46+
<a class="navbar-brand" href="../../index.html">
47+
<img id="logo" class="svg" src="../../logo.svg" alt="">
48+
49+
</a>
50+
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
51+
<i class="bi bi-three-dots"></i>
52+
</button>
53+
<div class="collapse navbar-collapse" id="navpanel">
54+
<div id="navbar">
55+
</div>
56+
</div>
57+
</div>
58+
</nav>
59+
</header>
60+
61+
<main class="container-xxl">
62+
63+
<div class="content">
64+
<div class="actionbar">
65+
66+
<nav id="breadcrumb"></nav>
67+
</div>
68+
69+
<article data-uid="">
70+
<h1 id="jsonapi-extension-for-openapi">JSON:API Extension for OpenAPI</h1>
71+
72+
<p>This extension facilitates using OpenAPI client generators targeting JSON:API documents.</p>
73+
<p>In JSON:API, a resource object contains the <code>type</code> member, which defines the structure of nested <a href="https://jsonapi.org/format/#document-resource-object-attributes">attributes</a> and <a href="https://jsonapi.org/format/#document-resource-object-relationships">relationships</a> objects.
74+
While OpenAPI supports such constraints using <code>allOf</code> inheritance with a discriminator property for the <code>data</code> member,
75+
it provides no way to express that the discriminator recursively applies to nested objects.</p>
76+
<p>This extension addresses that limitation by defining additional discriminator properties to guide code generation tools.</p>
77+
<h2 id="uri">URI</h2>
78+
<p>This extension has the URI <code>https://www.jsonapi.net/ext/openapi</code>.
79+
Because code generators often choke on the double quotes in <code>Accept</code> and <code>Content-Type</code> HTTP header values, a relaxed form is also permitted: <code>openapi</code>.</p>
80+
<p>For example, the following <code>Content-Type</code> header:</p>
81+
<pre><code class="lang-http">Content-Type: application/vnd.api+json; ext=&quot;https://www.jsonapi.net/ext/openapi&quot;
82+
</code></pre>
83+
<p>is equivalent to:</p>
84+
<pre><code class="lang-http">Content-Type: application/vnd.api+json; ext=openapi
85+
</code></pre>
86+
<p>To avoid the need for double quotes when multiple extensions are used, the following relaxed form can be used:</p>
87+
<pre><code class="lang-http">Content-Type: application/vnd.api+json; ext=openapi; ext=atomic
88+
</code></pre>
89+
<div class="NOTE">
90+
<h5>Note</h5>
91+
<p>The <a href="https://jsonapi.org/format/#media-type-parameter-rules">base specification</a> <em>forbids</em> the use of multiple <code>ext</code> parameters
92+
and <em>requires</em> that each extension name must be a URI.
93+
This extension relaxes both constraints for practical reasons, to workaround bugs in client generators that produce broken code otherwise.</p>
94+
</div>
95+
<h2 id="namespace">Namespace</h2>
96+
<p>This extension uses the namespace <code>openapi</code>.</p>
97+
<div class="NOTE">
98+
<h5>Note</h5>
99+
<p>JSON:API extensions can only introduce new document members using a reserved namespace as a prefix.</p>
100+
</div>
101+
<h2 id="document-structure">Document Structure</h2>
102+
<p>A document that supports this extension MAY include any of the top-level members allowed by the base specification,
103+
including any members defined in the <a href="https://jsonapi.org/ext/atomic/">Atomic Operations extension</a>.</p>
104+
<h3 id="resource-objects">Resource Objects</h3>
105+
<p>In addition to the members allowed by the base specification, the following member MAY be included
106+
in <a href="https://jsonapi.org/format/#document-resource-object-attributes">attributes</a> and <a href="https://jsonapi.org/format/#document-resource-object-relationships">relationships</a> objects:</p>
107+
<ul>
108+
<li><code>openapi:discriminator</code> - A string that MUST be identical to the <code>type</code> member in the containing <a href="https://jsonapi.org/format/#document-resource-objects">resource object</a>.</li>
109+
</ul>
110+
<p>Here's how an article (i.e. a resource of type &quot;articles&quot;) might appear in a document:</p>
111+
<pre><code class="lang-json">{
112+
&quot;data&quot;: {
113+
&quot;type&quot;: &quot;articles&quot;,
114+
&quot;id&quot;: &quot;1&quot;,
115+
&quot;attributes&quot;: {
116+
&quot;openapi:discriminator&quot;: &quot;articles&quot;,
117+
&quot;title&quot;: &quot;Rails is Omakase&quot;
118+
},
119+
&quot;relationships&quot;: {
120+
&quot;openapi:discriminator&quot;: &quot;articles&quot;,
121+
&quot;author&quot;: {
122+
&quot;data&quot;: { &quot;type&quot;: &quot;people&quot;, &quot;id&quot;: &quot;9&quot; }
123+
}
124+
}
125+
}
126+
}
127+
</code></pre>
128+
<h3 id="atomic-operations">Atomic Operations</h3>
129+
<p>In addition to the members allowed by the <a href="https://jsonapi.org/ext/atomic/">Atomic Operations extension</a>,
130+
the following member MAY be included in elements of an <code>atomic:operations</code> array:</p>
131+
<ul>
132+
<li><code>openapi:discriminator</code> - A free-format string to facilitate generation of client code.</li>
133+
</ul>
134+
<p>For example:</p>
135+
<pre><code class="lang-http">POST /operations HTTP/1.1
136+
Host: example.org
137+
Content-Type: application/vnd.api+json; ext=&quot;https://www.jsonapi.net/ext/openapi https://jsonapi.org/ext/atomic&quot;
138+
Accept: application/vnd.api+json; ext=&quot;https://www.jsonapi.net/ext/openapi https://jsonapi.org/ext/atomic&quot;
139+
140+
{
141+
&quot;atomic:operations&quot;: [{
142+
&quot;openapi:discriminator&quot;: &quot;add-article&quot;,
143+
&quot;op&quot;: &quot;add&quot;,
144+
&quot;data&quot;: {
145+
&quot;type&quot;: &quot;articles&quot;,
146+
&quot;attributes&quot;: {
147+
&quot;openapi:discriminator&quot;: &quot;articles&quot;,
148+
&quot;title&quot;: &quot;JSON API paints my bikeshed!&quot;
149+
}
150+
}
151+
}]
152+
}
153+
</code></pre>
154+
<h2 id="processing">Processing</h2>
155+
<p>A server MAY ignore the <code>openapi:discriminator</code> member in <a href="https://jsonapi.org/format/#document-resource-object-attributes">attributes</a> and <a href="https://jsonapi.org/format/#document-resource-object-relationships">relationships</a> objects from incoming requests.
156+
A server SHOULD ignore the <code>openapi:discriminator</code> member in elements of an <code>atomic:operations</code> array.</p>
157+
<p>A server MUST include the <code>openapi:discriminator</code> member in <a href="https://jsonapi.org/format/#document-resource-object-attributes">attributes</a> and <a href="https://jsonapi.org/format/#document-resource-object-relationships">relationships</a> objects in outgoing responses.
158+
The member value MUST be the same as the <code>type</code> member value of the containing resource object.</p>
159+
<p>A client MAY include the <code>openapi:discriminator</code> member in <a href="https://jsonapi.org/format/#document-resource-object-attributes">attributes</a> and <a href="https://jsonapi.org/format/#document-resource-object-relationships">relationships</a> objects in outgoing requests.
160+
The member value MUST be the same as the <code>type</code> member value of the containing resource object.</p>
161+
<p>A client MAY include the <code>openapi:discriminator</code> member in elements of an <code>atomic:operations</code> array.</p>
162+
<h3 id="processing-errors">Processing Errors</h3>
163+
<p>A server SHOULD validate that the value of the <code>openapi:discriminator</code> member in
164+
<a href="https://jsonapi.org/format/#document-resource-object-attributes">attributes</a> and <a href="https://jsonapi.org/format/#document-resource-object-relationships">relationships</a> objects
165+
is identical to the <code>type</code> member in the containing resource object. When validation fails, the server MUST respond with a <code>409 Conflict</code>
166+
and SHOULD include a document with a top-level <code>errors</code> member that contains an error object.</p>
167+
168+
</article>
169+
170+
<div class="contribution d-print-none">
171+
<a href="https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/docs/ext/openapi/index.md/#L1" class="edit-link">Edit this page</a>
172+
</div>
173+
174+
<div class="next-article d-print-none border-top" id="nextArticle"></div>
175+
176+
</div>
177+
178+
<div class="affix">
179+
<nav id="affix"></nav>
180+
</div>
181+
</main>
182+
183+
184+
<footer class="border-top text-secondary">
185+
<div class="container-xxl">
186+
<div class="flex-fill">
187+
<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
188+
</div>
189+
</div>
190+
</footer>
191+
</body>
192+
</html>

0 commit comments

Comments
 (0)