openehr-its 0.0.2

openEHR ITS (Implementation Technology Specifications): canonical JSON + XML serialization, ITS-REST OpenAPI contract, ITS-BMM. Mirrors the specifications-ITS-{JSON,XML,REST,BMM} repos.
Documentation
// @generated by openehr-codegen (emit-rest) — DO NOT EDIT.
//! ITS-REST contract for the `system` API group: DTOs, per-operation
//! param structs, the `SystemApi` server trait, and the route table.

#![allow(
    clippy::all,
    clippy::pedantic,
    clippy::nursery,
    dead_code,
    unused_variables,
    reason = "mechanically generated contract text: the OAS is emitted in full (every DTO, param struct and route, whether or not this workspace consumes it yet), so style and dead-code lints do not apply — the hand-written runtime and the implementing adapter carry the lint bar"
)]
use serde::{Deserialize, Serialize};

/// The `Options` transport DTO of this API group (an ITS-REST OAS
/// component schema).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Options {
    /// The `solution` property of `Options`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub solution: Option<String>,
    /// The `solution_version` property of `Options`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub solution_version: Option<String>,
    /// The `vendor` property of `Options`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub vendor: Option<String>,
    /// The `restapi_specs_version` property of `Options`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub restapi_specs_version: Option<String>,
    /// The `conformance_profile` property of `Options`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub conformance_profile: Option<String>,
    /// The `endpoints` property of `Options`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub endpoints: Option<Vec<String>>,
}

/// Parameters for `options` (path/query/header).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OptionsParams {
    #[serde(rename = "Accept")]
    #[serde(skip_serializing_if = "Option::is_none")]
    /// `Accept` (header)
    pub accept: Option<String>,
}

/// Server contract for the `system` API group (ITS-REST). Every method
/// defaults to returning `ApiError::NotImplemented`, so an implementor
/// (the application service, or a test stub) overrides only the
/// operations it supports.
#[async_trait::async_trait]
pub trait SystemApi {
    /// `OPTIONS /`
    async fn options(
        &self,
        params: OptionsParams,
    ) -> Result<Options, crate::rest::runtime::ApiError> {
        Err(crate::rest::runtime::ApiError::NotImplemented)
    }
}

/// The operations of this group as `(method, path, operation_id)`, for
/// wiring an axum router in `ferroehr-rest`.
pub const ROUTES: &[(&str, &str, &str)] = &[("OPTIONS", "/", "options")];