pulp / pulp/pulpcore

Openapi `Purge` schema has invalid date-time format

Open
#3,585 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue
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

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.