docs: collect openapi-first wiki and refresh openapi-first lib docs; regenerate homepage
This commit is contained in:
@@ -632,13 +632,13 @@ services via the <code>openapi-first</code> CLI. It is not part of the
|
||||
<h4 id="openapi_first.templates.health_app--scaffolding-via-cli">Scaffolding via CLI</h4>
|
||||
<p>Create a new OpenAPI-first health check service using the bundled
|
||||
template:</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>openapi-first health_app
|
||||
<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>openapi-first scaffold health_app
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p>Create the service in a custom directory:</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>openapi-first health_app my-health-service
|
||||
<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>openapi-first scaffold health_app my-health-service
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p>List all available application templates:</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>openapi-first --list
|
||||
<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>openapi-first scaffold --list
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p>The CLI copies template files verbatim into the target directory.
|
||||
No code is generated or modified beyond the copied scaffold.</p>
|
||||
@@ -659,13 +659,13 @@ construct a strict, operationId-driven HTTP client.</p>
|
||||
<span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span><code>from openapi_first.loader import load_openapi
|
||||
from openapi_first.client import OpenAPIClient
|
||||
|
||||
spec = load_openapi("openapi.yaml")
|
||||
spec = load_openapi("openapi.yaml")
|
||||
client = OpenAPIClient(spec)
|
||||
|
||||
response = client.get_health()
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"status": "ok"}
|
||||
assert response.json() == {"status": "ok"}
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p>Client guarantees:
|
||||
- One callable per OpenAPI <code>operationId</code>
|
||||
|
||||
Reference in New Issue
Block a user