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][SEVERE] swagger_dart_code_generator on file.yaml: Unsupported operation: Cannot modify unmodifiable map dart:collection #722

Closed
Rodsevich opened this issue Feb 5, 2024 · 5 comments · Fixed by #730
Assignees
Labels
bug Something isn't working Triage needed

Comments

@Rodsevich
Copy link
Contributor

Rodsevich commented Feb 5, 2024

build_runner log:

[SEVERE] swagger_dart_code_generator on lib/notifier/input/notifier_v1.yaml:

Unsupported operation: Cannot modify unmodifiable map
dart:collection                                                                                    _UnmodifiableMapMixin.addAll
package:swagger_dart_code_generator/src/code_generators/swagger_models_generator.dart 1651:23      SwaggerModelsGenerator.getModelProperties
package:swagger_dart_code_generator/src/code_generators/swagger_models_generator.dart 1394:24      SwaggerModelsGenerator.generateModelClassString
package:swagger_dart_code_generator/src/code_generators/swagger_models_generator.dart 135:12       SwaggerModelsGenerator.generateModelClassContent
package:swagger_dart_code_generator/src/code_generators/swagger_models_generator.dart 302:14       SwaggerModelsGenerator.generateBase.<fn>
dart:core                                                                                          Iterable.join
package:swagger_dart_code_generator/src/code_generators/swagger_models_generator.dart 314:8        SwaggerModelsGenerator.generateBase
package:swagger_dart_code_generator/src/code_generators/v3/swagger_models_generator_v3.dart 46:12  SwaggerModelsGeneratorV3.generate
package:swagger_dart_code_generator/src/swagger_code_generator.dart 81:49                          SwaggerCodeGenerator.generateModels
package:swagger_dart_code_generator/swagger_dart_code_generator.dart 202:34                        SwaggerDartCodeGenerator._generateAndWriteFile
package:swagger_dart_code_generator/swagger_dart_code_generator.dart 178:11                        SwaggerDartCodeGenerator.build

@Rodsevich Rodsevich added bug Something isn't working Triage needed labels Feb 5, 2024
@Rodsevich
Copy link
Contributor Author

On version 2.13.5 it doesn't fail anymore. This must be a bug

@thomtomdup
Copy link

Hello.
I have the same issue that is not fail also with 2.13.5.

@satotoshitaka11
Copy link

Hi,

I've encountered this issue, too.

specifically within the file swagger_models_generator.dart at line 1651.

The current line of code:

final currentProperties = schema.properties.

To resolve this, I suggest modifying the code as follows.

final currentProperties = Map.of(schema.properties)

Could someone please review and consider implementing a fix or guide me on how to proceed with a Pull Request to address this issue?

Thank you for your time and assistance.

Rodsevich added a commit to Rodsevich/swagger-dart-code-generator that referenced this issue Feb 24, 2024
@Rodsevich
Copy link
Contributor Author

I made it on the browser, but here it is:
#727

@diegotori
Copy link
Contributor

@Vovanella95 any chance that we get a release as a result of fixing this issue, since it's been almost a month now without a release.

Thanks in advance.

Vovanella95 pushed a commit that referenced this issue Mar 5, 2024
@Vovanella95 Vovanella95 mentioned this issue Mar 5, 2024
Vovanella95 added a commit that referenced this issue Mar 5, 2024
* Fixed some issues

* formatted code

* updated SDK

* Updated SDK and version

* Fixed generation of lists of classes

* Fixed generation $Items classes

* Updated pubspec and changelog

* Fixed #524

* Fixed #598 Generation of query enum parameters

* Fixed conflicts

* Fixed some issues in swaggers

* Updated changelog and pubspec

* Fix #583, #637, #619 and update readme (#638)

* fix #583 and update readme

* fix #637

* fix #619

* Fixed generation of some fields

* Removed test

* Fixed classes named List

* Fixed generation of query parameters with ref default type

* Fixed generation of DateTime parameters

* Fixed generation of responses in some cases

* Some fixes

* Updated changelog and pubspec

* Implemented not nullable fields

* Fixed tests

* fixed generation of some swaggers

* Added ability to return String values

* Returned main.dart content

* Updated pubspec and changelog

* Fixed generation of required and not required fields

* Added check for object ref in body

* Fixed some things

* Fixed tests

* Fixed tests

* Fixed some things

* Updated changelog and pubspec

* Removed not needed lines in tests

* Fixed generation of nullable responses

* Added generation of DateTime

* Updated pubspec and changelog

* Fixed tests

* Fixed #669 Generation models from content schema allof

* Fixed #665 generation putIfAbsent for response from content schema

* Fixed generation of nullable and required properties

* Fixed tests

* Fixed some stuff related to nullable properties

* Updated changelog and pubspec

* Formatted code

* Formatted code

* Fixed tests

* Fixed generation of some enums inside classes

* Implemented support of exploded parameters

* Pushed constants file

* Fixed generation of allOf for request bodies

* Implemented overriden_models functionality

* Improved overriden models logic

* Fixed tests

* Updated pubspec and changelog

* Removed support of exploded parameters

* Fixed generation of patameters contains keywords

* Updated pubspec and changelog

* Fixed generation of nullable and not nullable fields

* Fixed generation of list parameters with specific names

* Fixed formurlencoded requests

* Revert "Fixed formurlencoded requests"

This reverts commit d103118.

* Updated changelog and pubspec

* formatted code

* Fixed version in changelog

* Added generation of writeOnly and readOnly fields as nullable and no required (Issue 487)

* Fixed generatino of DateTime query parameters (Issue 536)

* Updated pubspec and changelog

* Fixed generation in some cases

* Added ability to rename downloaded files

* Updated example

* Implemented support of deprecated fields annotations

* Added support of deprecated requests annotations

* Fixed tests, updated pubspec and changelog

* Fixed putIfAbsent for allOf schemas #700

* Fixed tests

* Implemented new build option

* Some fixes

* Implemented new generator option

* Updated changelog, readme and pubspec

* Fixed conflicts

* Fixed generation of requestBody when one oneOf provided

* Added override keyword to exceptionWords

* Fixed generation of allOf models

* Revert "Fixed generation of allOf models"

This reverts commit b61b613.

* Updated pubspec and changelog

* Updated changelog

* Fixed #722 generation of some files

---------

Co-authored-by: Uladzimir Paliukhovich <uladzimir_paliukhovich@epam.com>
Co-authored-by: Romain <romain@rb-dev.fr>
Vovanella95 added a commit that referenced this issue Mar 5, 2024
* Fixed some issues

* formatted code

* updated SDK

* Updated SDK and version

* Fixed generation of lists of classes

* Fixed generation $Items classes

* Updated pubspec and changelog

* Fixed #524

* Fixed #598 Generation of query enum parameters

* Fixed conflicts

* Fixed some issues in swaggers

* Updated changelog and pubspec

* Fix #583, #637, #619 and update readme (#638)

* fix #583 and update readme

* fix #637

* fix #619

* Fixed generation of some fields

* Removed test

* Fixed classes named List

* Fixed generation of query parameters with ref default type

* Fixed generation of DateTime parameters

* Fixed generation of responses in some cases

* Some fixes

* Updated changelog and pubspec

* Implemented not nullable fields

* Fixed tests

* fixed generation of some swaggers

* Added ability to return String values

* Returned main.dart content

* Updated pubspec and changelog

* Fixed generation of required and not required fields

* Added check for object ref in body

* Fixed some things

* Fixed tests

* Fixed tests

* Fixed some things

* Updated changelog and pubspec

* Removed not needed lines in tests

* Fixed generation of nullable responses

* Added generation of DateTime

* Updated pubspec and changelog

* Fixed tests

* Fixed #669 Generation models from content schema allof

* Fixed #665 generation putIfAbsent for response from content schema

* Fixed generation of nullable and required properties

* Fixed tests

* Fixed some stuff related to nullable properties

* Updated changelog and pubspec

* Formatted code

* Formatted code

* Fixed tests

* Fixed generation of some enums inside classes

* Implemented support of exploded parameters

* Pushed constants file

* Fixed generation of allOf for request bodies

* Implemented overriden_models functionality

* Improved overriden models logic

* Fixed tests

* Updated pubspec and changelog

* Removed support of exploded parameters

* Fixed generation of patameters contains keywords

* Updated pubspec and changelog

* Fixed generation of nullable and not nullable fields

* Fixed generation of list parameters with specific names

* Fixed formurlencoded requests

* Revert "Fixed formurlencoded requests"

This reverts commit d103118.

* Updated changelog and pubspec

* formatted code

* Fixed version in changelog

* Added generation of writeOnly and readOnly fields as nullable and no required (Issue 487)

* Fixed generatino of DateTime query parameters (Issue 536)

* Updated pubspec and changelog

* Fixed generation in some cases

* Added ability to rename downloaded files

* Updated example

* Implemented support of deprecated fields annotations

* Added support of deprecated requests annotations

* Fixed tests, updated pubspec and changelog

* Fixed putIfAbsent for allOf schemas #700

* Fixed tests

* Implemented new build option

* Some fixes

* Implemented new generator option

* Updated changelog, readme and pubspec

* Fixed conflicts

* Fixed generation of requestBody when one oneOf provided

* Added override keyword to exceptionWords

* Fixed generation of allOf models

* Revert "Fixed generation of allOf models"

This reverts commit b61b613.

* Updated pubspec and changelog

* Updated changelog

* Fixed #722 generation of some files

* Fixed generation of quoted in enum names

---------

Co-authored-by: Uladzimir Paliukhovich <uladzimir_paliukhovich@epam.com>
Co-authored-by: Romain <romain@rb-dev.fr>
Vovanella95 added a commit that referenced this issue Mar 5, 2024
* Fixed some issues

* formatted code

* updated SDK

* Updated SDK and version

* Fixed generation of lists of classes

* Fixed generation $Items classes

* Updated pubspec and changelog

* Fixed #524

* Fixed #598 Generation of query enum parameters

* Fixed conflicts

* Fixed some issues in swaggers

* Updated changelog and pubspec

* Fix #583, #637, #619 and update readme (#638)

* fix #583 and update readme

* fix #637

* fix #619

* Fixed generation of some fields

* Removed test

* Fixed classes named List

* Fixed generation of query parameters with ref default type

* Fixed generation of DateTime parameters

* Fixed generation of responses in some cases

* Some fixes

* Updated changelog and pubspec

* Implemented not nullable fields

* Fixed tests

* fixed generation of some swaggers

* Added ability to return String values

* Returned main.dart content

* Updated pubspec and changelog

* Fixed generation of required and not required fields

* Added check for object ref in body

* Fixed some things

* Fixed tests

* Fixed tests

* Fixed some things

* Updated changelog and pubspec

* Removed not needed lines in tests

* Fixed generation of nullable responses

* Added generation of DateTime

* Updated pubspec and changelog

* Fixed tests

* Fixed #669 Generation models from content schema allof

* Fixed #665 generation putIfAbsent for response from content schema

* Fixed generation of nullable and required properties

* Fixed tests

* Fixed some stuff related to nullable properties

* Updated changelog and pubspec

* Formatted code

* Formatted code

* Fixed tests

* Fixed generation of some enums inside classes

* Implemented support of exploded parameters

* Pushed constants file

* Fixed generation of allOf for request bodies

* Implemented overriden_models functionality

* Improved overriden models logic

* Fixed tests

* Updated pubspec and changelog

* Removed support of exploded parameters

* Fixed generation of patameters contains keywords

* Updated pubspec and changelog

* Fixed generation of nullable and not nullable fields

* Fixed generation of list parameters with specific names

* Fixed formurlencoded requests

* Revert "Fixed formurlencoded requests"

This reverts commit d103118.

* Updated changelog and pubspec

* formatted code

* Fixed version in changelog

* Added generation of writeOnly and readOnly fields as nullable and no required (Issue 487)

* Fixed generatino of DateTime query parameters (Issue 536)

* Updated pubspec and changelog

* Fixed generation in some cases

* Added ability to rename downloaded files

* Updated example

* Implemented support of deprecated fields annotations

* Added support of deprecated requests annotations

* Fixed tests, updated pubspec and changelog

* Fixed putIfAbsent for allOf schemas #700

* Fixed tests

* Implemented new build option

* Some fixes

* Implemented new generator option

* Updated changelog, readme and pubspec

* Fixed conflicts

* Fixed generation of requestBody when one oneOf provided

* Added override keyword to exceptionWords

* Fixed generation of allOf models

* Revert "Fixed generation of allOf models"

This reverts commit b61b613.

* Updated pubspec and changelog

* Updated changelog

* Fixed #722 generation of some files

* Fixed generation of quoted in enum names

* Fixed generation of some requests with enums

---------

Co-authored-by: Uladzimir Paliukhovich <uladzimir_paliukhovich@epam.com>
Co-authored-by: Romain <romain@rb-dev.fr>
Vovanella95 added a commit that referenced this issue Mar 5, 2024
* Fixed some issues

* formatted code

* updated SDK

* Updated SDK and version

* Fixed generation of lists of classes

* Fixed generation $Items classes

* Updated pubspec and changelog

* Fixed #524

* Fixed #598 Generation of query enum parameters

* Fixed conflicts

* Fixed some issues in swaggers

* Updated changelog and pubspec

* Fix #583, #637, #619 and update readme (#638)

* fix #583 and update readme

* fix #637

* fix #619

* Fixed generation of some fields

* Removed test

* Fixed classes named List

* Fixed generation of query parameters with ref default type

* Fixed generation of DateTime parameters

* Fixed generation of responses in some cases

* Some fixes

* Updated changelog and pubspec

* Implemented not nullable fields

* Fixed tests

* fixed generation of some swaggers

* Added ability to return String values

* Returned main.dart content

* Updated pubspec and changelog

* Fixed generation of required and not required fields

* Added check for object ref in body

* Fixed some things

* Fixed tests

* Fixed tests

* Fixed some things

* Updated changelog and pubspec

* Removed not needed lines in tests

* Fixed generation of nullable responses

* Added generation of DateTime

* Updated pubspec and changelog

* Fixed tests

* Fixed #669 Generation models from content schema allof

* Fixed #665 generation putIfAbsent for response from content schema

* Fixed generation of nullable and required properties

* Fixed tests

* Fixed some stuff related to nullable properties

* Updated changelog and pubspec

* Formatted code

* Formatted code

* Fixed tests

* Fixed generation of some enums inside classes

* Implemented support of exploded parameters

* Pushed constants file

* Fixed generation of allOf for request bodies

* Implemented overriden_models functionality

* Improved overriden models logic

* Fixed tests

* Updated pubspec and changelog

* Removed support of exploded parameters

* Fixed generation of patameters contains keywords

* Updated pubspec and changelog

* Fixed generation of nullable and not nullable fields

* Fixed generation of list parameters with specific names

* Fixed formurlencoded requests

* Revert "Fixed formurlencoded requests"

This reverts commit d103118.

* Updated changelog and pubspec

* formatted code

* Fixed version in changelog

* Added generation of writeOnly and readOnly fields as nullable and no required (Issue 487)

* Fixed generatino of DateTime query parameters (Issue 536)

* Updated pubspec and changelog

* Fixed generation in some cases

* Added ability to rename downloaded files

* Updated example

* Implemented support of deprecated fields annotations

* Added support of deprecated requests annotations

* Fixed tests, updated pubspec and changelog

* Fixed putIfAbsent for allOf schemas #700

* Fixed tests

* Implemented new build option

* Some fixes

* Implemented new generator option

* Updated changelog, readme and pubspec

* Fixed conflicts

* Fixed generation of requestBody when one oneOf provided

* Added override keyword to exceptionWords

* Fixed generation of allOf models

* Revert "Fixed generation of allOf models"

This reverts commit b61b613.

* Updated pubspec and changelog

* Updated changelog

* Fixed #722 generation of some files

* Fixed generation of quoted in enum names

* Fixed generation of some requests with enums

* Updated changelog and pubspec

* Fixed generation of some swaggers

---------

Co-authored-by: Uladzimir Paliukhovich <uladzimir_paliukhovich@epam.com>
Co-authored-by: Romain <romain@rb-dev.fr>
Vovanella95 added a commit that referenced this issue Mar 13, 2024
* Fixed some issues

* formatted code

* updated SDK

* Updated SDK and version

* Fixed generation of lists of classes

* Fixed generation $Items classes

* Updated pubspec and changelog

* Fixed #524

* Fixed #598 Generation of query enum parameters

* Fixed conflicts

* Fixed some issues in swaggers

* Updated changelog and pubspec

* Fix #583, #637, #619 and update readme (#638)

* fix #583 and update readme

* fix #637

* fix #619

* Fixed generation of some fields

* Removed test

* Fixed classes named List

* Fixed generation of query parameters with ref default type

* Fixed generation of DateTime parameters

* Fixed generation of responses in some cases

* Some fixes

* Updated changelog and pubspec

* Implemented not nullable fields

* Fixed tests

* fixed generation of some swaggers

* Added ability to return String values

* Returned main.dart content

* Updated pubspec and changelog

* Fixed generation of required and not required fields

* Added check for object ref in body

* Fixed some things

* Fixed tests

* Fixed tests

* Fixed some things

* Updated changelog and pubspec

* Removed not needed lines in tests

* Fixed generation of nullable responses

* Added generation of DateTime

* Updated pubspec and changelog

* Fixed tests

* Fixed #669 Generation models from content schema allof

* Fixed #665 generation putIfAbsent for response from content schema

* Fixed generation of nullable and required properties

* Fixed tests

* Fixed some stuff related to nullable properties

* Updated changelog and pubspec

* Formatted code

* Formatted code

* Fixed tests

* Fixed generation of some enums inside classes

* Implemented support of exploded parameters

* Pushed constants file

* Fixed generation of allOf for request bodies

* Implemented overriden_models functionality

* Improved overriden models logic

* Fixed tests

* Updated pubspec and changelog

* Removed support of exploded parameters

* Fixed generation of patameters contains keywords

* Updated pubspec and changelog

* Fixed generation of nullable and not nullable fields

* Fixed generation of list parameters with specific names

* Fixed formurlencoded requests

* Revert "Fixed formurlencoded requests"

This reverts commit d103118.

* Updated changelog and pubspec

* formatted code

* Fixed version in changelog

* Added generation of writeOnly and readOnly fields as nullable and no required (Issue 487)

* Fixed generatino of DateTime query parameters (Issue 536)

* Updated pubspec and changelog

* Fixed generation in some cases

* Added ability to rename downloaded files

* Updated example

* Implemented support of deprecated fields annotations

* Added support of deprecated requests annotations

* Fixed tests, updated pubspec and changelog

* Fixed putIfAbsent for allOf schemas #700

* Fixed tests

* Implemented new build option

* Some fixes

* Implemented new generator option

* Updated changelog, readme and pubspec

* Fixed conflicts

* Fixed generation of requestBody when one oneOf provided

* Added override keyword to exceptionWords

* Fixed generation of allOf models

* Revert "Fixed generation of allOf models"

This reverts commit b61b613.

* Updated pubspec and changelog

* Updated changelog

* Fixed #722 generation of some files

* Fixed generation of quoted in enum names

* Fixed generation of some requests with enums

* Updated changelog and pubspec

* Fixed generation of some swaggers

* Improved allOf generation logic

* Updated changelog and pubspec

* Fixed conflicts

* Fixed generation JsonKeys with keywords

* Updated changelog

* Fixed changelog

---------

Co-authored-by: Uladzimir Paliukhovich <uladzimir_paliukhovich@epam.com>
Co-authored-by: Romain <romain@rb-dev.fr>
Vovanella95 added a commit that referenced this issue Sep 18, 2024
* Fixed some issues

* formatted code

* updated SDK

* Updated SDK and version

* Fixed generation of lists of classes

* Fixed generation $Items classes

* Updated pubspec and changelog

* Fixed #524

* Fixed #598 Generation of query enum parameters

* Fixed conflicts

* Fixed some issues in swaggers

* Updated changelog and pubspec

* Fix #583, #637, #619 and update readme (#638)

* fix #583 and update readme

* fix #637

* fix #619

* Fixed generation of some fields

* Removed test

* Fixed classes named List

* Fixed generation of query parameters with ref default type

* Fixed generation of DateTime parameters

* Fixed generation of responses in some cases

* Some fixes

* Updated changelog and pubspec

* Implemented not nullable fields

* Fixed tests

* fixed generation of some swaggers

* Added ability to return String values

* Returned main.dart content

* Updated pubspec and changelog

* Fixed generation of required and not required fields

* Added check for object ref in body

* Fixed some things

* Fixed tests

* Fixed tests

* Fixed some things

* Updated changelog and pubspec

* Removed not needed lines in tests

* Fixed generation of nullable responses

* Added generation of DateTime

* Updated pubspec and changelog

* Fixed tests

* Fixed #669 Generation models from content schema allof

* Fixed #665 generation putIfAbsent for response from content schema

* Fixed generation of nullable and required properties

* Fixed tests

* Fixed some stuff related to nullable properties

* Updated changelog and pubspec

* Formatted code

* Formatted code

* Fixed tests

* Fixed generation of some enums inside classes

* Implemented support of exploded parameters

* Pushed constants file

* Fixed generation of allOf for request bodies

* Implemented overriden_models functionality

* Improved overriden models logic

* Fixed tests

* Updated pubspec and changelog

* Removed support of exploded parameters

* Fixed generation of patameters contains keywords

* Updated pubspec and changelog

* Fixed generation of nullable and not nullable fields

* Fixed generation of list parameters with specific names

* Fixed formurlencoded requests

* Revert "Fixed formurlencoded requests"

This reverts commit d103118.

* Updated changelog and pubspec

* formatted code

* Fixed version in changelog

* Added generation of writeOnly and readOnly fields as nullable and no required (Issue 487)

* Fixed generatino of DateTime query parameters (Issue 536)

* Updated pubspec and changelog

* Fixed generation in some cases

* Added ability to rename downloaded files

* Updated example

* Implemented support of deprecated fields annotations

* Added support of deprecated requests annotations

* Fixed tests, updated pubspec and changelog

* Fixed putIfAbsent for allOf schemas #700

* Fixed tests

* Implemented new build option

* Some fixes

* Implemented new generator option

* Updated changelog, readme and pubspec

* Fixed conflicts

* Fixed generation of requestBody when one oneOf provided

* Added override keyword to exceptionWords

* Fixed generation of allOf models

* Revert "Fixed generation of allOf models"

This reverts commit b61b613.

* Updated pubspec and changelog

* Updated changelog

* Fixed #722 generation of some files

* Fixed generation of quoted in enum names

* Fixed generation of some requests with enums

* Updated changelog and pubspec

* Fixed generation of some swaggers

* Improved allOf generation logic

* Updated changelog and pubspec

* Fixed conflicts

* Fixed generation JsonKeys with keywords

* Updated changelog

* Fixed changelog

* Updated changelod and pubspec

* Allow underscores in classes

* Revert "Allow underscores in classes"

This reverts commit f301cd5.

---------

Co-authored-by: Uladzimir Paliukhovich <uladzimir_paliukhovich@epam.com>
Co-authored-by: Romain <romain@rb-dev.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Triage needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants