Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Broken OpenAPI with entries as property name #1493

Closed
paulrinckens opened this issue May 28, 2020 · 3 comments
Closed

Broken OpenAPI with entries as property name #1493

paulrinckens opened this issue May 28, 2020 · 3 comments

Comments

@paulrinckens
Copy link

Describe the bug

Error in OpenAPI generation when a model property is named with entries. If property is renamed (e.g. entry) generation is successful.

To Reproduce

  1. Create a file with:
from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()


class Item(BaseModel):
    entries: str


@app.post("/demo")
def read_root(e: Item):
    return e
  1. Open the browser and call the docs http://localhost:8000/docs.
  2. Schema is not rendered (see screenshot)

Expected behavior

Schema is correctly rendered.

Screenshots

image

Environment

  • OS: macOS
  • FastAPI Version 0.55.1
  • Python 3.7.1

Additional context

Related swagger UI issue fixed in this PR: swagger-api/swagger-ui#6025

@paulrinckens paulrinckens added the bug Something isn't working label May 28, 2020
@phy25
Copy link

phy25 commented May 30, 2020

https://github.com/swagger-api/swagger-ui/releases/tag/v3.25.5

The latest swagger-ui release should have fixed this - this has nothing to do with fastapi.

@tiangolo
Copy link
Member

tiangolo commented Jun 6, 2020

Thanks for the help here @phy25 ! 👏 🙇

Yeah, that wouldn't be an issue with FastAPI but Swagger UI.

@github-actions
Copy link
Contributor

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.

@tiangolo tiangolo added question Question or problem reviewed and removed bug Something isn't working labels Feb 22, 2023
@tiangolo tiangolo changed the title [BUG] Broken OpenAPI with entries as property name Broken OpenAPI with entries as property name Feb 24, 2023
@tiangolo tiangolo reopened this Feb 28, 2023
@github-actions github-actions bot removed the answered label Feb 28, 2023
@fastapi fastapi locked and limited conversation to collaborators Feb 28, 2023
@tiangolo tiangolo converted this issue into discussion #7447 Feb 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants