22import { Type , MetaInfo } from " ~/components" ;
33import { type SchemaNode } from " @stoplight/json-schema-tree" ;
44
5- const { node, root } = Astro .props ;
5+ const { node } = Astro .props ;
66---
77
8- <li
9- class ={ ` py-2 my-0! list-none! ${root ? " " : " border-l border-l-gray-200 dark:border-l-gray-500 pl-4" } ` }
10- >
11- {
12- (
13- <code
14- class = " mr-2 rounded-md bg-gray-100 pr-0! font-mono"
15- title = { node .title }
16- >
17- { node .subpath [node .subpath .length - 1 ]}
18- { node .parent .fragment ?.required ?.includes (
19- node .subpath [node .subpath .length - 1 ],
20- ) ? (
21- <span class = " font-semibold text-red-500" >*</span >
22- ) : (
23- " "
24- )}
25- </code >
26- )
27- }
8+ <li >
9+ <code title ={ node .title } >{ node .subpath [node .subpath .length - 1 ]} </code >
2810
2911 { node .primaryType && <Type text = { node .primaryType } />}
12+
3013 { node .combiners && node .combiners .includes (" oneOf" ) && <Type text = " one of" />}
3114
15+ {
16+ node .parent .fragment ?.required ?.includes (
17+ node .subpath [node .subpath .length - 1 ],
18+ ) && <MetaInfo text = " required" />
19+ }
20+
3221 {
3322 node .annotations .default && (
3423 <MetaInfo text = { ` default ${node .annotations .default } ` } />
@@ -50,11 +39,11 @@ const { node, root } = Astro.props;
5039 />
5140 )
5241 }
53- <p class = " mb-0! " >{ node .annotations .description } </p >
42+ <p >{ node .annotations .description } </p >
5443
5544 {
5645 node .children && (
57- <ul class = " m-0 ml-4 list-none! p-0 " >
46+ <ul class = " pl-6 " >
5847 { node .children .map ((node : SchemaNode ) => (
5948 <Astro.self node = { node } />
6049 ))}
0 commit comments