Is it possible to add multiple select for a dropdown in fastapi openapi? I only manage to select one.
- if I set
Optional[List]
it wont run, the enum?). - if I set
{[ids]}
in the routes openapi says it is a array and no dropdown.
@app.get("/schedules")
@app.get("/schedules/{ids}", include_in_schema=False)
@app.get("/schedules/{ids}/{active}")
async def GetScedules(
ids:Optional[str]=Query(None, enum=[str(id) for id in appconfig['projectids']]),
active:Optional[str]=Query(None, enum=["active", "notactive"])):
""" list gitlab schedules sorted on projectids """
if isinstance(ids, str): # convert str to list
if ',' in ids:
ids = ids.split(',')
else:
ids = [ids]