I want to serve a GET endpoint with a Pydantic BaseModel but a body is expected in the GET. def convert_to_camel_case(string: str) -> str: new_word = [] splitted = string.split("_") new_word.append(splitted[0]) for word in splitted[1:]: new_word.append(word.capitalize()) new_word = "".join(new_word) return new_word class PersonRequest(BaseModel): model_config = ConfigDict( # For generating alias in bulk. alias_generator=convert_to_camel_case, # Allow both alias and original field names to be used. populate_by_name=True, ) # Using snake case on the server but client can use either. birth_date: datetime.date first_name: str last_name: str @app.get("/") # async def create_alias(person: PersonRequest = Query(PersonRequest)): # This works BUT loses ability to take both camel and snake case. async def create_alias(person: PersonRequest): # Expects a "body" like in POST. try: print(person) return {"message": person} except ClientError as e: raise HTTPException(status_code=500, detail=f"Error creating alias: {str(e)}.") My test request: Request can have mixed either camel or snake case. GET http://localhost:8000 { "birthDate": "1999-01-01", "first_name": "Tyler", "lastName": "Durden" } I'm using 2 concepts which work fine independently but when I use at the same time, the result is not what I expect. I know the quick solution is for the client to use camel case which is usual anyway but I'm wondering why the alias function seems to work in once case but not both. It seems when using Query() makes populate_by_name useless. Continue reading...