Git Product home page Git Product logo

paw-swaggerimporter's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

paw-swaggerimporter's Issues

No tags when importing from Swagger

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 ?

Import failed - undefined is not an object

I just tried importing our Swagger file with the new version that ships with 3.1 but ran into the below error. It's probably not easily possible for me to share the entire file, is there anything else I can do to help debugging?

screenshot 2017-04-26 15 41 36

Support Open API 3.0

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.

root basepath

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?

Failed to correctly import swagger yml file due to Content-Type error

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

Ignore broken schemas

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…

when "produces":["application/json;charset=UTF-8"] , it will import fails

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

Show example in body

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.

Importer fails on ValidationError

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:

  • version is 2.0
  • Swagger-ui works.

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"
    }
...

cannot export when using environment variables

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?

Feature request: Import from swagger-ui spec

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:

  1. User don't know the url to .json file but know swagger-ui endpoint.
  2. User don't have .json spec in file but it's included directly in swagger-ui and auto-regenerated each time, i.e:
    swagger_ui_spec_in_jscode

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?

Makefile missing

The travis build and development instruction fail because of the missing Makefile.

support string parameters with possible values as enum

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"
      ]
    }

definition references not correctly parsed

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:''}

Import not working

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]

TypeError: Parameter 'url' must be a string, not object

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)

Feature Request: Group by Path

Is there any way to get a proper grouping of the requests by their path?

Example imported with Paw-SwaggerImporter:
screen shot 2016-03-14 at 05 10 50
(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:

  • pet
  • store
  • user

And the whole thing recursive, so that for example

  • /store/order/
  • /store/order/{orderId}

would be grouped under the main-group

  • store

Import host information as environment

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

Multifile-import

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?

Body parameters?

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

URL Import

It would be nice to have the ability to import a swagger definition given a URL.

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.