Build: 0.1.8
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-03-08 01:01:39 +05:30
parent 8701bf92ac
commit 9191de9dff
200 changed files with 130793 additions and 18277 deletions

View File

@@ -86,7 +86,9 @@
<header class="md-header" data-md-component="header">
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="openapi_first" class="md-header__button md-logo" aria-label="openapi_first" data-md-component="logo">
@@ -151,12 +153,19 @@
</label>
<nav class="md-search__options" aria-label="Search">
<a href="javascript:void(0)" class="md-search__icon md-icon" title="Share" aria-label="Share" data-clipboard data-clipboard-text="" data-md-component="search-share" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.15c-.05.21-.08.43-.08.66 0 1.61 1.31 2.91 2.92 2.91s2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08"/></svg>
</a>
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
@@ -182,96 +191,6 @@
<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
<div class="md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item">
<a href=".." class="md-tabs__link">
Home
</a>
</li>
<li class="md-tabs__item">
<a href="../app/" class="md-tabs__link">
Application Bootstrap
</a>
</li>
<li class="md-tabs__item md-tabs__item--active">
<a href="../loader/" class="md-tabs__link">
Core Utilities
</a>
</li>
<li class="md-tabs__item">
<a href="../client/" class="md-tabs__link">
OpenAPI Client
</a>
</li>
</ul>
</div>
</nav>
<main class="md-main" data-md-component="main">
@@ -285,10 +204,8 @@
<nav class="md-nav md-nav--primary md-nav--lifted" aria-label="Navigation" data-md-level="0">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="openapi_first" class="md-nav__button md-logo" aria-label="openapi_first" data-md-component="logo">
@@ -331,13 +248,21 @@
<li class="md-nav__item md-nav__item--nested">
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
@@ -346,7 +271,7 @@
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="">
@@ -429,13 +354,18 @@
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
@@ -555,28 +485,23 @@
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#openapi_first.errors--openapi_firsterrors" class="md-nav__link">
<a href="#openapi_first.errors--summary" class="md-nav__link">
<span class="md-ellipsis">
openapi_first.errors
Summary
</span>
</a>
<nav class="md-nav" aria-label="openapi_first.errors">
<ul class="md-nav__list">
</li>
<li class="md-nav__item">
<a href="#openapi_first.errors--design-principles" class="md-nav__link">
<a href="#openapi_first.errors-classes" class="md-nav__link">
<span class="md-ellipsis">
Design principles
Classes
</span>
</a>
</li>
</ul>
</nav>
</li>
<nav class="md-nav" aria-label="Classes">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#openapi_first.errors.MissingOperationHandler" class="md-nav__link">
@@ -589,9 +514,9 @@
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#openapi_first.errors.MissingOperationHandler--parameters" class="md-nav__link">
<a href="#openapi_first.errors.MissingOperationHandler-functions" class="md-nav__link">
<span class="md-ellipsis">
Parameters
Functions
</span>
</a>
@@ -614,6 +539,11 @@
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
@@ -640,13 +570,19 @@
<li class="md-nav__item md-nav__item--nested">
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
@@ -655,7 +591,7 @@
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="">
@@ -742,28 +678,23 @@
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#openapi_first.errors--openapi_firsterrors" class="md-nav__link">
<a href="#openapi_first.errors--summary" class="md-nav__link">
<span class="md-ellipsis">
openapi_first.errors
Summary
</span>
</a>
<nav class="md-nav" aria-label="openapi_first.errors">
<ul class="md-nav__list">
</li>
<li class="md-nav__item">
<a href="#openapi_first.errors--design-principles" class="md-nav__link">
<a href="#openapi_first.errors-classes" class="md-nav__link">
<span class="md-ellipsis">
Design principles
Classes
</span>
</a>
</li>
</ul>
</nav>
</li>
<nav class="md-nav" aria-label="Classes">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#openapi_first.errors.MissingOperationHandler" class="md-nav__link">
@@ -776,9 +707,9 @@
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#openapi_first.errors.MissingOperationHandler--parameters" class="md-nav__link">
<a href="#openapi_first.errors.MissingOperationHandler-functions" class="md-nav__link">
<span class="md-ellipsis">
Parameters
Functions
</span>
</a>
@@ -801,6 +732,11 @@
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
@@ -827,28 +763,35 @@
<h2 id="openapi_first.errors" class="doc doc-heading">
<span class="doc doc-object-name doc-module-name">openapi_first.errors</span>
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">openapi_first.errors</span>
</h2>
<div class="doc doc-contents first">
<h3 id="openapi_first.errors--openapi_firsterrors">openapi_first.errors</h3>
<p>Custom exceptions for OpenAPI-first FastAPI applications.</p>
<p>Exceptions for OpenAPI-first FastAPI applications.</p>
<hr />
<h4 id="openapi_first.errors--summary">Summary</h4>
<p>This module defines a small hierarchy of explicit, intention-revealing
exceptions used to signal contract violations between an OpenAPI
specification and its Python implementation.</p>
<h4 id="openapi_first.errors--design-principles">Design principles</h4>
<ul>
<li>Errors represent <em>programmer mistakes</em>, not runtime conditions.</li>
<li>All errors are raised during application startup.</li>
<li>Messages are actionable and suitable for CI/CD output.</li>
<li>Exceptions are explicit rather than reused from generic built-ins.</li>
</ul>
<p>These errors should normally cause immediate application failure.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Design Principles:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Errors represent programmer mistakes, not runtime conditions
- All errors are raised during application startup
- Messages are actionable and suitable for CI/CD output
- Exceptions are explicit rather than reused from generic built-ins
</code></pre></div></td></tr></table></div>
<p>These errors should normally cause immediate application failure.</p>
</details>
<div class="doc doc-children">
@@ -857,47 +800,98 @@ specification and its Python implementation.</p>
<h3 id="openapi_first.errors-classes">Classes</h3>
<div class="doc doc-object doc-class">
<h3 id="openapi_first.errors.MissingOperationHandler" class="doc doc-heading">
<span class="doc doc-object-name doc-class-name">MissingOperationHandler</span>
<h4 id="openapi_first.errors.MissingOperationHandler" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">MissingOperationHandler</span>
</h3>
<div class="doc-signature highlight"><pre><span></span><code><span class="nf">MissingOperationHandler</span><span class="p">(</span><span class="o">*</span><span class="p">,</span> <span class="n">path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">method</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">operation_id</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span>
</code></pre></div>
</h4>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">MissingOperationHandler</span><span class="p">(</span><span class="o">*</span><span class="p">,</span> <span class="n">path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">method</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">operation_id</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="openapi_first.errors.OpenAPIFirstError" href="#openapi_first.errors.OpenAPIFirstError">OpenAPIFirstError</a></code></p>
Bases: <code><a class="autorefs autorefs-internal" title="openapi_first.errors.OpenAPIFirstError" href="../openapi_first/errors/#openapi_first.errors.OpenAPIFirstError">OpenAPIFirstError</a></code></p>
<p>Raised when an OpenAPI operation cannot be resolved to a handler.</p>
<p>This error occurs when:
- An OpenAPI operation does not define an operationId, or
- An operationId is defined but no matching function exists in the
provided routes module.</p>
<p>This represents a violation of the OpenAPI-first contract and
indicates that the specification and implementation are out of sync.</p>
<h5 id="openapi_first.errors.MissingOperationHandler--parameters">Parameters</h5>
<p>path : str
The HTTP path declared in the OpenAPI specification.</p>
<details class="method-" open>
<summary>str</summary>
<p>The HTTP method (as declared in the OpenAPI spec).</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Scenarios:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- An OpenAPI operation does not define an operationId
- An operationId is defined but no matching function exists in the provided routes module
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This represents a violation of the OpenAPI-first contract and indicates that the specification and implementation are out of sync
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize the error.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>path</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>The HTTP path declared in the OpenAPI specification.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
<tr class="doc-section-item">
<td><code>method</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>The HTTP method (as declared in the OpenAPI spec).</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
<tr class="doc-section-item">
<td><code>operation_id</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>The operationId declared in the OpenAPI spec, if present.</p>
</div>
</td>
<td>
<code>None</code>
</td>
</tr>
</tbody>
</table>
<details class="operation_id-" open>
<summary>str, optional</summary>
<p>The operationId declared in the OpenAPI spec, if present.</p>
</details>
@@ -909,7 +903,7 @@ indicates that the specification and implementation are out of sync.</p>
<h5 id="openapi_first.errors.MissingOperationHandler-functions">Functions</h5>
@@ -923,11 +917,11 @@ indicates that the specification and implementation are out of sync.</p>
<h3 id="openapi_first.errors.OpenAPIFirstError" class="doc doc-heading">
<span class="doc doc-object-name doc-class-name">OpenAPIFirstError</span>
<h4 id="openapi_first.errors.OpenAPIFirstError" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">OpenAPIFirstError</span>
</h3>
</h4>
<div class="doc doc-contents ">
@@ -936,13 +930,17 @@ indicates that the specification and implementation are out of sync.</p>
<p>Base exception for all OpenAPI-first enforcement errors.</p>
<p>This exception exists to allow callers, test suites, and CI pipelines
to catch and distinguish OpenAPI contract violations from unrelated
runtime errors.</p>
<p>All exceptions raised by the OpenAPI-first core should inherit from
this type.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This exception exists to allow callers, test suites, and CI pipelines to catch and distinguish OpenAPI contract violations from unrelated runtime errors
- All exceptions raised by the OpenAPI-first core should inherit from this type
</code></pre></div></td></tr></table></div>
</details>
</div>
</div>
@@ -972,6 +970,8 @@ this type.</p>
</div>
<script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
@@ -1009,7 +1009,7 @@ this type.</p>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.tabs", "navigation.expand", "navigation.top", "navigation.instant", "content.code.copy", "content.code.annotate"], "search": "../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.sections", "navigation.expand", "navigation.top", "navigation.instant", "navigation.tracking", "navigation.indexes", "content.code.copy", "content.code.annotate", "content.tabs.link", "content.action.edit", "search.highlight", "search.share", "search.suggest"], "search": "../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script src="../assets/javascripts/bundle.f55a23d4.min.js"></script>