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

Ignore defaults in schema when validating #56

Open
jonurry opened this issue Nov 17, 2020 · 0 comments
Open

Ignore defaults in schema when validating #56

jonurry opened this issue Nov 17, 2020 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jonurry
Copy link
Contributor

jonurry commented Nov 17, 2020

The input schema generator performs some validations like checking that types and descriptions exist etc...
It currently treats defaults like any other schema elements and therefore can raise validation issue that are not valid.
e.g. in the data-mapper connector, the map_one_value operation has a default value for the mappings input of:

default: [
	{
		type: 'object',
		value: {
			from: {
				type: 'string',
				value: '',
			},
			to: {
				type: 'string',
				value: '',
			},
		},
	},
],

This issues the following validation errors:

┌─────────┬─────────────────────────────────────────────┬───────────┬─────────────┬────────────────────┐
│ (index) │                     key                     │   type    │ description │ ending punctuation │
├─────────┼─────────────────────────────────────────────┼───────────┼─────────────┼────────────────────┤
│    0    │   'map_one_value.mappings.default.value'    │ 'missing' │             │                    │
│    1    │   'map_one_value.mappings.default.value'    │           │  'missing'  │                    │
│    2    │ 'map_one_value.mappings.default.value.from' │           │  'missing'  │                    │
│    3    │  'map_one_value.mappings.default.value.to'  │           │  'missing'  │                    │
└─────────┴─────────────────────────────────────────────┴───────────┴─────────────┴────────────────────┘

There should be no errors because the default values are not schema declarations, they are just values.

@jonurry jonurry added the bug Something isn't working label Nov 17, 2020
@jonurry jonurry added the good first issue Good for newcomers label Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant