GithubHelp home page GithubHelp logo

arx-8 / swagger-viewer Goto Github PK

View Code? Open in Web Editor NEW
59.0 3.0 15.0 2.78 MB

Chrome Extension for Swagger-UI

Home Page: https://chrome.google.com/webstore/detail/swagger-viewer/nfmkaonpdmaglhjjlggfhlndofdldfag

License: Apache License 2.0

HTML 0.01% JavaScript 0.19% TypeScript 99.80%
typescript chrome-extension react swagger openapi

swagger-viewer's Introduction

⚠️Sorry! No longer supported.⚠️

Dear Community,

Due to time constraints, I'm archiving the swagger-viewer repository and ending support. Grateful for all contributions, please feel free to fork and continue the project. Thank you for your understanding.


swagger-viewer

Overview

This is Chrome Extension.
https://chrome.google.com/webstore/detail/swagger-viewer/nfmkaonpdmaglhjjlggfhlndofdldfag

Shows swagger yaml/json rendered by Swagger-UI.
This extension replace swagger code into preview html in GitHub.
Works completely offline.

Demo

Easy to convert

Demo

Easy to expand / collapse

Demo

Spec.

  • Supported sites.
    • GitHub
  • Supported OpenAPI ver.
    • 2.0
    • 3.0
  • Supported file ext.
    • yaml
    • yml
    • json

Usage

  1. Install from Chrome Web Store
  2. Open swagger page in GitHub.
  3. Click this app icon.
  4. Have a good development!

For developer

See README-develop.md

swagger-viewer's People

Contributors

arx-8 avatar cubenoy22 avatar yosukedoke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

swagger-viewer's Issues

buildしたzip内にtsファイルまで出力されている

$ npm run build chrome

...

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  scripts/contentscript.js (1.24 MiB)
  ..\..\packages\swagger-viewer.v0.0.3.chrome.zip (421 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  scripts/contentscript (1.24 MiB)
      scripts/contentscript.js


WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

Swagger-viewer not working with new GitHub Code View beta

I am testing out the new Code View on GitHub, which recently became public beta.
However, I noticed that swagger-viewer is not working with the new Code View.

image

Both the new Code View and swagger-viewer are useful, so I would like to be able to use them simultaneously.

Allow opening local files

Often, swagger files are not hosted on github. Would be nice to just enable the viewer for other locations like local disc.

Cause error

I am trying to display swagger by extension in yml on github, and now I get the following error message.

How can I configure it to fix the problem?

Error: Unexpected DOM. Probably GitHub has been updated. Please contact the developer or wait until the extension is fixed. selector1: "#repo-content-turbo-frame div.Box-body table", selector2: "#repo-content-pjax-container div.Box-body table"

Make the DOM selector configurable

  • It took a very long time for the Chrome WebStore to review my application.
  • Allow users to take emergency measures themselves in case of GitHub's DOM changed.

Error in event handler: Error: Unexpected DOM. selector: "div.repository-content > div.Box > div.Box-body > table

@arx-8
いつもありがたく使わせて頂いています。
以下のエラーが発生しましたので、報告させていただきます。
(issueが日本語だったので、日本語で失礼します。)

本日、Github上で利用したところ以下のエラーが発生してViewの生成に失敗しました。
おそらく、GithubのDOMに変更があったのだと思いますが、対応よろしくお願いします。

Version

1.2.1

Error message

Error in event handler: Error: Unexpected DOM. selector: "div.repository-content > div.Box > div.Box-body > table"

How to build on local machine?

Thank you for creating an awesome tool!

ss-20190501-023309

I tried to use the swagger-viewer on my private repository. but I got an error.

I'd like to debug about this error on my local machine.
I already succeed to run $ npm install. but I don't know how to build?

just run tsc?

ESLint + Prettier

# ESLint
npm i -DE eslint @typescript-eslint/eslint-plugin eslint-plugin-jest
npx eslint --init

# Prettier
npm i -DE prettier eslint-config-prettier eslint-plugin-prettier

ビルドしたzipをChrome webstoreにアップロードするとエラーになる

再現方法

  • npm run build chrome
  • 生成されたzipをデベロッパー ダッシュボードでアップロード
    • もしくはzip解凍、「パッケージ化されていない拡張機能」として読み込む
  • エラーメッセージ「パッケージが無効です。詳細: コンテンツ スクリプトのファイル「scripts/contentscript.js」を読み込むことができませんでした。UTF-8 でエンコードされていません。」が出る

参考

暫定回避

  • npm run dev chrome
  • dist/chromeフォルダをzip圧縮
  • ↑をデベロッパー ダッシュボードでアップロード

OAuth2

Was trying to use the rendered swagger in GitHub to call the API. It seems the authorization via Oauth2 passes a redirect URL of

https://github.com/oauth2-redirect.html

Can you provide some guidance on how to get the token back into this view so I can call APIs directly from the chrome extension view.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.