{"_id":"@apitomy/openapi-editor","name":"@apitomy/openapi-editor","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@apitomy/openapi-editor","version":"0.2.0","description":"A reusable React component for visual OpenAPI editing","type":"module","main":"./dist/apitomy-openapi-editor.cjs.js","module":"./dist/apitomy-openapi-editor.es.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/apitomy-openapi-editor.es.js","require":"./dist/apitomy-openapi-editor.cjs.js"}},"scripts":{"dev":"vite","build":"tsc -b && vite build","clean":"rimraf dist *.tsbuildinfo","lint":"eslint .","preview":"vite preview","test-app:install":"cd test-app && npm install","test-app:dev":"cd test-app && npm run dev","test-app:build":"cd test-app && npm run build","test-app:clean":"cd test-app && npm run clean"},"repository":{"type":"git","url":"git+https://github.com/Apitomy/apitomy-openapi-editor.git"},"keywords":["openapi","api","editor","react","component","apitomy","swagger","visual-editor"],"author":{"name":"Apitomy"},"license":"Apache-2.0","bugs":{"url":"https://github.com/Apitomy/apitomy-openapi-editor/issues"},"homepage":"https://github.com/Apitomy/apitomy-openapi-editor#readme","peerDependencies":{"@apitomy/data-models":"^3.1.0","@patternfly/react-core":"^6.0.0","@patternfly/react-icons":"^6.0.0","@patternfly/react-table":"^6.0.0","@patternfly/react-code-editor":"^6.4.0","react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0","yaml":"^2.6.1","zustand":"^5.0.0"},"devDependencies":{"@apitomy/data-models":"3.1.0","@eslint/js":"9.39.3","@patternfly/react-core":"6.4.1","@patternfly/react-icons":"6.4.0","@patternfly/react-table":"6.4.1","@patternfly/react-code-editor":"6.4.1","@types/react":"19.2.14","@types/react-dom":"19.2.3","@typescript-eslint/eslint-plugin":"8.56.1","@typescript-eslint/parser":"8.56.1","@vitejs/plugin-react":"5.1.4","eslint":"9.39.3","eslint-plugin-react":"7.37.5","eslint-plugin-react-hooks":"7.0.1","eslint-plugin-react-refresh":"0.5.2","globals":"16.5.0","react":"19.2.4","react-dom":"19.2.4","rimraf":"6.1.3","typescript":"5.9.3","typescript-eslint":"8.56.1","vite":"7.3.3","vite-plugin-dts":"4.5.4","yaml":"2.9.0","zustand":"5.0.11"},"_id":"@apitomy/openapi-editor@0.2.0","gitHead":"89236623d57888919e177f847ae800f456ab9205","_nodeVersion":"22.17.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-0w9ZqU3Nx/0VWSo35zuQ9mZGeSENyzyNYzcFpJcBMsr4bxQN5xQ8FJDZ1t0PTfq8wIAE3eIW7gQ65tic++0krQ==","shasum":"8d267a335cb4fd8f713000f18585d7d9b574d23c","tarball":"https://registry.npmjs.org/@apitomy/openapi-editor/-/openapi-editor-0.2.0.tgz","fileCount":242,"unpackedSize":5503544,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDf/CiO8YRa12URQ6RiMV/cZTDAzVJODNBrYYH6zc9VRAiBCWMetRyG1GNKugdaW1dDgJytN1ZH8NxcsxfGR+saUuQ=="}]},"_npmUser":{"name":"apitomy.ci","email":"apitomy.ci@gmail.com"},"directories":{},"maintainers":[{"name":"apitomy.ci","email":"apitomy.ci@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openapi-editor_0.2.0_1780048904178_0.028420116868828282"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-29T10:01:44.005Z","0.2.0":"2026-05-29T10:01:44.422Z","modified":"2026-05-29T10:01:44.665Z"},"maintainers":[{"name":"apitomy.ci","email":"apitomy.ci@gmail.com"}],"description":"A reusable React component for visual OpenAPI editing","homepage":"https://github.com/Apitomy/apitomy-openapi-editor#readme","keywords":["openapi","api","editor","react","component","apitomy","swagger","visual-editor"],"repository":{"type":"git","url":"git+https://github.com/Apitomy/apitomy-openapi-editor.git"},"author":{"name":"Apitomy"},"bugs":{"url":"https://github.com/Apitomy/apitomy-openapi-editor/issues"},"license":"Apache-2.0","readme":"# Apitomy OpenAPI Editor\n\nA reusable React component for visual OpenAPI editing that can be embedded in React applications.\n\n## Overview\n\nThe Apitomy OpenAPI Editor is a modern, React-based visual editor for OpenAPI specifications\n(versions 2.0 and 3.0.x). It provides an intuitive interface for creating, editing, and managing\nOpenAPI documents without requiring direct YAML or JSON manipulation.\n\n### Features\n\n- **Multi-version support** - Edit both OpenAPI 2.0 (Swagger) and OpenAPI 3.0.x documents\n- **Visual editing** - Inline property editing with auto-save for all major sections\n- **Navigation tree** - Browse Paths, Schemas, Responses, and Tags with right-click context menus\n- **Undo/Redo** - Full command-pattern-based undo/redo support\n- **Validation** - Real-time OpenAPI validation with clickable problem navigation\n- **Source view** - Toggle between visual editing and raw YAML/JSON source\n- **Paths & Operations** - Create, delete, and edit paths and HTTP operations (GET, POST, PUT,\n  DELETE, PATCH, OPTIONS, HEAD)\n- **Schemas** - Create, delete, and edit schema definitions\n- **Servers** - Manage servers with variable substitution (OpenAPI 3.0)\n- **Tags** - Create, rename, delete, and describe tags\n- **Security** - Manage security schemes (API Key, HTTP, OAuth2, OpenID Connect) and security\n  requirements\n- **Parameters** - Add, edit, and delete query, header, path, and cookie parameters\n- **Vendor extensions** - Add, edit, and delete custom `x-*` extension properties\n- **License chooser** - Visual license picker with common open-source licenses\n- **Selection events** - Subscribe to selection changes for integration with external tools\n- **Dark theme** - Supports PatternFly dark theme\n\n## Quickstart\n\nTo quickly try out the OpenAPI Editor with a test application:\n\n```bash\n# Clone the repository\ngit clone https://github.com/Apitomy/apitomy-openapi-editor.git\ncd apitomy-openapi-editor\n\n# Install dependencies\nnpm install\n\n# Install test app dependencies\nnpm run test-app:install\n\n# Start the test application\nnpm run test-app:dev\n```\n\nThe test application will start on `http://localhost:3000` (or the next available port). This\nprovides a full-featured demo of the OpenAPI Editor with sample data and all features enabled.\n\n## Usage\n\n```tsx\nimport { OpenAPIEditor, DocumentChangeEvent, SelectionChangeEvent } from '@apitomy/openapi-editor';\n\nfunction App() {\n    const handleChange = (event: DocumentChangeEvent) => {\n        console.log('Document dirty:', event.isDirty);\n        // Call event.getContent() only when you need to save\n    };\n\n    const handleSelectionChange = (event: SelectionChangeEvent) => {\n        console.log('Selected path:', event.path.toString());\n    };\n\n    return (\n        <OpenAPIEditor\n            initialContent={yourOpenAPIDocument}\n            onChange={handleChange}\n            onSelectionChange={handleSelectionChange}\n        />\n    );\n}\n```\n\n### Props\n\n| Prop | Type | Description |\n|------|------|-------------|\n| `initialContent` | `object \\| string` | The initial OpenAPI content (JSON object or JSON string) |\n| `onChange` | `(event: DocumentChangeEvent) => void` | Fired when the document changes |\n| `onSelectionChange` | `(event: SelectionChangeEvent) => void` | Fired when the selection changes |\n| `features` | `EditorFeatures` | Optional feature flags |\n\n### DocumentChangeEvent\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `isDirty` | `boolean` | Whether the document has unsaved changes |\n| `version` | `number` | Incrementing version number for tracking changes |\n| `getContent` | `() => object \\| null` | Accessor to retrieve current content (call only when saving) |\n\n## Peer Dependencies\n\nThis library requires the following peer dependencies to be installed by the consuming application:\n\n```json\n{\n    \"@apitomy/data-models\": \"^2.2.6\",\n    \"@patternfly/react-core\": \"^6.0.0\",\n    \"@patternfly/react-icons\": \"^6.0.0\",\n    \"@patternfly/react-table\": \"^6.0.0\",\n    \"@patternfly/react-code-editor\": \"^6.4.0\",\n    \"react\": \"^18.0.0 || ^19.0.0\",\n    \"react-dom\": \"^18.0.0 || ^19.0.0\",\n    \"yaml\": \"^2.6.1\",\n    \"zustand\": \"^5.0.0\"\n}\n```\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Links\n\n- [GitHub Repository](https://github.com/Apitomy/apitomy-openapi-editor)\n- [Issue Tracker](https://github.com/Apitomy/apitomy-openapi-editor/issues)\n- [Apitomy Project](https://www.apitomy.io/)","readmeFilename":"README.md","_rev":"1-86c757aa8ed1dac47c5b2a2db735f33c"}