luckymarmot / paw-swaggerimporter Goto Github PK
View Code? Open in Web Editor NEWSwagger/OpenAPI 2.0 Importer for Paw
Home Page: https://paw.cloud/extensions/SwaggerImporter
License: MIT License
Swagger/OpenAPI 2.0 Importer for Paw
Home Page: https://paw.cloud/extensions/SwaggerImporter
License: MIT License
error message: undefined is not an object (evaluating '_store$getIn.variable')
steps to reproduce:
import URL: https://raw.githubusercontent.com/Sylius/ShopApiPlugin/master/doc/swagger.yml
the error seems to be caused by this :
security: - {} - bearerAuth: []
on line 431
On this Swagger file:
https://raw.githubusercontent.com/acquia/waterwheel.js/master/test/sample/swagger.example.json
I'm getting this error:
Import Failed
A JavaScript exception was raised. Open the Extension Console (under the Window menu) for more information.Error: Invalid Swagger File (invalid schema / version < 2.0):
ValidationError: String does not match pattern: ^/
Trying to import this swagger definition https://gist.github.com/databus23/848f60539956284e504605d4d9c01bc1
I noticed that the securityDefinition is not correctly mapped:
It seems the header name is ignored. It should be X-Auth-Token
not Authorization
.
This is unfortunate because I need to change it for every request after importing it.
I am importing an OpenAPI file, i can see all the requests but the tags are gone, I mean the requests are not grouped by tags as in Swagger editor.
Is this a bug or am I missing something ?
I'm trying out the importer, version 2.2.11.
If I try to import this url http://petstore.swagger.io/v2/swagger.json it shows this error message:
Is there some sort of incompatibility?
It would be great if this could be updated to support the Open API 3.0 spec. The main missing feature from Swagger 2.0 spec which is important for us is JSON encoded objects for query string parameters.
When I use basepath "/"
and resourcepath beginning with /
the importer ends up with //
for all the resources. Shouldn't this be prevented, or do I need to define the paths differently in the swagger scheme?
Hello.
When I try to import pretty simple swagger yml file I get success message.
But when I go for each API endpoint I see a warning which means that import was not so successful after all.
Each my path contains blocks like this
consumes:
- "application/json"
produces:
- "application/json"
After import I got this warning
Parameter 'Content-Type': '' is not a valid enumeration value of '[application/json]'
You can see it here
If a schemas has broken references in it (a reference to an item that doesn't exists) the importer crashes because it expects that object.
@JonathanMontane I can pass you an example JSON that crashes tomorrow…
The swagger file from: https://ergebnis.radball-bw.de/swagger.json fails with schema errors. Is there any kind of debug log available to find the reason? the file works perfectly in swagger-ui
like this
"paths": {
"/pets": {
"post": {
"tags": [
"pet"
],
"summary": "Add a new pet to the store",
"description": "",
"operationId": "addPet",
"consumes": [
"application/json"
],
"produces": [
"application/json;charset=UTF-8"
],
...
Error: Invalid Swagger file (invalid schema or schema version < 2.0)
remve charset
"produces": [
"application/json"
],
will succeed
Hey guys,
I'm having a problem importing swagger 2 files into Paw. I've got the latest importer and I've tried with several swagger files, both directly from URL and files.
To replicate the issue, try with https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/api-with-examples.json
I've attached a screen shot of the error I'm getting.
I'm not sure if I'm missing something, but whenever I import a Swagger file none of the requests have any information about the body. (For POST/PUT/PATCH requests.)
Using the Pet Store definition on Swagger UI as an example, you can see that they can show an example body which helps when filling out the request. However importing the corresponding Swagger file in Paw using this extension results in empty body fields.
Would it be possible to implement body field examples like Swagger UI does? You could directly put them in the body field, and they'd be a great help as starting templates IMHO.
Hi,
I'm getting current error when trying to import a swagger defintion.
JS Exception Line 11507. Error: Invalid Swagger File (invalid schema / version < 2.0):
ValidationError: String does not match pattern: ^[^{}/ :\\]+(?::\d+)?$
I checked the following:
Small excerpt:
{
"swagger" : "2.0",
"info" : {
"title" : "Endpoints documentation",
"license" : {
"name" : "Apache 2.0 License",
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
}
...
i use environment variables for my requests. when i tried exporting it to swagger, i'm getting
Javascript Exception: undefined is not an object (evaluating 'content.length') ){
...
}
is there a way for me to export my requests to swagger definition when using environment variables?
The OpenAPI spec allows for the schemes:
property to be an array of strings, see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schema
If a Swagger file includes something like this
schemes:
- https
- http
the importer apparently ignores both values and shows this instead:
It would be great to import not just from plain json file but from swgger-ui url itself.
There are several scenarios why it may be useful:
Also, not sure about correct place to ask, but: is it possible to auto-refresh endpoints definitions to keep them in sync with actual spec?
The travis build and development instruction fail because of the missing Makefile.
swagger 2.0 allows me to specify possible parameter values (for headers, queries and so on) as an enum.
when importing, the values are not imported correctly. is this possible or does the paw api not support enum values?
example
"parameters": {
"headerX": {
"name": "headerX",
"in": "header",
"required": true,
"default": "value1",
"type": "string",
"enum": [
"value1",
"value2",
"value3"
]
}
when using swagger references such as:
post:
tags:
- Shared
operationId: CallGeneric_PostInternal
consumes:
- application/json
- text/json
- application/xml
- text/xml
- application/x-www-form-urlencoded
produces:
- application/json
- text/json
- application/xml
- text/xml
- text/javascript
- application/javascript
- application/json-p
parameters:
- name: url
in: path
required: true
type: string
- name: payload
in: body
required: true
schema:
$ref: '#/definitions/System.Object'
responses:
'200':
description: OK
schema:
$ref: '#/definitions/System.Object'
deprecated: false
see $ref: '#/definitions/System.Object'
that links to:
definitions:
someapi.Endpoints.Apps.Authentication.AuthenticationRequest:
required: ['']
type: object
properties:
userName:
type: string
password:
type: string
System.Object:
required: ['']
type: object
properties: {}
is not correctly rendered as object {username:'',password:''}
After the import of a Swagger file there are only groups in Paw, no actual requests. This is what the console shows:
Event Loaded extension com.luckymarmot.PawExtensions.SwaggerImporter
JS Error @Serializer failed with error TypeError: Objective-C blocks called as constructors must return an object. {"line":2882,"column":108} [native code]
[native code]
_castParameterToDynamicString
_toDynamicString
_generateUrl
_createPawRequest
_importPawRequest
__iterate
_applyFuncOverGroupTree
__iterate
_applyFuncOverGroupTree
_importPawRequests
promiseReactionJob@[native code]
JS Error @resolver caught error TypeError: Objective-C blocks called as constructors must return an object. {"line":2882,"column":108} [native code]
[native code]
_castParameterToDynamicString
_toDynamicString
_generateUrl
_createPawRequest
_importPawRequest
__iterate
_applyFuncOverGroupTree
__iterate
_applyFuncOverGroupTree
_importPawRequests
promiseReactionJob@[native code]
Hi.
i'm getting the following error, when trying to import one of our products' swagger files:
JS Exception Line 7658. TypeError: Parameter 'url' must be a string, not object
I'm guessing it has something to do with the fact that this appears in the content of the JSON file:
"url":{"type":"string"}
(this is part of our model)
Is there any way to get a proper grouping of the requests by their path?
Example imported with Paw-SwaggerImporter:
(Taken from: http://petstore.swagger.io/v2/swagger.json)
I'd like to see groups per path-component. I was wondering, that Paw doesn't do it itself. Maybe I'm doing something wrong?
I'd expect now three main-groups:
And the whole thing recursive, so that for example
would be grouped under the main-group
Grape Swagger got a HTTP API which return a JSON~
Would it be possible to create an environment and set the host from the swagger.json as variable into the requests? This would allow to import swagger files and run against different servers (dev,stage,prod) without changing every request
It would be really nice to be able to easily change the protocol and host for an entire imported document.
Maybe import host and protocol as environment variables?
Our swagger description is spread across several .yml-files, using something like
in: "formData"
$ref: "#/folder/secondfile.yml"
to pull in the real data. But this importer can only take a single file and doesn't follow the references. Would it make sense to add this as a feature, or is there some kind of tool I could use as preprocessor before the import?
Trying to import this swagger definition https://gist.github.com/databus23/848f60539956284e504605d4d9c01bc1
Not sure what's supposed to be supported but I'm finding no body parameters get imported.
E.g., in this case:
'/groupMailboxes/{groupMailboxID}/categories':
parameters:
- name: groupMailboxID
in: path
description: The ID of the group mailbox.
required: true
type: integer
put:
description: >-
Update the categories associated with a group mailbox. Categories are
added and removed as required.
consumes:
- application/json
tags:
- Group mailboxes
- Categories
produces:
- application/json
security:
- basicAuth: []
parameters:
- name: body
in: body
description: What the categories list for the group mailbox should be.
required: true
schema:
type: object
properties:
categories:
type: array
description: The category IDs.
items:
type: integer
It would be nice to have the ability to import a swagger definition given a URL.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.