Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

602
Views
FastAPI - Unable to render Swagger in production

This is my FastAPI main.py file.

from fastapi import FastAPI
from project.config.settings import base as settings

app = FastAPI(docs_url=f"{settings.URL_ROOT}/{settings.DOCS_URL}", redoc_url=None)
app.openapi_version = "3.0.0"

# some functions here

And I deployed this project to a server. But when I go to address of docs in my server, 1.2.3.4/url_root/docs_url, it shows me following message:

Unable to render this definition
The provided definition does not specify a valid version field.

Please indicate a valid Swagger or OpenAPI version field.
Supported version fields are swagger: "2.0" and those that match openapi: 3.0.n (for example, openapi: 3.0.0).

What's the problem and how can I solve it?

UPDATE:
FastAPI is behind Nginx. All of my endpoints are working correctly, but I cannot see docs.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!