luckymarmot / Paw-OpenAPI3Importer

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

not work on openapi 3.0.3 #11

Closed ghost closed 3 years ago

ghost commented 3 years ago

i used this rep: https://github.com/tfranzel/drf-spectacular

it have a url: http://127.0.0.1:8000/api/schema/

in paw, import error:

image

in postman, import ok

image

pongstr commented 3 years ago

hello @stfenjobs could you please provide an example of your schema?

kamontat commented 3 years ago

OpenAPI 3.0.2 didn't work as well. https://gist.github.com/kamontat/c7a7ad9ed76f9c5c423e438e88db505a

pongstr commented 3 years ago

OpenAPI 3.0.2 didn't work as well. https://gist.github.com/kamontat/c7a7ad9ed76f9c5c423e438e88db505a

@kamontat the gist doesn't seem to be a valid OpenAPI v3.0.x schema. The plugin doesn't accept fragments, but a whole document.

mshahat commented 3 years ago

same here, not working for me. Perhaps a good idea for Paw to complain if it can't import a specification! and if you guys could document any restrictions or known issues! Thanks

pongstr commented 3 years ago

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

ghost commented 3 years ago

@pongstr thank you , its work , but , the host is not my host, it show https://echo.paw.cloud

my host is http://127.0.0.1:8000 but when i import , the host change to https://echo.paw.cloud

pongstr commented 3 years ago

@stfenjobs thanks for testing right away. I might need to figure out how I can make the host a dynamic variable. But for now, you can define your document's server like so:

---
openapi: 3.0.2
info:
  title: Swagger Petstore - OpenAPI 3.0
  description: "..."
servers:
  - url: 'https://petstore3.swagger.io' ## For now this will replace the default url (https://echo.paw.cloud)
ghost commented 3 years ago

@pongstr

thank you very much