@apiwiz/apiwiz-catalog-library 2.0.40 → 2.0.42
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/README.md +34 -0
- package/build/index.css +4 -4
- package/build/index.css.map +1 -1
- package/build/index.esm.js +15 -15
- package/build/index.js +15 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -150,8 +150,42 @@ interface ApiwizCatalogProps {
|
|
|
150
150
|
| `swaggerData` | `object` | OAS JSON object (for Catalog) |
|
|
151
151
|
| `selectedMethod` | `string` | Selected HTTP method (e.g., "GET") |
|
|
152
152
|
| `selectedPath` | `string` | Selected API endpoint path |
|
|
153
|
+
| `enableDevTools` | `boolean` | When `true` in `EXTERNAL` mode, shows a floating panel to switch OAS presets, operations, theme, and left panel |
|
|
153
154
|
| `bottomBar` | `React.ReactElement \| React.ComponentType` | Bottom bar component to render at the end of center content |
|
|
154
155
|
|
|
156
|
+
### OpenAPI version support
|
|
157
|
+
|
|
158
|
+
The catalog supports **OAS 2.0**, **3.0**, and **3.1** specs. Version is detected from the `swagger` / `openapi` field in `swaggerData`. For backend API calls (`DEV_PORTAL`, `CORE_UI`), OAS 3.1 is sent as `oas: 3.0` for compatibility.
|
|
159
|
+
|
|
160
|
+
### Local testing (`npm run serve`)
|
|
161
|
+
|
|
162
|
+
Open `/reference` to use the built-in testing harness with a floating **wrench** icon. Use it to switch between:
|
|
163
|
+
|
|
164
|
+
- **OAS 2.0** — [`src/Samples/petstore-v2.json`](src/Samples/petstore-v2.json) (Enterprise Commerce API)
|
|
165
|
+
- **OAS 3.0** — [`src/Samples/extreme-openapi-3.0.json`](src/Samples/extreme-openapi-3.0.json) (Extreme Enterprise Platform stress-test spec)
|
|
166
|
+
- **OAS 3.1** — [`src/Samples/extreme-openapi-3.1.json`](src/Samples/extreme-openapi-3.1.json) (Extreme Enterprise Platform torture-test spec)
|
|
167
|
+
|
|
168
|
+
You can also change operations, theme, and left panel layout from the same panel.
|
|
169
|
+
|
|
170
|
+
### `CatalogDevTools` (optional export)
|
|
171
|
+
|
|
172
|
+
```jsx
|
|
173
|
+
import { CatalogDevTools, APP_THEME_OPTION } from '@apiwiz/apiwiz-catalog-library';
|
|
174
|
+
|
|
175
|
+
<CatalogDevTools
|
|
176
|
+
value={{
|
|
177
|
+
swaggerData,
|
|
178
|
+
selectedMethod,
|
|
179
|
+
selectedPath,
|
|
180
|
+
appTheme: APP_THEME_OPTION.LIGHT,
|
|
181
|
+
enableLeftPanel: true,
|
|
182
|
+
}}
|
|
183
|
+
onChange={setConfig}
|
|
184
|
+
/>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Or pass `enableDevTools` on `ApiwizCatalog` / `APIReference` in `EXTERNAL` mode to embed the panel automatically.
|
|
188
|
+
|
|
155
189
|
---
|
|
156
190
|
|
|
157
191
|
## 🧱 Constants
|