@@ -50,6 +50,8 @@ if Code.ensure_loaded?(OpenApiSpex) do
50
50
Tag
51
51
}
52
52
53
+ require Logger
54
+
53
55
@ typep content_type_format ( ) :: :json | :multipart
54
56
@ typep acc ( ) :: map ( )
55
57
@@ -948,7 +950,6 @@ if Code.ensure_loaded?(OpenApiSpex) do
948
950
if type_key in acc . seen_non_schema_types do
949
951
# We're in a recursive loop, return $ref and warn
950
952
# Recursive type detected, using $ref instead of inline definition
951
- require Logger
952
953
953
954
Logger . warning (
954
955
"Detected recursive embedded type with JSON API type: #{ inspect ( instance_of ) } "
@@ -1080,9 +1081,9 @@ if Code.ensure_loaded?(OpenApiSpex) do
1080
1081
input_schema_name =
1081
1082
create_input_schema_name ( attribute , parent_resource , action_type , embedded_resource )
1082
1083
1083
- # Check for recursion
1084
1084
type_key = { embedded_resource , action_type , attribute . constraints }
1085
1085
1086
+ # Check for recursion
1086
1087
if type_key in acc . seen_input_types do
1087
1088
# We're in a recursive loop
1088
1089
if input_schema_name do
@@ -1545,10 +1546,8 @@ if Code.ensure_loaded?(OpenApiSpex) do
1545
1546
{ parameters_list , acc } = parameters ( route , resource , path_params , acc )
1546
1547
{ response , acc } = response_body ( route , resource , acc )
1547
1548
1548
- # Get request body and any generated schemas
1549
1549
{ request_body_result , request_schemas } = request_body ( route , resource )
1550
1550
1551
- # Merge request schemas into accumulator
1552
1551
acc_with_request_schemas = % { acc | schemas: Map . merge ( acc . schemas , request_schemas ) }
1553
1552
1554
1553
operation = % Operation {
@@ -2013,7 +2012,6 @@ if Code.ensure_loaded?(OpenApiSpex) do
2013
2012
{ multipart_body_schema , multipart_acc } =
2014
2013
request_body_schema ( route , resource , :multipart , empty_acc ( ) )
2015
2014
2016
- # Collect all generated schemas
2017
2015
all_schemas = Map . merge ( json_acc . schemas , multipart_acc . schemas )
2018
2016
2019
2017
body =
@@ -2064,7 +2062,6 @@ if Code.ensure_loaded?(OpenApiSpex) do
2064
2062
}
2065
2063
end
2066
2064
2067
- # Return both the body and any generated schemas
2068
2065
{ body , all_schemas }
2069
2066
end
2070
2067
0 commit comments