├── .editorconfig ├── .eslintignore ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── index.html ├── jsconfig.json ├── package.json ├── screenshot-1.png ├── src ├── App.jsx ├── action │ └── definition.js ├── component │ ├── ApiDescriptionField.jsx │ ├── Drawer.css │ ├── Drawer.jsx │ ├── EntrypointCard.css │ ├── EntrypointCard.jsx │ ├── EntrypointLists.jsx │ ├── Footer.jsx │ ├── Header.jsx │ ├── Model.css │ ├── Model.jsx │ ├── Request.jsx │ ├── Response.jsx │ └── SecurityChips.jsx ├── container │ ├── ApiDescriptionContainer.js │ ├── ConnectedDrawer.js │ ├── ConnectedHeader.js │ └── TaggedEntrypoints.js ├── index.css ├── index.jsx ├── reducer │ └── definition.js ├── store.js └── vendor │ ├── highlight.js │ └── materialized.js ├── typings.json ├── webpack.config.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 2 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | 3 | node_modules 4 | typings 5 | 6 | dist 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | typings 2 | 3 | .editorconfig 4 | .eslintignore 5 | jsconfig.json 6 | typings.json 7 | webpack.config.js 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2017 Lucas Woo and contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Material Swagger UI 3 | 4 | [![npm](https://img.shields.io/npm/v/material-swagger-ui.svg?maxAge=2592000)](https://www.npmjs.com/package/material-swagger-ui) 5 | 6 | > This repo is still in very pre-alpha stage 7 | 8 | ![Screenshot](screenshot-1.png) 9 | 10 | ## Usage 11 | 12 | Parameter `url` in url query will be used as definition url, or `http://petstore.swagger.io/v2/swagger.json` will be used by default. 13 | 14 | ## LICENSE 15 | 16 | Licensed under the MIT License 17 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Swagger UI 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=759670 3 | // for the documentation about the jsconfig.json format 4 | "compilerOptions": { 5 | "target": "es6", 6 | "module": "commonjs", 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "exclude": [ 10 | "node_modules", 11 | "bower_components", 12 | "jspm_packages", 13 | "tmp", 14 | "temp" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "material-swagger-ui", 3 | "version": "0.1.2", 4 | "description": "", 5 | "main": "index.html", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/legendecas/material-swagger-ui.git" 9 | }, 10 | "keywords": [ 11 | "swagger", 12 | "ui", 13 | "material", 14 | "api", 15 | "doc" 16 | ], 17 | "author": { 18 | "name": "Lucas Woo", 19 | "email": "legendecas@gmail.com" 20 | }, 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/legendecas/material-swagger-ui/issues" 24 | }, 25 | "homepage": "https://github.com/legendecas/material-swagger-ui#readme", 26 | "devDependencies": { 27 | "babel-core": "^6.13.2", 28 | "babel-eslint": "^6.1.2", 29 | "babel-loader": "^6.2.5", 30 | "babel-plugin-lodash": "^3.2.8", 31 | "babel-plugin-transform-class-properties": "^6.11.5", 32 | "babel-plugin-transform-object-rest-spread": "^6.8.0", 33 | "babel-preset-es2015": "^6.13.2", 34 | "babel-preset-react": "^6.11.1", 35 | "css-loader": "^0.23.1", 36 | "eslint": "^3.3.1", 37 | "eslint-config-airbnb": "^10.0.1", 38 | "eslint-plugin-import": "^1.13.0", 39 | "eslint-plugin-jsx-a11y": "^2.1.0", 40 | "eslint-plugin-react": "^6.1.2", 41 | "file-loader": "^0.9.0", 42 | "style-loader": "^0.13.1", 43 | "typings": "^1.3.2", 44 | "webpack": "^1.13.2", 45 | "webpack-dev-server": "^1.14.1" 46 | }, 47 | "dependencies": { 48 | "aphrodite": "^0.5.0", 49 | "classnames": "^2.2.5", 50 | "github-markdown-css": "^2.4.0", 51 | "hammerjs": "^2.0.8", 52 | "highlight.js": "^9.6.0", 53 | "jquery": "^2.2.4", 54 | "js-yaml": "^3.6.1", 55 | "lodash": "^4.15.0", 56 | "marked": "^0.3.6", 57 | "materialize-css": "^0.97.7", 58 | "react": "^15.3.1", 59 | "react-dom": "^15.3.1", 60 | "react-redux": "^4.4.5", 61 | "redux": "^3.5.2", 62 | "redux-logger": "^2.6.1", 63 | "redux-thunk": "^2.1.0", 64 | "superagent": "^2.2.0" 65 | }, 66 | "babel": { 67 | "presets": [ 68 | "es2015", 69 | "react" 70 | ], 71 | "plugins": [ 72 | "lodash", 73 | "transform-object-rest-spread", 74 | "transform-class-properties" 75 | ] 76 | }, 77 | "eslintConfig": { 78 | "parser": "babel-eslint", 79 | "extends": "airbnb", 80 | "root": true, 81 | "env": { 82 | "browser": true 83 | }, 84 | "globals": { 85 | "$": true 86 | }, 87 | "rules": { 88 | "react/jsx-space-before-closing": "off", 89 | "no-return-assign": "off", 90 | "react/require-extension": "off" 91 | } 92 | }, 93 | "scripts": { 94 | "dist": "NODE_ENV=production webpack", 95 | "test": "npm run-script lint", 96 | "webpack-watch": "webpack --watch", 97 | "serve": "webpack-dev-server", 98 | "lint": "eslint .", 99 | "prepublish": "npm run dist" 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/legendecas/material-swagger-ui/e9c5c0342a908d853f8e0e9693dc08c84387b369/screenshot-1.png -------------------------------------------------------------------------------- /src/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet, css } from 'aphrodite'; 3 | import { Provider } from 'react-redux'; 4 | import qs from 'querystring'; 5 | import store from './store'; 6 | import action from './action/definition'; 7 | import ConnectedHeader from './container/ConnectedHeader'; 8 | import ApiDescriptionContainer from './container/ApiDescriptionContainer'; 9 | import Footer from './component/Footer'; 10 | import ConnectedDrawer from './container/ConnectedDrawer'; 11 | import TaggedEntrypoints from './container/TaggedEntrypoints'; 12 | 13 | const style = StyleSheet.create({ 14 | app: { 15 | display: 'flex', 16 | minHeight: '100vh', 17 | flexDirection: 'column', 18 | }, 19 | main: { 20 | marginTop: '5vh', 21 | display: 'flex', 22 | flexDirection: 'column', 23 | flex: '1 0 auto', 24 | width: '90%', 25 | }, 26 | apiContent: { 27 | marginTop: '10vh', 28 | display: 'flex', 29 | flexDirection: 'column', 30 | }, 31 | }); 32 | 33 | const App = () => ( 34 | 35 | 36 | 37 | 38 |
39 | 40 |
41 | 42 |
43 |
44 |