Openapi `Purge` schema has invalid date-time format
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 598
- Forks
- 168
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 86
Description
Version
pulpcore: 3.23.0
galaxy_ng: 4.7.0
Describe the bug
default date-time format is invalid and generated openapi Purge schema fails on validate_spec
=================================== FAILURES ===================================
________________________ test_galaxy_openapi_validation ________________________
galaxy_ng/tests/integration/api/test_openapi.py:65: in test_galaxy_openapi_validation
validate_spec(galaxy_spec)
/tmp/gng_testing/lib/python3.10/site-packages/openapi_spec_validator/shortcuts.py:17: in validate_spec
return validator.validate(spec, spec_url=spec_url)
/tmp/gng_testing/lib/python3.10/site-packages/openapi_spec_validator/validation/proxies.py:28: in validate
raise err
E openapi_spec_validator.validation.exceptions.OpenAPIValidationError: '2023-01-14' is not a 'date-time'
E
E Failed validating 'format' in schema:
E {'default': '2023-01-14',
E 'description': 'Purge tasks completed earlier than this timestamp. '
E "Format '%Y-%m-%d[T%H:%M:%S]'",
E 'format': 'date-time',
E 'type': 'string'}
E
E On instance:
E '2023-01-14'
=========================== short test summary info ============================
FAILED galaxy_ng/tests/integration/api/test_openapi.py::test_galaxy_openapi_validation - openapi_spec_validator.validation.exceptions.OpenAPIValidationError: '2023-01-14' is not a 'date-time'
To Reproduce
Run the galaxy_ng integration test (https://github.com/ansible/galaxy_ng/blob/2553ee6c136db83c2afb306d2fbea6879cf9c870/galaxy_ng/tests/integration/api/test_openapi.py#L57) or run validate_spec on openapi.json
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with galaxy_ng/tests/integration/api/test_openapi.py at the validation call referenced in the issue, then inspect the generated openapi.json and the Purge schema. Use validate_spec to reproduce the failure; done means the generated Purge default conforms to the declared date-time format and the integration validation passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, python
- Domain
- api, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100