Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport openapi-ui-forms from master also to 2.0.x #497

Merged
merged 2 commits into from
Oct 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ target
nbactions.xml
nb-configuration.xml
catalog.xml
# ignore VSCode files
.vscode
#
maven-ant-tasks.jar
test-output
Expand Down
11 changes: 11 additions & 0 deletions ui/open-api-ui-forms/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
presets: [
[
'@babel/preset-env',
{
modules: false
}
],
'@babel/preset-react'
]
}
16 changes: 16 additions & 0 deletions ui/open-api-ui-forms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.cache/
coverage/
dist/*
!dist/index.html
node_modules/
*.log
target/

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
53 changes: 53 additions & 0 deletions ui/open-api-ui-forms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
A generic bundled spa in React, which introspects Swagger OpenAPI definitions file, to build automatically html forms (bootstrap4) for POST endpoints exchanging JSON

GOALs:
- build automatically an html form, by introspecting Swagger OpenAPI definitions file
- the introspection works at runtime, not at `npm` build time

non-GOALS:
- not a "low-code" app generator

# DEMO

Watch the video on YouTube:

[![Watch the video](https://img.youtube.com/vi/av_DoGNl2jI/hqdefault.jpg)](https://youtu.be/av_DoGNl2jI)

## Building and running on localhost

First install dependencies:

```sh
npm install
```

To create a production build:

```sh
npm run build-prod
```

To create a development build:

```sh
npm run build-dev
```

## Running

Open the file `dist/index.html` in your browser

## Deploying

To include it in your project (replace xyz with the latest version):

```
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-open-api-ui-forms</artifactId>
<version>xyz</version>
<scope>runtime</scope>
</dependency>
```

The UI will be available under `/openapi-ui-forms`.
Loading