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

fix: class cast exception, map to list #53

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

enderdincer
Copy link

@enderdincer enderdincer commented Aug 21, 2024

      List<Map<String, Object>> specMetadata =
          (List<Map<String, Object>>) spec.getOrDefault("metadata", Collections.emptyMap());

If the desired behaviour is to return an empty collection then returning an empty map is not right here. It should be wrapped in a List or should be an empty list. If spec.metadata is mandatory and shouldn't return an empty collection then it should throw an exception (the right one, not class cast exception).

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.

1 participant