oaspec/openapi/provenance

Summarise the provenance of component schemas after the hoist pass has run. Distinguishing user-authored schemas from synthetic ones created during hoisting lets tooling explain where each generated type came from.

Types

Breakdown of component schemas by origin after hoisting.

pub type HoistedSummary {
  HoistedSummary(
    user_authored: List(String),
    hoisted_properties: List(#(String, String, String)),
    hoisted_array_items: List(#(String, String)),
    hoisted_oneof_variants: List(#(String, String, Int)),
    hoisted_anyof_variants: List(#(String, String, Int)),
    hoisted_allof_parts: List(#(String, String, Int)),
    hoisted_request_bodies: List(#(String, String)),
    hoisted_responses: List(#(String, String, String)),
    hoisted_parameters: List(#(String, String, String)),
    hoisted_additional_properties: List(#(String, String)),
  )
}

Constructors

  • HoistedSummary(
      user_authored: List(String),
      hoisted_properties: List(#(String, String, String)),
      hoisted_array_items: List(#(String, String)),
      hoisted_oneof_variants: List(#(String, String, Int)),
      hoisted_anyof_variants: List(#(String, String, Int)),
      hoisted_allof_parts: List(#(String, String, Int)),
      hoisted_request_bodies: List(#(String, String)),
      hoisted_responses: List(#(String, String, String)),
      hoisted_parameters: List(#(String, String, String)),
      hoisted_additional_properties: List(#(String, String)),
    )

Values

pub fn hoisted_schema_summary(
  spec: spec.OpenApiSpec(stage),
) -> HoistedSummary

Walk component schemas and group them by provenance. Reference-only entries (rare after resolve) are ignored because they carry no metadata of their own.

pub fn total_hoisted(summary: HoistedSummary) -> Int

Total number of synthetic schemas that were created during hoisting.

Search Document