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

BUG: Unique items in array of dictionaries #16

Closed
ghandic opened this issue Apr 14, 2021 · 0 comments · Fixed by #31
Closed

BUG: Unique items in array of dictionaries #16

ghandic opened this issue Apr 14, 2021 · 0 comments · Fixed by #31
Labels
bug Something isn't working

Comments

@ghandic
Copy link
Owner

ghandic commented Apr 14, 2021

Since current implementation is making use of sets in Python, dicts are not hashable, change would be needed to rectify this.

Example

"errors": {
            "type": "object",
            "properties": {
                "validationErrors": {
                    "type": "array",
                    "minItems": 0,
                    "maxItems": 2,
                    "uniqueItems": false,
                    "items": [
                        {
                            "type": "object",
                            "$state": {
                                "error": "lambda: random.choice([{'code':'3013','message':'Mandatory field is either Null or blank','field':'IDNumber'}, {'code':'2013','message':'Mandatory field is either Null or blank','field':'IDNumber'}])"
                            },
                            "properties": {
                                "code": {
                                    "type": "string",
                                    "description": "Error code from Digital gateway validation checks",
                                    "$provider": "lambda: state['validationErrors[0]']['error']['code']"
                                },
                                "message": {
                                    "type": "string",
                                    "description": "",
                                    "$provider": "lambda: state['validationErrors[0]']['error']['message']"
                                },
                                "field": {
                                    "type": "string",
                                    "description": "",
                                    "$provider": "lambda: state['validationErrors[0]']['error']['field']"
                                }
                            },
                            "required": ["code", "message", "field"]
                        }
                    ]
                }
            },
            "required": ["validationErrors"]
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant