File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/react-openapi/src Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,8 @@ export function OpenAPIRootSchema(props: {
182
182
183
183
/**
184
184
* Render a tab for an alternative schema.
185
+ * It renders directly the properties if relevant;
186
+ * for primitives, it renders the schema itself.
185
187
*/
186
188
function OpenAPISchemaAlternative ( props : {
187
189
schema : OpenAPIV3 . SchemaObject ;
@@ -190,12 +192,13 @@ function OpenAPISchemaAlternative(props: {
190
192
} ) {
191
193
const { schema, circularRefs, context } = props ;
192
194
const id = useId ( ) ;
195
+ const subProperties = getSchemaProperties ( schema ) ;
193
196
194
197
return (
195
198
< OpenAPISchemaProperties
196
199
id = { id }
197
- properties = { getSchemaProperties ( schema ) ?? [ ] }
198
- circularRefs = { new Map ( circularRefs ) . set ( schema , id ) }
200
+ properties = { subProperties ?? [ { schema } ] }
201
+ circularRefs = { subProperties ? new Map ( circularRefs ) . set ( schema , id ) : circularRefs }
199
202
context = { context }
200
203
/>
201
204
) ;
You can’t perform that action at this time.
0 commit comments