/react-openapi-designer

A React based UI toolkit to develop openapi schema and other elements

Primary LanguageJavaScriptMIT LicenseMIT

React openapi designer

React openapi designer is a React component library of UI elements needed to build Openapi specifications

Usage

Import the application and start using it in any React basded application

// ...
import ReactOpenapiDesigner from 'react-openapi-designer';

const handleChange = (schema) => {
    console.log('Changed Schema', schema)
}

export const MyApp = (props) => {
    const initSchema = {
        type: 'object',
        properties: {
            status: {type: 'string'}
        },
        required: ['status'],
        examples: {}
    };
    return  (<ReactOpenapiDesigner
                dark
                schema={schema}
                onChange={handleChange} 
            />);
}

Supported props

Following props are supported:

name default description
dark false Enable dark mode
schema {type: "object"} The default schema to start with
onChange None This props is triggered on any change in the schema. You'll get a javascript object of schema

Local development

To start local development, clone this repo and run npm run dev.

If you wish to use this repo in some other project, while quickly making changes, you should try using npm run watch, which starts this project in watch mode and is a lot faster.

TODO