Git Product home page Git Product logo

openapi-gui's People

Contributors

brandonmwest avatar danielruf avatar darrylkuhn avatar dependabot[bot] avatar drekorik avatar luizvaz avatar manmohan-99 avatar mikeralphson avatar politician avatar yogendra 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  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  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

openapi-gui's Issues

Schemas and Response Bodies

This is either a usability issue or a documentation issue...

Is there no way to leverage a defined Schema as a Request Body? I'm hoping that there is and that I've missed it. If there isn't a way to do this now, it seems like a pretty solid feature to add as it would save a ton of time vs creating new objects in the Schema Editor (uffda, that editor is brutal to use).

btw, I really dig what you're doing here. I've been a swagger user for years, and have always wanted a GUI to create the json vs the other way around.

Main tab show empty content.

Currently, when I access https://mermade.github.io/openapi-gui/ with the default definition, the Main tab show empty page. While other tab like schemas/header/upload/tags works without problem.

Create a new response with some usability issues.

This is a great tool and thanks for your work. And I got some usability issue, if anything misunderstand, please correct me. Thanks!

After create a new operation with default value, then create a new response. There are some issues:

  • the layout for operation is too wide and without scroll bar to see the full part the html gui. Can you add a scroll bar to scroll from left to right.
  • the default response has no schema edit action support. It only show "status code" and "Description". User cannot create a new media type. It's better to provide a default media type.
  • the duplicate button for response does not work. It will show error on js console
Uncaught ReferenceError: duplicateResponse is not defined
    at click (eval at Tn (vue.min.js:6), <anonymous>:3:14340)
    at e (vue.min.js:6)
    at HTMLAnchorElement.t._withTask.t._withTask (vue.min.js:6)
  • for existing media type of the response. I don't find any way to change the schema.

All these issues can reproduce on online editor https://mermade.github.io/openapi-gui/#

Extend backend by proxying API to swagger2openapi

Now that we have an npm module (thanks @yogendra) and potentially a docker container, maybe it makes sense to add swagger2openapi to the node_modules so conversions and validations can be done by the in-built webserver/backend without having to call out to and depend on apps deployed to heroku or appspot , which might not always be available.

Questions:

  • How to avoid code duplication with openapi-webconverter?
  • How to identify we have been served by the intelligent back-end and not by file:// or a simple server like github pages?

load YAML or JSON files

Thanks for the cool tool.
I don't quite understand the documentation.
Is it possible to use open-api as external dependency to edit my swagger/openapi definition files (YAML or JSON)?

Response status codes not working

This problem can be reproduced by adding a new response status code in path operation. When you add a new one after a default 200 code, it increments (201, 202...). Then, I change the incremented value (eg 201 to 401) and add a description. After that, status code changes back to incremented 201, and when i change it back and save, it is still 201 in the resulting json/yaml.

Recursive schema reference errors

Loving the openapi-gui so far and would like to use it, but some of my schemas have recursive references at the child level and at the grandchild level. This causes callstack errors in Chrome and "too many recursion" errors in Firefox when clicking a schemas edit icon.

Any chance you can add in child schema tracking to detect recursion and render recursive schema children, grandchildren, etc... with a placeholder like they do in redoc?

Thanks!

Duplicating a path bug

Duplicating paths results into duplicating operation urls when editing (same id's with duplicated operations or something?). Steps to produce:

  1. I created a path and 1 operation under it and gave both a URL, for example /docs
  2. I clicked the duplicate -icon on the path level and it created a /newPath.
  3. I changed the /newPath to /emails
  4. I then edited the operation to /emails and that changed the original paths operation to emails, too while I edited

[v3] Page will not load after importing invalid spec

I removed the info section in the import box and imported the spec. The import was successful (according to the popup modal), but when I reloaded the page it just turned blank and the console contained errors. Also, the console had TypeError: openapi.info is undefined right after importing.

Steps to reproduce:

  1. Remove the whole info and/or servers section from the JSON box in the Upload tab
  2. Click Load Definition
  3. Refresh the page

The problem seems to be that the uploaded definitions aren't properly validated and/or fixed.

Only operations with descriptions are expandable

In Firefox and Chrome

  1. Go to petstore sample
  2. Add an operation or click to expand any operation that does not have a description.
  3. Operation does not expand.

There is an issue with the default description logic on creation and handling if the operation doesn't have a description. Method.js line 122 needs this info.

Importing an exported file doesn't work

Hey Guys,
this should be pretty easy to fix:
I was working on a project from scratch, exporting it as json (download).
After some changes, the import failed, because the file didn't specify "openapi": "3.0.0", so this seems to be missing in the exporter or I was doing things wrong

Edit: The same problem happens when trying to validate the schemas using the Wizards, so even though my file now has an "openapi" directive, the exporter is swallowing it thus making the validation fail

support for OpenAPI v3 extensions

As you may know, we currently host a copy of openapi-gui on our SmartAPI project: http://smart-api.info/openapi-gui/. Thanks for making it available.

SmartAPI defines a set of OpenAPI extensions to support biomedical-field APIs, so we are wondering how much work is needed in order to add the extra "x-" extension fields into the openapi-gui web forms.

Ideally, it would be nice to allow us to define extra schemas in a separate file like "extensions.js" (under openapi-gui/data folder), then it can be merged into "jsonSchemaDraft4" defined in "static.js". Depending on how the rendering code works, those extra extension fields can then be rendered in the web forms.

Settings Link is broken

Problem:
Nothing happens on button click

How to reproduce:

  1. docker run -dit -p8080:3000 mermade/openapi-gui
  2. Open localhost:8080
  3. Click on Settings

Error in log:

VM725:3 Uncaught ReferenceError: settings is not defined
    at click (eval at Tn (vue.min.js:6), <anonymous>:3:430)
    at e (vue.min.js:6)
    at HTMLAnchorElement.t._withTask.t._withTask (vue.min.js:6)
click @ VM725:3
e @ vue.min.js:6
t._withTask.t._withTask @ vue.min.js:6

Tested on:
Google Chrome Version 73.0.3683.86 (Official Build) (64-bit) with no extensions on Linux and Windows

Can't create a HTTP Authentication security scheme

I see #32 talks about the same thing but for me it seems glitched.

All the other options change the form fields, but the http one does nothing. If I save one with http, you cannot edit it.

I guess I can just add this manually its fine.

components:
  securitySchemes:
    bearerAuth:            # arbitrary name for the security scheme
      type: http
      scheme: bearer
      bearerFormat: JWT  

Migrate js/*.js to dependencies

We should not host the thirdparty / vendor code in there but use npm to put them there or create a bundle (using webpack or rollup).

Invalid `license` and `externalDocs` keys are created

Issue:
OpenAPI-GUI automatically creates empty info -> license and paths -> [/path] -> externalDocs fields, which are invalid per the OpenAPI 3.0 specs. The license object requires a name field, and externalDocs requires a url field.

Steps to reproduce:
Load a .yaml file with no license field nor externalDocs field but with paths. Save file.

Expected behavior:
Don't create these fields if they don't already exist. 😄

项目很不错

项目很不错,建议使用element界面组件库加上数据库来开发,
国内有个sosoapi,界面还可以,不过是Java开发的.

When editing Schemas, changes are not saved

I really like this editor, however, I have found an issue, it does not save schema edits in the schema editor.

Using Chrome and Firefox:

  1. Click Schemas
  2. Click Edit Schema
  3. Insert or Edit an existing property
  4. Click Save
  5. Click Close
  6. Click Export Json

After reviewing the Json export, I do not see any of my changes. Appreciate the help in solving this issue.

Make Live-version work

The version available at https://mermade.github.io/openapi-gui/ is horribly buggy.

You cannot edit a just-created schema.
Proof:
Open https://mermade.github.io/openapi-gui/ go to Schemas, click + to add a new one, give it a name, then click on the edit icon and see it break.

You cannot create a Request body for new operations. Just try to create a new path and for that create an operation and try to add a request body.

Other elements might be buggy too, I didn't bother testing them.

Just try it out for yourself. I tested it with Firefox and Chrome.

Cheers!

parameters type of array not work

  1. Parameters type of array (from loaded scheme) not expand
 "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status values that need to be considered for filter",
                        "required": true,
                        "explode": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "enum": [
                                    "available",
                                    "pending",
                                    "sold"
                                ],
                                "default": "available"
                            }
                        }
                    },

image

  1. Parameters of type array created in gui-editor
    a) generate not valid scheme
  {
                        "name": "newParam",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "type": "array",
                        "items": {
                            "schema": {
                                "type": "string"
                            },
                            "type": "string",
                            "default": "newValue2",
                            "enum": [
                                "newValue1",
                                "newValue2"
                            ]
                        }
                    }          

b) type Array rewrite by type String
image

Unable to config callback operation

The issue is the 'Callbacks' at 'Request Body' under Main > Path > Operation unable to config Operation because when trying to navigate to any tab of callback's operation, the screen will go to selected options under path's operation not the callback's operation

Enum not correctly exported

Steps to reproduce:

  1. set up an enum as Query param:

  1. Export as YAML (or JSON)

  1. Open the YAML file in VS code with openapi-lint extension installed ;) (or swagger editor): errors!

Expected result:
Both enum and default should sit under schema.

Thanks for the great tools @MikeRalphson , let me know if you need anything else from me

dependencies needs babel-runtime

I had to add "babel-runtime" to the dependencies in package.json to get this to run.

Otherwise it would throw:
Error: Cannot find module 'babel-runtime/core-js/json/stringify'

I'm using:

  • Linux 4.4.0-130-generic
  • node v6.14.3
  • npm v3.10.10

Shows no media type for a $ref response

I have an OpenAPI 2.0 document that defines default media types

schemes:
  - https

consumes:
  - application/hal+json
  - application/json

produces:
  - application/hal+json
  - application/json

The default produces media type is used for the in-line 2xx responses.
However, for operations that use $ref for a response, openapi-gui thinks the response does not have a media type, despite the default produces.

      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/blahblahblah'
        '400':
          $ref: '#/responses/400'

and later

responses:
  '400':
    description: >-
      Bad Request. 
      The request body or one or more of the query parameters was not well
      formed.  The `_error` field in the response will contain details about the
      request error.
    schema:
      $ref: '#/definitions/errorResponse'

See screen shot:
screen shot 2018-11-28 at 1 11 36 pm

I'm using openapi-gui "version": "1.2.2",

settings(), security page, etc. Are they ready?

Hi, I've just started using this project. But receive different errors, on different pages. I'm not sure, I do something wrong or project not ready yet?

  1. Click on settings
  2. Change any security schemes, and try to apply to all paths.

screen shot 2018-05-24 at 10 13 35 pm

Upload Option Gone

As a side effect of the last few commits, the upload option (along with most of the option bar) has disappeared. This seems to have happened literally in the last few minutes, as of the time of this posting.

Using Firefox on Linux, if it matters.

Cannot edit schema

Version: latest at time of writing.
Browser: Chrome latest at time of writing.
Screen: 24" screen

Cannot edit a schema unless there are enough schema's already in the list.
Requires a min. of 5 schema before you can edit the contents properly.

screenshot from 2019-01-12 15-19-27
screenshot from 2019-01-12 15-22-37
screenshot from 2019-01-12 15-23-57

Taking the flexbox and overflow hidden off seems to fix it (there is a js error thought too though, don't know if this is related):
screenshot from 2019-01-12 15-30-02

Media type at request body does not reflect value entered

Thank you for the amazing projects :) I and my team so appreciate on this.

I found some of the issues on this while I played around on this and would like to contribute on this to make it better.

The issue is the 'media type' at 'Request Body' under Main > Path > Operation does not reflect the edited value when switching to Export JSON/YAML tab

Schemas Page Is Blank

When opened, the Schemas page is entirely blank. This issue was not present a few days ago, and appears to have been introduced in the last several commits.

Drag-and-drop paths?

Hi,

Great project, thank you! 😄

Apologies if I'm being slow... is there a way to easily shuffle the order of paths at all in the Main tab?
Or have them re-order alphabetically, send to top/bottom or something?

But thanks again, great stuff.

Tim

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.