mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-05 10:23:44 +00:00
refactor, body
# What does this PR do? ## Test Plan # What does this PR do? ## Test Plan
This commit is contained in:
parent
548ccff368
commit
f5b5a2d0d5
33 changed files with 564 additions and 856 deletions
|
|
@ -23,6 +23,7 @@ from llama_stack.strong_typing.inspection import (
|
|||
is_generic_list,
|
||||
is_type_optional,
|
||||
is_type_union,
|
||||
is_unwrapped_body_param,
|
||||
unwrap_generic_list,
|
||||
unwrap_optional_type,
|
||||
unwrap_union_types,
|
||||
|
|
@ -769,6 +770,11 @@ class Generator:
|
|||
first = next(iter(op.request_params))
|
||||
request_name, request_type = first
|
||||
|
||||
# Special case: if there's a single parameter with Body(embed=False) that's a BaseModel,
|
||||
# unwrap it to show the flat structure in the OpenAPI spec
|
||||
if (len(op.request_params) == 1 and is_unwrapped_body_param(request_type)):
|
||||
pass
|
||||
|
||||
op_name = "".join(word.capitalize() for word in op.name.split("_"))
|
||||
request_name = f"{op_name}Request"
|
||||
fields = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue