1

I started programming in FastAPI. It comes with a built-in swagger interface to interact with apis in my code. I had completed the authentication and authorisation for users in my database. But swagger is not authorising the users in my database where the same users got authorised using postman. The swagger ui authorisation form is displaying 'username' and 'password' and my table has 'phoneNumber' as unique field.

models.py

from sqlalchemy import Column, String, BigInteger, Integer
from utils.database import Base

class UserModel(Base):
    __tablename__ = "user"

    id = Column(BigInteger, primary_key=True, index=True)
    phoneNumber = Column(Integer, unique=True, index=True)
    password = Column(String, index=True)
    type = Column(String, index=True)
Chris
  • 18,724
  • 6
  • 46
  • 80
Aryan VR
  • 189
  • 1
  • 12

0 Answers0