- ocdskit.mapping_sheet.mapping_sheet(schema, order_by=None, infer_required=False, extension_field=None, inherit_extension=True, include_codelist=False, include_deprecated=True, include_definitions=False, base_uri=None)#
Returns information about all field paths in a JSON Schema, as columns and rows.
include_definitions=False, this function resolves
schema (dict) – a JSON schema
order_by (str) – the column by which to sort the rows
infer_required (bool) – whether to infer that a field is required if “null” is not in its
extension_field (str) – the property in the JSON schema containing the name of the extension in which each field was defined
inherit_extension (bool) – whether fields defined via $ref properties inherit the “extension” value of their parent field
include_codelist (bool) – whether to include a “codelist” column
include_deprecated (bool) – whether to include any deprecated fields
include_definitions (bool) – whether to traverse the “definitions” property
base_uri (str) – the URL to resolve relative references against
information about all field paths in a JSON Schema, as columns and rows
- Return type:
The columns are:
The first part of the JSON path to the field in the data, e.g.
The JSON path to the field in the data, e.g.
titlein the JSON schema. If the field has no
title, defaults to the field’s name followed by “*”.
descriptionin the JSON schema. URLs are removed (see the
A comma-separated list of the field’s
typein the JSON schema, excluding “null”. If the field has no
type, defaults to “unknown”.
The field’s allowed number of occurrences.
“0..1” if the field defines an optional literal value.
“0..n” if the field defines an optional array.
“1..1” if the field defines a required literal value.
“1..n” if the field defines a required array.
If the field’s schema sets:
enum: “Enum: “ followed by the
enumas a comma-separated list, excluding
items/enum: “Enum: “ followed by the
items/enumas a comma-separated list, excluding
codelistin the JSON schema
The URLs extracted from the field’s
The OCDS minor version in which the field (or its parent) was deprecated
The explanation for the deprecation of the field
The name of the extension that introduced the JSON path (see the
MissingColumnError – if the column by which to order is missing