<p dir="auto">The use case:</p>
<p dir="auto">I'm running FastAPI behind a nginx reverse proxy, at the path <code class="notranslate">http://localhost/api/</code>. The documentation front ends (swagger and redoc) are expecting <code class="notranslate">openapi.json</code> at <code class="notranslate">http://localhost/openapi.json</code> but it's actually routed at <code class="notranslate">http://localhost/api/openapi.json</code>.</p>
<p dir="auto">Setting <code class="notranslate">openapi_url</code> to <code class="notranslate">/api/openapi.json</code> also changes the <code class="notranslate">openapi.json</code> path, so now it's looking for (through the proxy) <code class="notranslate">http://localhost/api/api/openapi.json</code>.</p>
<p dir="auto">Ideally, it'd be great if we could specify the "public path" for the api. That's how e.g. vue does it</p>
<p dir="auto">I have a model that include an ID field, which I return in responses. However, in requests (when POSTing new instances), I don't want the user to be able to specify the ID.</p>
<p dir="auto">Similarly to how we can include/exclude fields in the response, we should be able to exclude fields in the request. Declaring more classes just to exclude specific fields is a bit cumbersome, and making the property optional is semantically wrong, since I don't want to let the user specify it at all.</p>