yarax/swagger-to-graphql

also erros...

rmros opened this issue · 6 comments

rmros commented

@yarax please check this swagger file:
https://drive.google.com/file/d/1fKep_kfEoLGm-rbjR6jByx1_ZzNlLPoG/view?usp=sharing
please try convert to graphql
i cant solve
thanks

yarax commented

Can you please post the error here

rmros commented

They are too much,
What's is empty : string?
It's becouse circular object?

0xR commented

There were some issues with { empty: string} being returned by swagger-to-graphql. I just released a fix for this in 1.7.

As for your example I noticed that it is missing the definitions for invoices and roles_permissions. In 1.7 it will give an error for this situation. The best solution would be to provide a complete swagger file.

0xR commented

I also noticed you have some parameters looking like this:

 "parameters": [
               {
                  "name": "email",
                  "in": "body",
                  "description": "user to create",
                  "required": true,
                  "type": "string"
               }
            ],

this is not a valid swagger file. It should be like this:

 "parameters": [
               {
                  "name": "email",
                  "in": "body",
                  "description": "user to create",
                  "required": true,
				  "schema": {
                    "type": "string"
                  }
               }
            ],

See the json schema here:
https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json#L501

And the spec here:
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameter-object

image

0xR commented

I noticed that your example file specified an array of types for the items of an array type. This appears to be valid. I fixed this in 1.8. For now I'll the first type of list of types is picked. In the future we could support a union type.

Example:

"service_instance_properties": {
                     "type": "array",
                     "items": [
                        {
                           "$ref": "#/definitions/service_instance_properties"
                        }
                     ]
                  },

Also I made sure that file input doesn't crash swagger-to-graphql. It is still not supported though. See #19

Both of these fixes are released as 1.8

0xR commented

Closing this, if there are other issues feel free to open a new issue.