Skip to content

[help] replace invalid values with default values? #379

Closed
@pavitrakumar78

Description

@pavitrakumar78

Hi,

Is it possible to replace the invalid values in a json file with the default specified in the schema?
Ex:
Schema (excerpt):

"foo": {
                "id": "/properties/a/b/c/d/e/foo",
                "type": "integer",
                "title": "The foo Schema.",
                "default": 0,
		"minimum": 0,
		"maximum": 40
              }

JSON (excerpt):

 "foo": -34,

so, is it possible to replace -34 by 0? or with the default minimum value using the path and absolute_schema_path from the validation error?

I understand this is more than just "validation" so I am not sure whether what I am asking is correct or if it is even the right way to approach this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions