Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Codegen doesn't support nullable types

Open
#149 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

The failure is in rpdk/java/pojo_resolver.py, in _java_property_type, reached by cfn-cli generate; start there and reproduce with the nullable Canceled schema. Done means generation succeeds for the ["integer", "null"] property without the unhashable-list error.

Written by the indexing model from the issue text.

Description

bug question

This is the property that I’m trying to define:

    "Canceled": {
        "description": "POSIX Timestamp of cancellation of this downtime (null if not canceled)",
        "type": ["integer", "null"]
    },

This should be ok according to JsonSchema, but cfn-cli generate fails and rpdk.log contains this:

Traceback (most recent call last):
  File "/Users/.../programming/aws-cloudformation-rpdk-nightly/env/lib/python3.7/site-packages/rpdk/core/cli.py", line 95, in main
    args.command(args)
  File "/Users/.../programming/aws-cloudformation-rpdk-nightly/env/lib/python3.7/site-packages/rpdk/core/generate.py", line 15, in generate
    project.generate()
  File "/Users/.../programming/aws-cloudformation-rpdk-nightly/env/lib/python3.7/site-packages/rpdk/core/project.py", line 190, in generate
    return self._plugin.generate(self)
  File "/Users/.../programming/aws-cloudformation-rpdk-nightly/env/lib/python3.7/site-packages/rpdk/java/codegen.py", line 255, in generate
    pojos = pojo_resolver.resolve_pojos()
  File "/Users/.../programming/aws-cloudformation-rpdk-nightly/env/lib/python3.7/site-packages/rpdk/java/pojo_resolver.py", line 58, in resolve_pojos
    java_property_map[prop_name] = self._java_property_type(prop_schema)
  File "/Users/.../programming/aws-cloudformation-rpdk-nightly/env/lib/python3.7/site-packages/rpdk/java/pojo_resolver.py", line 88, in _java_property_type
    return primitive_types_map[json_type]
TypeError: unhashable type: 'list'
Dominant language
Java
Stars
30
Forks
48
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws-cloudformation/cloudformation-cli-java-plugin

All issues in aws-cloudformation/cloudformation-cli-java-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.