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

Import is empty - almost #12

Open
jezzdk opened this issue Jun 16, 2021 · 11 comments
Open

Import is empty - almost #12

jezzdk opened this issue Jun 16, 2021 · 11 comments

Comments

@jezzdk
Copy link

jezzdk commented Jun 16, 2021

First off, I dont have a menu item in "File" that says "Import OpenAPI 3", so I've tried the File, Text and URL options instead. The result is the same.

This is my json file: https://gsv-navision-api.herokuapp.com/docs/api.json

This is how it looks after an import:

Screenshot 2021-06-16 at 15 32 53

All the request groups are empty and the only created request is deficient.

@imclint21
Copy link

Hi,

The same problem, I get this message:

Screenshot 2021-06-16 at 17 17 01

@mshahat
Copy link

mshahat commented Jun 17, 2021

the same 👎 , Paw seems to be useful for some people ... I've paid for it 3 years ago and yet every time I try to make use of it , it disappoints. Response times on issues on twitter and emails are really slow. will be great news if we get inputs on this.

Thanks in advance

pongstr added a commit that referenced this issue Jun 19, 2021
this commit refactors PawURL class, where it utilizes URL class
instead of RegEx to detect a valid url.

Fixes for issue:
- #11: import is empty - almost
- #12: not work on openapi 3.0.3
@pongstr
Copy link

pongstr commented Jun 19, 2021

@jezzdk @clintnetwork I've stub a patch to potentially fix your issues. Please see 0.1.1-beta.2, Downloadable Zip

Let me know if there are any other issues, we'll try our best to get this extension stable. Thanks!

pongstr added a commit that referenced this issue Jun 19, 2021
this commit refactors PawURL class, where it utilizes URL class
instead of RegEx to detect a valid url.

Fixes for issue:
- #11: import is empty - almost
- #12: not work on openapi 3.0.3
@imclint21
Copy link

Hi

Still have this message:

Import process has successfully completed but no new items have been added to your document.

My Open API swagger file is: https://pastebin.com/raw/uV9TeVz8

@pongstr
Copy link

pongstr commented Jun 21, 2021

hi @clintnetwork, I tried to validate your schema using these openapi validator tools:

it seems that "paths.events.responses" cannot be an empty object (see the required field here), adding a description field should fix the issue like so:

{
  ...
  "paths": {
      "/events": {
      "summary": "Events",
      "get": {
        "tags": [
          "Events"
        ],
        "summary": " WebSocket Real-Time Notifications (SignalR)",

        // Please see OpenAPI docs in regards to responses: https://swagger.io/specification/#responses-object 
        // - The default MAY be used as a default response object for all HTTP codes that are not covered individually by the specification.
        // - The Responses Object MUST contain at least one response code, and it SHOULD be the response for a successful operation call.
        "responses": {

          // In addition, a response object cannot be an empty object, the "description" 
          // field is required see https://swagger.io/specification/#response-object 
          "default": { 
            "description": ""
          },
 
          // optional responses...

          "200": {
            "description": "..."
          },

          "401": {
            "description": "..."
          }
        }
      }
    }
  }
}

after these corrections, the document imports the requests successfully. Please do note though that the plugin right now doesn't have a way to fill-in required fields (and perhaps we should add that feature as well).

thanks

@jezzdk
Copy link
Author

jezzdk commented Jun 21, 2021

@pongstr I've been able to import my schema with the version you linked to. However I still don't have the option to explicitly import OpenAPI 3. I get an option to select the format after the import has started, however, because it fails to recognise it as OpenAPI 3.

@pongstr
Copy link

pongstr commented Jun 21, 2021

@jezzdk I understand your issue. I'll ask around with the team on how we can add the option to the File Menu, and will get back with you as I figured something out.

@imclint21
Copy link

Oh okey, thank you!

In fact I use swashbuckle and I created a custom endpoint so I surely do mistakes.

@imclint21
Copy link

imclint21 commented Jun 21, 2021

Finally I removed this /events endpoint, the import is done but I only see that:

Screenshot 2021-06-21 at 12 21 21

@pongstr
Copy link

pongstr commented Jun 21, 2021

@clintnetwork please try to validate your openapi document first (please see the validators tools above), as pointed out earlier, this extension does not support fixing invalid documents/schemas, or filling-in required object fields.

@philprime
Copy link

Hi, I also get the message No items imported when loading the official Apple App Store Connect API documentation.

It can be found here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants