Most static tests fail when a date-like string is provided as an example value in a job spec YAML

Open Beginner friendly
#3,213 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
aws, github-actions, json, python, yaml
Domain
api, backend, testing

Research direction

Start with apps/render_cf.py and apps/api/src/hyp3_api/api-spec/job_parameters.yml.j2, where api_schema is passed to json.dumps; inspect how job spec YAML is parsed and how the rendering step handles date-like scalar values. Reproduce with the shown start_date example in job_spec/NISAR_CV.yml and run the render or static test command from the issue. Done when the example renders successfully and the static checks pass.

Written by the indexing model from the issue text.

Description

bug

When updating the NISAR_CV.yml file to accept strings formatted as dates in YYYY-MM-DD format, including an example date 2026-06-24 resulted in most of the static tests failing with the error: TypeError: Object of type date is not JSON serializable.

Failing parameter definition:

parameters:
  start_date:
    api_schema:
      description: Start date of CV calculation in YYYY-MM-DD format
        type: string
        pattern: "[0-9]{4}-[0-1][0-9]-[0-3][0-9]"
        example: 2026-06-24 

Result:

Run make security_environment=ASF cfn-lint
rendering job_spec/AK_FIRE_SAFE.yml job_spec/ARIA_AUTORIFT.yml job_spec/ARIA_RAIDER.yml job_spec/ARIA_S1_COSEIS.yml job_spec/ARIA_S1_GUNW.yml job_spec/ARTRAFF_RTC.yml job_spec/AUTORIFT.yml job_spec/FIRE_TRACK.yml job_spec/GLACIER_MELT.yml job_spec/INSAR_GAMMA.yml job_spec/INSAR_ISCE.yml job_spec/INSAR_ISCE_BURST.yml job_spec/INSAR_ISCE_BURST_EC2.yml job_spec/INSAR_ISCE_BURST_SPOT.yml job_spec/INSAR_ISCE_MULTI_BURST.yml job_spec/ITS_LIVE_AUTORIFT.yml job_spec/ITS_LIVE_CROP.yml job_spec/ITS_LIVE_CROP_BULK.yml job_spec/ITS_LIVE_META_BULK.yml job_spec/NISAR_CV.yml job_spec/NISAR_GUNW.yml job_spec/OPERA_DISP_TMS.yml job_spec/OPERA_DIST_S1.yml job_spec/OPERA_DIST_S1_CONFIRMATION.yml job_spec/PISM_EXECUTE.yml job_spec/PISM_GLACIER_RUN.yml job_spec/PISM_ISMIP7_GREENLAND_RUN.yml job_spec/RTC_GAMMA.yml job_spec/SLIMSAR_TDBP.yml job_spec/SRG_GSLC.yml job_spec/SRG_TIME_SERIES.yml job_spec/SRG_TS.yml job_spec/VOLCSARVATORY_MINTPY.yml job_spec/VOLCSARVATORY_MULTI_BURST.yml job_spec/WATER_MAP.yml job_spec/WATER_MAP_EQ.yml for API local and security environment ASF
/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/vcs_versioning/_backends/_git.py:709: UserWarning: "/home/runner/work/hyp3/hyp3" is shallow and may cause errors
  pre_parse(wd)
Traceback (most recent call last):
  File "/home/runner/work/hyp3/hyp3/apps/render_cf.py", line 342, in <module>
    main()
    ~~~~^^
  File "/home/runner/work/hyp3/hyp3/apps/render_cf.py", line 330, in main
    render_templates(
    ~~~~~~~~~~~~~~~~^
        job_types,
        ^^^^^^^^^^
    ...<5 lines>...
        args.same_account_publishing,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/runner/work/hyp3/hyp3/apps/render_cf.py", line 174, in render_templates
    output = template.render(
        job_types=job_types,
    ...<8 lines>...
        job_states=job_states,
    )
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "apps/api/src/hyp3_api/api-spec/job_parameters.yml.j2", line 40, in top-level template code
    {{ json.dumps(parameter_spec['api_schema']) }}
    ^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/json/__init__.py", line 235, in dumps
    return _default_encoder.encode(obj)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/json/encoder.py", line 202, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/json/encoder.py", line 263, in iterencode
    return _iterencode(o, 0)
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/json/encoder.py", line 182, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
                    f'is not JSON serializable')
TypeError: Object of type date is not JSON serializable
make: *** [Makefile:54: render] Error 1
Error: Process completed with exit code 2.

Commenting out the example date field allowed the code to pass the failing tests.

passing parameter definition:

  parameters:
    start_date:
      api_schema:
        description: Start date of CV calculation in YYYY-MM-DD format
        type: string
        pattern: "[0-9]{4}-[0-1][0-9]-[0-3][0-9]"
        #example: 2026-06-24

result:

Run make security_environment=ASF cfn-lint
rendering job_spec/AK_FIRE_SAFE.yml job_spec/ARIA_AUTORIFT.yml job_spec/ARIA_RAIDER.yml job_spec/ARIA_S1_COSEIS.yml job_spec/ARIA_S1_GUNW.yml job_spec/ARTRAFF_RTC.yml job_spec/AUTORIFT.yml job_spec/FIRE_TRACK.yml job_spec/GLACIER_MELT.yml job_spec/INSAR_GAMMA.yml job_spec/INSAR_ISCE.yml job_spec/INSAR_ISCE_BURST.yml job_spec/INSAR_ISCE_BURST_EC2.yml job_spec/INSAR_ISCE_BURST_SPOT.yml job_spec/INSAR_ISCE_MULTI_BURST.yml job_spec/ITS_LIVE_AUTORIFT.yml job_spec/ITS_LIVE_CROP.yml job_spec/ITS_LIVE_CROP_BULK.yml job_spec/ITS_LIVE_META_BULK.yml job_spec/NISAR_CV.yml job_spec/NISAR_GUNW.yml job_spec/OPERA_DISP_TMS.yml job_spec/OPERA_DIST_S1.yml job_spec/OPERA_DIST_S1_CONFIRMATION.yml job_spec/PISM_EXECUTE.yml job_spec/PISM_GLACIER_RUN.yml job_spec/PISM_ISMIP7_GREENLAND_RUN.yml job_spec/RTC_GAMMA.yml job_spec/SLIMSAR_TDBP.yml job_spec/SRG_GSLC.yml job_spec/SRG_TIME_SERIES.yml job_spec/SRG_TS.yml job_spec/VOLCSARVATORY_MINTPY.yml job_spec/VOLCSARVATORY_MULTI_BURST.yml job_spec/WATER_MAP.yml job_spec/WATER_MAP_EQ.yml for API local and security environment ASF
/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/vcs_versioning/_backends/_git.py:709: UserWarning: "/home/runner/work/hyp3/hyp3" is shallow and may cause errors
  pre_parse(wd)
cfn-lint --info --ignore-checks W3002 E3008 --template `find . -name *-cf.yml`
2026-11-06 15:18:41,630 - cfnlint.runner.template.runner - INFO - Run scan of template apps/api/api-cf.yml
2026-11-06 15:18:41,718 - cfnlint.runner.template.runner - INFO - Run scan of template apps/check-processing-time/check-processing-time-cf.yml
2026-11-06 15:18:41,747 - cfnlint.runner.template.runner - INFO - Run scan of template apps/compute-cf.yml
2026-11-06 15:18:41,859 - cfnlint.runner.template.runner - INFO - Run scan of template apps/disable-private-dns/disable-private-dns-cf.yml
2026-11-06 15:18:41,900 - cfnlint.runner.template.runner - INFO - Run scan of template apps/get-files/get-files-cf.yml
2026-11-06 15:18:41,933 - cfnlint.runner.template.runner - INFO - Run scan of template apps/handle-batch-event/handle-batch-event-cf.yml
2026-11-06 15:18:42,014 - cfnlint.runner.template.runner - INFO - Run scan of template apps/main-cf.yml
2026-11-06 15:18:42,240 - cfnlint.runner.template.runner - INFO - Run scan of template apps/monitoring-cf.yml
2026-11-06 15:18:42,260 - cfnlint.runner.template.runner - INFO - Run scan of template apps/scale-cluster/scale-cluster-cf.yml
2026-11-06 15:18:42,434 - cfnlint.runner.template.runner - INFO - Run scan of template apps/search-archive/search-archive-cf.yml
2026-11-06 15:18:42,467 - cfnlint.runner.template.runner - INFO - Run scan of template apps/set-batch-overrides/set-batch-overrides-cf.yml
2026-11-06 15:18:42,494 - cfnlint.runner.template.runner - INFO - Run scan of template apps/start-execution/start-execution-cf.yml
2026-11-06 15:18:42,534 - cfnlint.runner.template.runner - INFO - Run scan of template apps/update-db/update-db-cf.yml
2026-11-06 15:18:42,564 - cfnlint.runner.template.runner - INFO - Run scan of template apps/upload-log/upload-log-cf.yml
2026-11-06 15:18:42,623 - cfnlint.runner.template.runner - INFO - Run scan of template apps/workflow-cf.yml
2026-11-06 15:18:43,015 - cfnlint.runner.template.runner - INFO - Run scan of template cicd-stacks/ASF-deployment-ci-cf.yml
2026-11-06 15:18:43,075 - cfnlint.runner.template.runner - INFO - Run scan of template cicd-stacks/EDC-deployment-ci-cf.yml
2026-11-06 15:18:43,107 - cfnlint.runner.template.runner - INFO - Run scan of template cicd-stacks/JPL-deployment-policy-cf.yml

The issue appears to be the JSON file parsing in render_cf.py

Dominant language
Python
Stars
53
Forks
13
Avg merge
1d 2h
Merged PRs (30d)
20

Getting set up

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 ASFHyP3/hyp3

All issues in ASFHyP3/hyp3

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.