luckymarmot / Paw-OpenAPI3Importer

OpenAPI 3 (Swagger 3) Importer for Paw
MIT License
18 stars 3 forks source link

Import is empty - almost #12

Open jezzdk opened 3 years ago

jezzdk commented 3 years ago

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 commented 3 years ago

Hi,

The same problem, I get this message:

Screenshot 2021-06-16 at 17 17 01
mshahat commented 3 years ago

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 commented 3 years ago

@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!

imclint21 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

@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 commented 3 years ago

Oh okey, thank you!

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

imclint21 commented 3 years ago

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

Screenshot 2021-06-21 at 12 21 21
pongstr commented 3 years ago

@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 commented 2 years ago

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

It can be found here: