Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]getting error in generate file swagger.dart #328

Closed
AcePariaci opened this issue Jan 29, 2022 · 4 comments · Fixed by #330
Closed

[BUG]getting error in generate file swagger.dart #328

AcePariaci opened this issue Jan 29, 2022 · 4 comments · Fixed by #330

Comments

@AcePariaci
Copy link

Hello,
When i run your exemple everything is fine (thanks for this lib btw :) )
But with my own swagger file, i got an error in the generated my_app.swagger.dart in the JsonConverter initialisation :
The argument type 'Map<Type, Object Function(Map<String, dynamic>)>' can't be assigned to the parameter type 'Map<Type, dynamic Function(Map<String, dynamic>)>'.

Can figure out what's missing...
I add my swagger file, thanks

@AcePariaci
Copy link
Author

{ "swagger": "2.0", "basePath": "/", "schemes": [ "https", "http" ], "paths": { "/natoly/collections/": { "post": { "responses": { "200": { "description": "Success" } }, "operationId": "Create a new collection", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Collection" } } ], "tags": [ "Collections" ] }, "get": { "responses": { "200": { "description": "Success" } }, "operationId": "Get all the collections", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Collection" } } ], "tags": [ "Collections" ] } }, "/natoly/collections/add": { "get": { "responses": { "200": { "description": "Success" } }, "operationId": "Get all addable collections for the given collection", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Collection" } } ], "tags": [ "Collections" ] }, "post": { "responses": { "200": { "description": "Success" } }, "operationId": "Add a collection to the given collection", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Collection" } } ], "tags": [ "Collections" ] }, "delete": { "responses": { "200": { "description": "Success" } }, "operationId": "Remove collection from the given collection", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Collection" } } ], "tags": [ "Collections" ] } }, "/natoly/collections/{u_id}": { "parameters": [ { "in": "query", "description": "The id of the collection", "name": "id", "type": "string" }, { "name": "u_id", "in": "path", "required": true, "type": "integer" } ], "get": { "responses": { "200": { "description": "Success" } }, "operationId": "Get a collection by id", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Collection" } } ], "tags": [ "Collections" ] }, "delete": { "responses": { "200": { "description": "Success" } }, "operationId": "Delete a collection", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Collection" } } ], "tags": [ "Collections" ] } }, "/natoly/dashboards/": { "post": { "responses": { "200": { "description": "Success" } }, "operationId": "Create a new dashboard", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Dashboard" } } ], "tags": [ "Dashboard" ] } }, "/natoly/dashboards/add": { "get": { "responses": { "200": { "description": "Success" } }, "operationId": "Get all addable collections for a given dashboard", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Dashboard" } } ], "tags": [ "Dashboard" ] }, "post": { "responses": { "200": { "description": "Success" } }, "operationId": "Add a collection or a domodule to a dashboard", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Dashboard" } } ], "tags": [ "Dashboard" ] }, "delete": { "responses": { "200": { "description": "Success" } }, "operationId": "Remove a collection or a domodule from the given dashboard", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Dashboard" } } ], "tags": [ "Dashboard" ] } }, "/natoly/dashboards/{db_id}": { "parameters": [ { "in": "query", "description": "The id of the dashboard", "name": "id", "type": "string" }, { "name": "db_id", "in": "path", "required": true, "type": "integer" } ], "get": { "responses": { "200": { "description": "Success" } }, "operationId": "Get a dashboard", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Dashboard" } } ], "tags": [ "Dashboard" ] }, "put": { "responses": { "200": { "description": "Success" } }, "operationId": "Update a dashboard", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Dashboard" } } ], "tags": [ "Dashboard" ] }, "delete": { "responses": { "200": { "description": "Success" } }, "operationId": "Delete a dashboard", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Dashboard" } } ], "tags": [ "Dashboard" ] } }, "/natoly/domodules/": { "put": { "responses": { "200": { "description": "Success" } }, "operationId": "put_dashboards", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "tags": [ "Domodule" ] }, "post": { "responses": { "200": { "description": "Success" } }, "operationId": "Create or update a domodule", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Domodule" } } ], "tags": [ "Domodule" ] } }, "/natoly/domodules/{u_id}": { "parameters": [ { "in": "path", "description": "The id of the user", "name": "u_id", "required": true, "type": "integer" } ], "get": { "responses": { "200": { "description": "Success" } }, "operationId": "Get all domodules of the user u_id", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Domodule" } } ], "tags": [ "Domodule" ] }, "delete": { "responses": { "200": { "description": "Success" } }, "operationId": "delete_domodule", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "tags": [ "Domodule" ] } }, "/natoly/domodules/{u_id}/{d_id}": { "parameters": [ { "in": "path", "description": "The id of the domodule", "name": "d_id", "required": true, "type": "integer" }, { "in": "path", "description": "The id of the user", "name": "u_id", "required": true, "type": "integer" } ], "get": { "responses": { "200": { "description": "Success" } }, "operationId": "Get all domodules of the user u_id and the d_id", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/Domodule" } } ], "tags": [ "Domodule" ] } }, "/natoly/users/": { "post": { "responses": { "200": { "description": "Success" } }, "operationId": "Create a new user", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/User" } } ], "tags": [ "User" ] }, "get": { "responses": { "200": { "description": "Success" } }, "operationId": "Get all the users", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "payload", "required": true, "in": "body", "schema": { "$ref": "#/definitions/User" } } ], "tags": [ "User" ] } }, "/natoly/users/{u_id}": { "parameters": [ { "in": "query", "description": "The id of the user", "name": "id", "type": "string" }, { "name": "u_id", "in": "path", "required": true, "type": "integer" } ], "get": { "responses": { "200": { "description": "Success", "schema": { "type": "array", "items": { "$ref": "#/definitions/User" } } } }, "operationId": "Login", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "tags": [ "User" ] }, "put": { "responses": { "200": { "description": "Success", "schema": { "type": "array", "items": { "$ref": "#/definitions/User" } } } }, "operationId": "Update user", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "tags": [ "User" ] }, "delete": { "responses": { "200": { "description": "Success", "schema": { "type": "array", "items": { "$ref": "#/definitions/User" } } } }, "operationId": "Delete user", "consumes": [ "application/json", "application/xml" ], "produces": [ "application/xml", "application/json" ], "tags": [ "User" ] } } }, "info": { "title": "Natoly Api", "version": "1.0" }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "tags": [ { "name": "User", "description": "User endpoints" }, { "name": "Collections", "description": "Collections endpoints" }, { "name": "Dashboard", "description": "Dashboards endpoints" }, { "name": "Domodule", "description": "Domodules endpoints" } ], "definitions": { "User": { "properties": { "name": { "type": "string" }, "u_id": { "type": "integer" }, "username": { "type": "string" }, "password": { "type": "string" }, "admin": { "type": "boolean" }, "dashboards": { "type": "array", "xml": { "name": "dashboard", "wrapped": true }, "items": { "$ref": "#/definitions/Dashboard" } }, "domodules": { "type": "array", "xml": { "name": "domodule", "wrapped": true }, "items": { "$ref": "#/definitions/Domodule" } } }, "type": "object", "xml": { "name": "User" } }, "Dashboard": { "properties": { "db_id": { "type": "string" }, "name": { "type": "integer" }, "u_id": { "type": "string" }, "collections": { "type": "array", "xml": { "name": "collection", "wrapped": true }, "items": { "$ref": "#/definitions/Collection" } }, "domodules": { "type": "array", "xml": { "name": "domodule", "wrapped": true }, "items": { "$ref": "#/definitions/Domodule" } } }, "type": "object", "xml": { "name": "dashboard" } }, "Collection": { "properties": { "c_id": { "type": "integer" }, "u_id": { "type": "integer" }, "name": { "type": "string" }, "collections": { "type": "array", "xml": { "name": "collection", "wrapped": true }, "items": { "$ref": "#/definitions/Collection" } }, "domodules": { "type": "array", "xml": { "name": "domodule", "wrapped": true }, "items": { "$ref": "#/definitions/Domodule" } } }, "type": "object", "xml": { "name": "Collection" } }, "Domodule": { "properties": { "d_id": { "type": "integer" }, "type": { "type": "array", "xml": { "name": "type", "wrapped": true }, "items": { "$ref": "#/definitions/Type" } }, "address": { "type": "string" }, "icon": { "type": "integer" }, "parameters": { "type": "array", "xml": { "name": "parameter", "wrapped": true }, "items": { "$ref": "#/definitions/ParameterDomodule" } }, "users": { "type": "array", "xml": { "name": "user", "wrapped": true }, "items": { "$ref": "#/definitions/UserDomodule" } } }, "type": "object", "xml": { "name": "Domodule" } }, "Type": { "properties": { "t_id": { "type": "integer" }, "type_name": { "type": "string" }, "parameters": { "type": "array", "xml": { "name": "parameter", "wrapped": true }, "items": { "$ref": "#/definitions/Parameter" } } }, "type": "object", "xml": { "name": "Type" } }, "Parameter": { "properties": { "p_id": { "type": "integer" }, "parameter_type": { "type": "string" }, "name": { "type": "string" }, "widget": { "type": "integer" }, "admin": { "type": "integer" }, "editable": { "type": "integer" } }, "type": "object", "xml": { "name": "Parameter" } }, "ParameterDomodule": { "properties": { "pd_id": { "type": "integer" }, "p_id": { "type": "integer" }, "d_id": { "type": "integer" }, "value": { "type": "string" }, "properties": { "type": "array", "xml": { "name": "property", "wrapped": true }, "items": { "$ref": "#/definitions/Parameter" } } }, "type": "object", "xml": { "name": "ParameterDomodule" } }, "UserDomodule": { "properties": { "ud_id": { "type": "integer" }, "u_id": { "type": "integer" }, "d_id": { "type": "integer" }, "name": { "type": "string" } }, "type": "object", "xml": { "name": "UserDomodule" } } }, "responses": { "ParseError": { "description": "When a mask can't be parsed" }, "MaskError": { "description": "When any error occurs on mask" } } }``

@Vovanella95
Copy link
Collaborator

Hi @AcePariaci
This looks like critical issue. I will check it today

@AcePariaci
Copy link
Author

Thx @Vovanella95 :)

@Vovanella95
Copy link
Collaborator

@AcePariaci please enjoy 2.3.11 version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants