Skip to content

Add visualization for combined schemas#7

Merged
rufuspollock merged 3 commits into
masterfrom
feature/combining-schemas
Aug 25, 2020
Merged

Add visualization for combined schemas#7
rufuspollock merged 3 commits into
masterfrom
feature/combining-schemas

Conversation

@cuducos

@cuducos cuducos commented Aug 24, 2020

Copy link
Copy Markdown
Contributor

JSON Schema specs define fields such as oneOf, anyOf, allOf and not as combining schemas for validation. In our test case, for example, the field path can be either a string or an array of strings and jsv wasn‘t showing that explicitly:

Path

A reference to the data for this resource, as either a path as a string, or an array of paths as strings. of valid URIs.
The dereferenced value of each referenced data source in path MUST be commensurate with a native, dereferenced representation of the data the resource describes. For example, in a Tabular Data Resource, this means that the dereferenced value of path MUST be an array.

Examples

  • {"path":["file.csv","file2.csv"]}
  • {"path":["http://example.com/file.csv","http://example.com/file2.csv"]}
  • {"path":"http://example.com/file.csv"}

This PR enhances the visualizations showing detailed combined schema information:

Path

A reference to the data for this resource, as either a path as a string, or an array of paths as strings. of valid URIs.

The dereferenced value of each referenced data source in path MUST be commensurate with a native, dereferenced representation of the data the resource describes. For example, in a Tabular Data Resource, this means that the dereferenced value of path MUST be an array.

Validation

It must satisfy one of these conditions

Path

(string)

A fully qualified URL, or a POSIX file path..

Implementations need to negotiate the type of path provided, and dereference the data accordingly.

Examples
  • {"path":"file.csv"}

  • {"path":"http://example.com/file.csv"}

(array)

Examples
  • ["file.csv"]

  • ["http://example.com/file.csv"]

Examples

  • {"path":["file.csv","file2.csv"]}

  • {"path":["http://example.com/file.csv","http://example.com/file2.csv"]}

  • {"path":"http://example.com/file.csv"}

This allow us to call the template for a given property recursively,
enabling us to imrpove towards nested fields.
@rufuspollock
rufuspollock merged commit 169e884 into master Aug 25, 2020
@cuducos
cuducos deleted the feature/combining-schemas branch August 31, 2020 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants