Skip to content

Restore per-schema HTML narrative pages for Logical Models and ValueSets#195

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/restore-openapi-documentation
Draft

Restore per-schema HTML narrative pages for Logical Models and ValueSets#195
Copilot wants to merge 2 commits intomainfrom
copilot/restore-openapi-documentation

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

generate_schema_documentation_html() existed in SchemaDocumentationRenderer but was never called in main() — only metadata was collected per schema. As a result, no individual HTML documentation pages with narrative, cross-links, or structured content were produced for any LM or ValueSet.

Changes

  • New generate_individual_schema_page() helper (inner function in main()) encapsulates the page-generation logic:

    • Calls generate_schema_documentation_html() to build narrative HTML (description, schema ID cross-link, sorted enum values for ValueSets, typed property list + required fields for Logical Models, collapsible raw JSON)
    • If an IG-publisher-generated HTML already exists for the schema, injects content at the appropriate section (Expansion for ValueSets, Formal Views for Logical Models)
    • Otherwise, creates a new standalone page using dak-api.html as template via create_html_template_from_existing()
  • Called once per loop — ValueSet processing loop and Logical Model processing loop each call the helper, replacing what would have been duplicated inline blocks

Example output

For a ValueSet schema, the generated page includes:

<div class="schema-documentation">
  <h2>Actions ValueSet</h2>
  <p><strong>Schema ID:</strong> <a href="http://smart.who.int/base/ValueSet-Actions.schema.json"></a></p>
  <h3>Allowed Values</h3>
  <div class="enum-values">
    <span class="enum-value">delete</span>
    <span class="enum-value">query</span>
    <span class="enum-value">register</span>
    <span class="enum-value">update</span>
  </div>
  <details><summary>Full Schema (JSON)</summary></details>
</div>

The DAK API hub (dak-api.html) continues to link to all generated pages as before.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add in openapi documentation</issue_title>
<issue_description>Om PR #102
There was functionality that generated HTML with narrative and crossing link of schemas for each LM and valueset. That functionality has disappeared.

Can it be restored (and updated to match current requirements) ?

Provide implementation options. Do not implement </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…schema

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copilot AI changed the title [WIP] Restore openapi documentation functionality Restore per-schema HTML narrative pages for Logical Models and ValueSets Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add in openapi documentation

2 participants