Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger documentation now rendered anymore."Please indicate a valid Swagger or OpenAPI version field" #207

Open
empusas opened this issue Oct 9, 2023 · 2 comments

Comments

@empusas
Copy link

empusas commented Oct 9, 2023

When you use the latest version and after you fixed the issue with the pydantic version you don't get the usual swagger/openAPI screen as the file cannot be rendered. Instead you get this message:

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

I am not familiar with FastAPI but it seems something was change between version 0.98.0 and 0.99.0 (current version is 0.103.2) that breaks the rendering. It might have something todo with the customer CSS in netpalm.

In order to fix the issue the specific version of FastAPI should be in the requirements.txt. Usually is bad practice to pin down a specific version, same as not providing any version et all. But in this case we can expect no further versions between 0.98.0 and 0.99.0 with security patches. Anyhow to stick with proper syntax I did changed this line in requirements.txt:

fastapi>=0.98.0,<0.99.0

rebuild containers and it is working again.

Off course this is only a quick fix, as you miss out on all security and functional updates for FastAPI. The proper way would be to solve the root cause why it is not rendered with FastAPI version >0.98.

@radtrentasei
Copy link
Contributor

+1

@saiswaroopaa
Copy link

NA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants