Skip to content

Ignore defaults in schema when validating #56

@jonurry

Description

@jonurry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions