OpenAPIDesigner 是一个开源的 OpenAPI 规范设计工具,可让开发人员设计、编写和验证 OpenAPI 规范。
OpenAPIDesigner 是一个开源的 OpenAPI 规范设计工具,可让开发人员设计、编写和验证 OpenAPI 规范。
oneOf, allOf, anyOf, and notnpm install @xcan-cloud/open-api-designerimport { OpenAPIDesigner } from '@xcan-cloud/open-api-designer';
function App() {
return (
console.log(doc)}
/>
);
}import { OpenAPIDesigner, createPetStoreDocument } from '@xcan-cloud/open-api-designer';
function App() {
return (
console.log(doc)}
/>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
initialDocument |
OpenAPIDocument |
undefined |
Pre-populated OpenAPI document to load on mount |
defaultLocale |
'zh' | 'en' |
'en' |
UI language |
defaultTheme |
'light' | 'dark' |
'light' |
Color theme |
onChange |
(doc: OpenAPIDocument) => void |
undefined |
Callback fired on every document change |
className |
string |
undefined |
Additional CSS class applied to the root element |
interface OpenAPIDesignerProps {
initialDocument?: OpenAPIDocument;
defaultLocale?: 'zh' | 'en';
defaultTheme?: 'light' | 'dark';
onChange?: (doc: OpenAPIDocument) => void;
className?: string;
}| Function | Description |
|---|---|
createDefaultDocument() |
Returns a minimal, valid OpenAPI 3.1 document |
createPetStoreDocument() |
Returns a feature-rich Pet Store example document |
…| Directory | Description |
|---|---|
example/ |
Example demo application showcasing component usage |
website/ |
Documentation website with guides and API docs |
const myDoc: OpenAPIDocument = {
openapi: '3.1.0',
info: { title: 'My API', version: '1.0.0' },
paths: {},
};
;The built-in i18n system supports Chinese (zh) and English (en). To contribute a new locale:
src/app/components/openapi-designer/i18n/.en.ts) and translate all keys.| Category | Technologies |
|---|---|
| Framework | React 18, TypeScript |
| Styling | Tailwind CSS v4 |
| UI Components | Radix UI (shadcn/ui) |
| Icons | Lucide React |
| YAML Processing | js-yaml |
| Build Tool | Vite |
| Browser | Supported Version |
|---|---|
| Chrome | Last 2 versions |
| Firefox | Last 2 versions |
| Safari | Last 2 versions |
| Edge | Last 2 versions |
Contributions are welcome! Please follow these steps:
git checkout -b feat/my-feature.git commit -m 'feat: add my feature'.git push origin feat/my-feature.Please make sure your code passes the existing linting and build checks before submitting.
MIT © OpenAPIDesigner Contributors
暂无开放 Issues,或尚未同步最近议题。