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

#135: added support for lists in map #146

Merged
merged 56 commits into from Oct 26, 2023
Merged

Conversation

jorre127
Copy link
Contributor

@jorre127 jorre127 commented Sep 1, 2023

fixes #135

Base automatically changed from feature/#142-up-test-coverage to master September 7, 2023 10:30
Copy link
Contributor

@vanlooverenkoen vanlooverenkoen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are your tests?

@vanlooverenkoen
Copy link
Contributor

vanlooverenkoen commented Sep 7, 2023

Write at least tests for these scenarios

  • Map<String, List>
  • Map<String, List>
  • Map<int, List>
  • Map<String, List>
  • Map<CustomObject, List> // NOT SURE IF THIS IS EVEN POSSIBLE, but make sure you have good logging

Adding a CustomObject should also add the correct imports. I don't think is is already happening

@vanlooverenkoen
Copy link
Contributor

add docs

@vanlooverenkoen
Copy link
Contributor

Add this to example/config.yaml

ProjectWrapper:
  path: user/project/
  type: object
  properties:
    projectListById:
      type: Map<String, List<Person>>

@jorre127
Copy link
Contributor Author

Add this to example/config.yaml

ProjectWrapper:
  path: user/project/
  type: object
  properties:
    projectListById:
      type: Map<String, List<Person>>

Fixed in next PR

Copy link
Contributor

@ikbendewilliam ikbendewilliam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please improve error handling when updating from older version. Old Enums show this error

Unhandled exception:
type 'Null' is not a subtype of type 'String'
#0      new YmlGeneratorConfig.<anonymous closure>.<anonymous closure> (package:model_generator/config/yml_generator_config.dart:124:13)
#1      MapBase.forEach (dart:collection/maps.dart:35:13)
#2      new YmlGeneratorConfig.<anonymous closure> (package:model_generator/config/yml_generator_config.dart:115:21)
#3      MapBase.forEach (dart:collection/maps.dart:35:13)
#4      new YmlGeneratorConfig (package:model_generator/config/yml_generator_config.dart:35:17)
#5      ModelGenerator.generate (package:model_generator/main.dart:57:11)

@ikbendewilliam
Copy link
Contributor

Maybe we should also allow short notations for enums?

Gender:
  type: enum
  values:
    MALE: male
    FEMALE: femAle
    other: other
    X: x

@ikbendewilliam
Copy link
Contributor

    vehicleFull:
      json_value: VEHICLE_FULL

results in a lowecase jsonValue
@JsonValue('vehicleFull')
Why would we change the capitalization from the jsonValue?

@ikbendewilliam ikbendewilliam merged commit 5cf17a4 into master Oct 26, 2023
3 of 4 checks passed
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 this pull request may close these issues.

Support lists in map
3 participants