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] Generation fails for "discriminatorType" element in my swagger file #311

Closed
ATeteryatnikov opened this issue Jan 14, 2022 · 1 comment · Fixed by #312
Closed

[BUG] Generation fails for "discriminatorType" element in my swagger file #311

ATeteryatnikov opened this issue Jan 14, 2022 · 1 comment · Fixed by #312
Assignees
Labels
bug Something isn't working

Comments

@ATeteryatnikov
Copy link

if swagger json file has "discriminatorType" element then an error occurs:
"type 'String' is not a subtype of type 'Map<String, dynamic>' in type cast"

To Reproduce
part of my model for example:

"V1ListArticle": { "allOf": [ { "$ref": "#/definitions/BaseRecord" }, { "type": "object", "properties": { "articleRank": { "type": "number" }, "discriminatorType": "#/definitions/V1ListArticle" } } ] },

If I remove "discriminatorType" is work.

Library version used:
2.3.5

@ATeteryatnikov ATeteryatnikov added bug Something isn't working Triage needed labels Jan 14, 2022
Vovanella95 pushed a commit that referenced this issue Jan 14, 2022
@Vovanella95
Copy link
Collaborator

Hi @ATeteryatnikov ,

I have fixed generation error you've described. The only thing - discriminatorType: '#/definitions/V1ListArticle' will not be generated like final V1ListArticle discriminatorType because it's not valid swagger. You can put in into Swagger editor and check.

There are 2 problems:

Semantic error at definitions.V1ListArticle.allOf.0.$ref
$refs must reference a valid location in the document
Jump to line 582

Structural error at definitions.V1ListArticle.allOf.1.properties.discriminatorType
should be object
Jump to line 587

Anyway, your file generating well now. (version 2.3.6 and higher) Enjoy using our generator! :)

Vovanella95 added a commit that referenced this issue Jan 14, 2022
* Fixed some issues

* Added fix for Field annotations. Updatec changelog and pubspec

* Fixed lot of issues with AllOf support

* Updated changelog and pubspec

* Added requestbodies generation from requests

* Add windows support (#273)

* Run CI on windows too

* chore: Fix a number of path joins

* fix: Revert change to getFileNameWithoutExtension

* fix: Normalize paths used for extensions

* Fixed errors with requestBodies generation

* Added possibility to use operationId for request name

* Format code

* Updated pubspec and changelog

* Fix tests

* Fix analyser issues

* Updated example readme

* Removed converter generator

* Fix cases when refs are overriden

* Fixed enum generation
Changed int64 parsing to double

* Released 2.2.8

* Added support int64

* Updated changelog and pubspec

* Fix for models int64

* Updated changelog and pubspec

* Removed not needed file

* Fixed responses array of int

* Reverted analysis options

* Updated changelog

* Updated version

* Fixed tests

* Fixed analyser issues

* Fixed issue #291

* updated changelog and pubcpec

* Added parsing of security for requests

* Fixed num parsing as Num

* Implemented security keys definition

* Removed not needed prints

* Updated changelog and pubspec

* Removed use_inheritance field

* Removed outdated tests

* Implemented integer enums support

* Updated changelog and pubspec

* Fixed fromJson for integer enum fields

* Updated changelog and pubspec

* Formatted code

* Updated changelog

* Fixed issue 263

* Fixed test

* Fixed issue #311

* Updated pubspec and changelog

Co-authored-by: uladzimir_paliukhovich <>
Co-authored-by: Elliana May <me@mause.me>
Vovanella95 added a commit that referenced this issue Jan 14, 2022
* Fixed some issues

* Added fix for Field annotations. Updatec changelog and pubspec

* Fixed lot of issues with AllOf support

* Updated changelog and pubspec

* Added requestbodies generation from requests

* Add windows support (#273)

* Run CI on windows too

* chore: Fix a number of path joins

* fix: Revert change to getFileNameWithoutExtension

* fix: Normalize paths used for extensions

* Fixed errors with requestBodies generation

* Added possibility to use operationId for request name

* Format code

* Updated pubspec and changelog

* Fix tests

* Fix analyser issues

* Updated example readme

* Removed converter generator

* Fix cases when refs are overriden

* Fixed enum generation
Changed int64 parsing to double

* Released 2.2.8

* Added support int64

* Updated changelog and pubspec

* Fix for models int64

* Updated changelog and pubspec

* Removed not needed file

* Fixed responses array of int

* Reverted analysis options

* Updated changelog

* Updated version

* Fixed tests

* Fixed analyser issues

* Fixed issue #291

* updated changelog and pubcpec

* Added parsing of security for requests

* Fixed num parsing as Num

* Implemented security keys definition

* Removed not needed prints

* Updated changelog and pubspec

* Removed use_inheritance field

* Removed outdated tests

* Implemented integer enums support

* Updated changelog and pubspec

* Fixed fromJson for integer enum fields

* Updated changelog and pubspec

* Formatted code

* Updated changelog

* Fixed issue 263

* Fixed test

* Fixed issue #311

* Updated pubspec and changelog

* Fixed list enums generation in requests

* Updated pubspec and changelog

Co-authored-by: uladzimir_paliukhovich <>
Co-authored-by: Elliana May <me@mause.me>
Vovanella95 added a commit that referenced this issue Jan 14, 2022
* Fixed some issues

* Added fix for Field annotations. Updatec changelog and pubspec

* Fixed lot of issues with AllOf support

* Updated changelog and pubspec

* Added requestbodies generation from requests

* Add windows support (#273)

* Run CI on windows too

* chore: Fix a number of path joins

* fix: Revert change to getFileNameWithoutExtension

* fix: Normalize paths used for extensions

* Fixed errors with requestBodies generation

* Added possibility to use operationId for request name

* Format code

* Updated pubspec and changelog

* Fix tests

* Fix analyser issues

* Updated example readme

* Removed converter generator

* Fix cases when refs are overriden

* Fixed enum generation
Changed int64 parsing to double

* Released 2.2.8

* Added support int64

* Updated changelog and pubspec

* Fix for models int64

* Updated changelog and pubspec

* Removed not needed file

* Fixed responses array of int

* Reverted analysis options

* Updated changelog

* Updated version

* Fixed tests

* Fixed analyser issues

* Fixed issue #291

* updated changelog and pubcpec

* Added parsing of security for requests

* Fixed num parsing as Num

* Implemented security keys definition

* Removed not needed prints

* Updated changelog and pubspec

* Removed use_inheritance field

* Removed outdated tests

* Implemented integer enums support

* Updated changelog and pubspec

* Fixed fromJson for integer enum fields

* Updated changelog and pubspec

* Formatted code

* Updated changelog

* Fixed issue 263

* Fixed test

* Fixed issue #311

* Updated pubspec and changelog

* Fixed list enums generation in requests

* Updated pubspec and changelog

* Fixed issue #296

* Updated pubspec and changelog

* Fixed conflicts

Co-authored-by: uladzimir_paliukhovich <>
Co-authored-by: Elliana May <me@mause.me>
Vovanella95 added a commit that referenced this issue Jan 19, 2022
* Fixed some issues

* Added fix for Field annotations. Updatec changelog and pubspec

* Fixed lot of issues with AllOf support

* Updated changelog and pubspec

* Added requestbodies generation from requests

* Add windows support (#273)

* Run CI on windows too

* chore: Fix a number of path joins

* fix: Revert change to getFileNameWithoutExtension

* fix: Normalize paths used for extensions

* Fixed errors with requestBodies generation

* Added possibility to use operationId for request name

* Format code

* Updated pubspec and changelog

* Fix tests

* Fix analyser issues

* Updated example readme

* Removed converter generator

* Fix cases when refs are overriden

* Fixed enum generation
Changed int64 parsing to double

* Released 2.2.8

* Added support int64

* Updated changelog and pubspec

* Fix for models int64

* Updated changelog and pubspec

* Removed not needed file

* Fixed responses array of int

* Reverted analysis options

* Updated changelog

* Updated version

* Fixed tests

* Fixed analyser issues

* Fixed issue #291

* updated changelog and pubcpec

* Added parsing of security for requests

* Fixed num parsing as Num

* Implemented security keys definition

* Removed not needed prints

* Updated changelog and pubspec

* Removed use_inheritance field

* Removed outdated tests

* Implemented integer enums support

* Updated changelog and pubspec

* Fixed fromJson for integer enum fields

* Updated changelog and pubspec

* Formatted code

* Updated changelog

* Fixed issue 263

* Fixed test

* Fixed issue #311

* Updated pubspec and changelog

* Fixed list enums generation in requests

* Updated pubspec and changelog

* Fixed issue #296

* Updated pubspec and changelog

* Fixed conflicts

* [BUB] Array in spec is not being generated as expected

* Updated pubspec and changelog

Co-authored-by: uladzimir_paliukhovich <>
Co-authored-by: Elliana May <me@mause.me>
Vovanella95 added a commit that referenced this issue Jan 27, 2022
* Fixed some issues

* Added fix for Field annotations. Updatec changelog and pubspec

* Fixed lot of issues with AllOf support

* Updated changelog and pubspec

* Added requestbodies generation from requests

* Add windows support (#273)

* Run CI on windows too

* chore: Fix a number of path joins

* fix: Revert change to getFileNameWithoutExtension

* fix: Normalize paths used for extensions

* Fixed errors with requestBodies generation

* Added possibility to use operationId for request name

* Format code

* Updated pubspec and changelog

* Fix tests

* Fix analyser issues

* Updated example readme

* Removed converter generator

* Fix cases when refs are overriden

* Fixed enum generation
Changed int64 parsing to double

* Released 2.2.8

* Added support int64

* Updated changelog and pubspec

* Fix for models int64

* Updated changelog and pubspec

* Removed not needed file

* Fixed responses array of int

* Reverted analysis options

* Updated changelog

* Updated version

* Fixed tests

* Fixed analyser issues

* Fixed issue #291

* updated changelog and pubcpec

* Added parsing of security for requests

* Fixed num parsing as Num

* Implemented security keys definition

* Removed not needed prints

* Updated changelog and pubspec

* Removed use_inheritance field

* Removed outdated tests

* Implemented integer enums support

* Updated changelog and pubspec

* Fixed fromJson for integer enum fields

* Updated changelog and pubspec

* Formatted code

* Updated changelog

* Fixed issue 263

* Fixed test

* Fixed issue #311

* Updated pubspec and changelog

* Fixed list enums generation in requests

* Updated pubspec and changelog

* Fixed issue #296

* Updated pubspec and changelog

* Fixed conflicts

* [BUB] Array in spec is not being generated as expected

* Updated pubspec and changelog

* Fixed responses returns Stream<Something>
Fixed cases when we have List<List<...<List<SomeClass> in model parameter

* Updated changelog and pubspec

Co-authored-by: uladzimir_paliukhovich <>
Co-authored-by: Elliana May <me@mause.me>
Vovanella95 added a commit that referenced this issue Jan 31, 2022
* Fixed some issues

* Added fix for Field annotations. Updatec changelog and pubspec

* Fixed lot of issues with AllOf support

* Updated changelog and pubspec

* Added requestbodies generation from requests

* Add windows support (#273)

* Run CI on windows too

* chore: Fix a number of path joins

* fix: Revert change to getFileNameWithoutExtension

* fix: Normalize paths used for extensions

* Fixed errors with requestBodies generation

* Added possibility to use operationId for request name

* Format code

* Updated pubspec and changelog

* Fix tests

* Fix analyser issues

* Updated example readme

* Removed converter generator

* Fix cases when refs are overriden

* Fixed enum generation
Changed int64 parsing to double

* Released 2.2.8

* Added support int64

* Updated changelog and pubspec

* Fix for models int64

* Updated changelog and pubspec

* Removed not needed file

* Fixed responses array of int

* Reverted analysis options

* Updated changelog

* Updated version

* Fixed tests

* Fixed analyser issues

* Fixed issue #291

* updated changelog and pubcpec

* Added parsing of security for requests

* Fixed num parsing as Num

* Implemented security keys definition

* Removed not needed prints

* Updated changelog and pubspec

* Removed use_inheritance field

* Removed outdated tests

* Implemented integer enums support

* Updated changelog and pubspec

* Fixed fromJson for integer enum fields

* Updated changelog and pubspec

* Formatted code

* Updated changelog

* Fixed issue 263

* Fixed test

* Fixed issue #311

* Updated pubspec and changelog

* Fixed list enums generation in requests

* Updated pubspec and changelog

* Fixed issue #296

* Updated pubspec and changelog

* Fixed conflicts

* [BUB] Array in spec is not being generated as expected

* Updated pubspec and changelog

* Fixed responses returns Stream<Something>
Fixed cases when we have List<List<...<List<SomeClass> in model parameter

* Updated changelog and pubspec

* Fixed issue 328: Error when swagger has models with name "Type"

* Updated changelog and pubspec

* Fixed enums naming

Co-authored-by: uladzimir_paliukhovich <>
Co-authored-by: Elliana May <me@mause.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants