examples dict for query parameter showing warning: Could not render n, see the console #4266
-
|
Hi, I am trying to provide multiple examples for a query parameter. def handler(
status: str = Query(
None,
title="Status",
description=f"Comma separated list. Possible values are: {', '.join(status_list)}.",
examples={
"single": choice(status_list),
"list": ",".join(sample(status_list, 3)),
},
),
):
...But it's not showing properly in the docs page. There is a message saying:
When I check the console, I see the below stacktrace. When I use the 2 examples individually as a single example with the keyword argument |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hey @bluebrown. You'll want to change your
|
Beta Was this translation helpful? Give feedback.
Hey @bluebrown. You'll want to change your
exampleskwarg as follows:examplesexpects a nested dictionary, where at the root your keys are names for each example, like "single" or "list". But the value of that key must be another dictionary containing specific keywords. This section of the documentation discusses the expected format forexamples.