zudoku 0.3.0-dev.8 → 0.3.0-dev.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.3.0-dev.8",
3
+ "version": "0.3.0-dev.9",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -52,35 +52,39 @@ export const OperationListItem = ({
52
52
  )}
53
53
  </div>
54
54
  )}
55
- <Heading level={3} className="capitalize">
56
- Responses
57
- </Heading>
58
- <Tabs defaultValue={`${first?.statusCode}${first?.description}`}>
59
- <TabsList>
60
- {operation.responses.map((response) => (
61
- <TabsTrigger
62
- value={response.statusCode + response.description}
63
- key={response.statusCode}
64
- title={response.description}
65
- >
66
- {response.statusCode}
67
- </TabsTrigger>
68
- ))}
69
- </TabsList>
70
- <ul className="list-none m-0 px-0 overflow-hidden">
71
- {operation.responses.map((response) => (
72
- <TabsContent
73
- value={response.statusCode + response.description}
74
- key={response.statusCode}
75
- >
76
- <SchemaListView
77
- schema={response.content?.at(0)?.schema}
78
- name=""
79
- />
80
- </TabsContent>
81
- ))}
82
- </ul>
83
- </Tabs>
55
+ {operation.responses.length > 0 && (
56
+ <>
57
+ <Heading level={3} className="capitalize">
58
+ Responses
59
+ </Heading>
60
+ <Tabs defaultValue={`${first?.statusCode}${first?.description}`}>
61
+ <TabsList>
62
+ {operation.responses.map((response) => (
63
+ <TabsTrigger
64
+ value={response.statusCode + response.description}
65
+ key={response.statusCode}
66
+ title={response.description}
67
+ >
68
+ {response.statusCode}
69
+ </TabsTrigger>
70
+ ))}
71
+ </TabsList>
72
+ <ul className="list-none m-0 px-0 overflow-hidden">
73
+ {operation.responses.map((response) => (
74
+ <TabsContent
75
+ value={response.statusCode + response.description}
76
+ key={response.statusCode}
77
+ >
78
+ <SchemaListView
79
+ schema={response.content?.at(0)?.schema}
80
+ name=""
81
+ />
82
+ </TabsContent>
83
+ ))}
84
+ </ul>
85
+ </Tabs>
86
+ </>
87
+ )}
84
88
  </div>
85
89
 
86
90
  <Sidecar operation={operation} />
@@ -64,7 +64,7 @@ export const Sidecar = ({
64
64
  }) => {
65
65
  const methodTextColor =
66
66
  MethodTextColorMap[operation.method as keyof typeof MethodTextColorMap];
67
- const [option, setOption] = useState("curl");
67
+ const [option, setOption] = useState("shell");
68
68
  const requestBodyContent = operation.requestBody?.content;
69
69
 
70
70
  const path = operation.path.split("/").map((part) => (