Skip to content

JSON Schema

All input/output types derive schemars::JsonSchema for automatic schema generation. Runtime validation uses jsonschema crate.

CompanyProfile (input to engine::evaluate)

FieldTypeRequired
nameStringYes
sectorStringYes
sub_sectorString or nullNo
employeesu32Yes
annual_revenue_eur_mf64Yes
balance_sheet_eur_mf64Yes
servicesVec<String>Yes
member_statesVec<String>Yes

Note: The API normalizes sector to lowercase and trims whitespace. The rule engine performs case-sensitive matching against known sector codes.

ComplianceStatus (output of engine::evaluate)

FieldTypeDescription
applicableboolWhether NIS2 applies
categoryenumEssential, Important, or OutOfScope
obligationsVec<Obligation>16 items when in scope, 0 when out
max_sanction_eurOption<f64>None when out of scope
incident_reportingOption<IncidentReporting>None when out of scope

ApplicabilityResponse (API /api/v1/applicability)

FieldTypeDescription
applicableboolWhether NIS2 applies
categoryStringEssential, Important, or OutOfScope
sectorStringNormalized sector code
employeesu32Input employee count
disclaimerStringLegal disclaimer text
sector_warningString or nullWarning when sector is unrecognized

Obligation

FieldType
idString (e.g. nis2_art21_2_a)
article_refString (e.g. Art. 21(2)(a))
descriptionString (Italian)
legal_textString (Italian)
statusenum: Pending, Compliant, NonCompliant, PartiallyCompliant

IncidentReporting

FieldTypeValue
early_warning_hoursu3224
notification_hoursu3272
final_report_daysu3230

Runtime validation

rust
nis2_rules::validation::validate_company_profile(&json_value)?;
nis2_rules::validation::validate_compliance_status(&json_value)?;

Schemas are generated from Rust types at compile time via schemars, not written by hand.

Released under the EUPL-1.2 License.