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

Possible error in dateTime definition #29

Open
photonbit opened this issue Dec 20, 2024 · 1 comment
Open

Possible error in dateTime definition #29

photonbit opened this issue Dec 20, 2024 · 1 comment

Comments

@photonbit
Copy link

Hello!

In a recent pull request of pytdml, 张扬 created a new test that I believe it is raising an error in the definition of dateTime. The current 1.0 and 1.1 definition read as follows:

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://raw.githubusercontent.com/opengeospatial/TrainingDML-AI_SWG/main/schemas/1.0/json_schema/dateTime.json",
    "title": "DateTime",
    "oneOf": [
        {
            "type": "string",
            "format": "date-time"
        },
        {
            "type": "string",
            "format": "date"
        },
        {
            "type": "string",
            "format": "time"
        },
        {
            "type": "string",
            "pattern": "^(19|20)\\d{2}$"
        },
        {
            "type": "string",
            "pattern": "^(19|20)\\d{2}-(0[1-9]|1[0-2])$"
        }
    ]
}

The example value, 2023-10-27T14:30:00, proposed by @Relifest in the test validates against 4 of the 5 possible definitions in the standard. According to https://json-schema.org/understanding-json-schema/reference/combining#anyOf anyOf should be used instead.

@Relifest
Copy link
Contributor

We have made corresponding modifications to solve this issue. At present, the test value, 2023-10-27T14:30:00, can pass the test correctly. Thank you for raising this issue.

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

No branches or pull requests

2 participants