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

Array of array json schema support added #76

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

kamathchethan
Copy link
Contributor

@kamathchethan kamathchethan commented Aug 14, 2023

Fix for Issue: #55
With current implementation we array of array is not handled added support for the same.

Input

{
    "filters": [
        [
            {
                "operator": "EQ",
                "value": "Ice Cold"
            }
        ]
    ]
}

Output before fix

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "filters": {
            "type": "array",
            "items": {
                "type": "array"
            }
        }
    },
    "required": [
        "filters"
    ]
}

Output after fix

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "filters": {
            "type": "array",
            "items": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "operator": {
                            "type": "string"
                        },
                        "value": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    },
    "required": [
        "filters"
    ]
}

@nijikokun nijikokun merged commit 01a95bb into nijikokun:master Jan 30, 2024
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

Successfully merging this pull request may close these issues.

2 participants