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

make validators errors clearer #4

Open
galcohen92 opened this issue Mar 11, 2019 · 0 comments
Open

make validators errors clearer #4

galcohen92 opened this issue Mar 11, 2019 · 0 comments

Comments

@galcohen92
Copy link
Collaborator

galcohen92 commented Mar 11, 2019

in case of ajv error it return it under the schema endpoint, instead should return array of errors in case of validaiton fail. in case of success validation return empty array.

example:

 let validationErrors = schemaEndpoint.parameters.validate({ query: {},
                headers: { 'host': 'test' },
                path: {},
                files: undefined });
            expect(validationErrors).to.be.eql([
                {
                    'dataPath': '.headers',
                    'keyword': 'required',
                    'message': "should have required property 'api-version'",
                    'params': {
                        'missingProperty': 'api-version'
                    },
                    'schemaPath': '#/properties/headers/required'
                }
            ]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant