Skip to content

Bug adding non existed default value in patch #653

@TheWatcherCode

Description

@TheWatcherCode

Schema where no default value for objectType:

{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://example.com/main-schema", "type": "object", "properties": { "objectType": { "type": "string", "enum": [ "Table", "Chair", "Planner", "Apple", "Water" ] } }, "required": [ "objectType" ] }

Validate empty json witch patch:
ojson data, patch; compiledSchema.validate(data, patch);

Expected:
Empty patch

Actual:
Path is [{"op":"add","path":"/objectType","value":null}]

What compiler, architecture, and operating system?

  • Compiler: gcc
  • Architecture (e.g. x86, x64) x64
  • Operating system: Linux

What jsoncons library version?

  • Latest release 1.4.3

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions