Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Restrict properties in $ref #218

Closed
Closed
@BigDataKatha

Description

@BigDataKatha

After researching and reading documentation, I couldn't find the answer to how I can use $ref in order to keep consistency between object fields, but only display required fields.

For example, the device object is:

{
  "category": "Mobile",
  "screenResolution": "360x600",
  "mobileBranding": "Apple",
  "mobileModel": "iPhone",
  "mobileName": "iPhone 6",
  "operatingSystem": "iOS",
  "operatingSystemVersion": "9",
  "isMobileApp": true
}

Referencing the device object in another object, I require only category, screenResolution, and operatingSystem from the original object:

"device": {
      "allOf": [
        {"$ref": "./device.schema.json"},
        {"required": ["category", "screenResolution", "operatingSystem"]}
      ],
      "additionalProperties": false
    }

It seems that the issue of overriding earlier object specifications hasn't been solved?

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