Skip to content

jsonschema

ecoscope.platform.jsonschema

Classes

RJSFFilter

Bases: BaseModel

Model representing a React JSON Schema Form filter.

Attributes
property instance-attribute
uiSchema instance-attribute

RJSFFilterProperty

Bases: BaseModel

Model representing the properties of a React JSON Schema Form filter. This model is used to generate the properties field for a filter schema in a dashboard.

Parameters:

Name Type Description Default
type

The type of the filter property.

required
oneOf

The possible values for the filter property.

required
default

The default value for the filter property

required
Attributes
default instance-attribute
default: str
oneOf instance-attribute
oneOf: list[oneOf]
title instance-attribute
title: str
type instance-attribute
type: str

RJSFFilterUiSchema

Bases: BaseModel

Model representing the UI schema of a React JSON Schema Form filter. This model is used to generate the uiSchema field for a filter schema in a dashboard.

Parameters:

Name Type Description Default
title

The title of the filter.

required
help

The help text for the filter.

required
Attributes
help class-attribute instance-attribute
help: str | None = None
title instance-attribute
title: str
widget class-attribute instance-attribute
widget: Literal['select'] = 'select'
Methods:
ser_model
ser_model() -> dict[str, Any]
Source code in ecoscope/platform/jsonschema.py
@model_serializer
def ser_model(self) -> dict[str, Any]:
    return {
        "ui:title": self.title,
        "ui:widget": self.widget,
    } | ({"ui:help": self.help} if self.help else {})

ReactJSONSchemaFormFilters

Bases: BaseModel

Attributes
options instance-attribute
options: dict[str, RJSFFilter]
Methods:
ser_model
ser_model() -> dict[str, Any]
Source code in ecoscope/platform/jsonschema.py
@model_serializer
def ser_model(self) -> dict[str, Any]:
    return {"schema": self._schema}

oneOf

Bases: BaseModel

Model representing the oneOf field in a JSON schema.

Parameters:

Name Type Description Default
const

The value that will appear in the form data.

required
title

The user-facing name that will appear in the input widget.

required
Attributes
const instance-attribute
const: Any
title instance-attribute
title: str